Commit 2e3b59bf authored by Van's avatar Van

fix #17

parent 212dd23a
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
--> -->
<script src="https://cdn.jsdelivr.net/npm/uvstat@v1.0.1/dist/index.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/uvstat@v1.0.2/dist/index.min.js"></script>
<script> <script>
var Label = { var Label = {
servePath: "${servePath}", servePath: "${servePath}",
......
...@@ -106,5 +106,8 @@ No Result, Return to <a href="${servePath}">Index</a> or <a href="https://hacpai ...@@ -106,5 +106,8 @@ No Result, Return to <a href="${servePath}">Index</a> or <a href="https://hacpai
Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> • Solo ${version} Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> • Solo ${version}
</div> </div>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include 'label.ftl'/>
</body> </body>
</html> </html>
...@@ -142,6 +142,8 @@ admin.articleList = { ...@@ -142,6 +142,8 @@ admin.articleList = {
that.tablePagination.updateTablePagination(articleData, pageNum, that.tablePagination.updateTablePagination(articleData, pageNum,
result.pagination) result.pagination)
Util.uvstat.renderStat()
$('#loadMsg').text('') $('#loadMsg').text('')
}, },
}) })
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
/* draft-list 相关操作 */ /* draft-list 相关操作 */
admin.draftList = { admin.draftList = {
tablePagination: new TablePaginate("draft"), tablePagination: new TablePaginate("draft"),
/* /*
* 初始化 table, pagination, comments dialog * 初始化 table, pagination, comments dialog
*/ */
init: function (page) { init: function (page) {
this.tablePagination.buildTable([{ this.tablePagination.buildTable([{
...@@ -62,14 +62,14 @@ admin.draftList = { ...@@ -62,14 +62,14 @@ admin.draftList = {
this.getList(page); this.getList(page);
}, },
/* /*
* 根据当前页码获取列表 * 根据当前页码获取列表
* @pagNum 当前页码 * @pagNum 当前页码
*/ */
getList: function (pageNum) { getList: function (pageNum) {
$("#loadMsg").text(Label.loadingLabel); $("#loadMsg").text(Label.loadingLabel);
var that = this; var that = this;
$.ajax({ $.ajax({
url: Label.servePath + "/console/articles/status/unpublished/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE, url: Label.servePath + "/console/articles/status/unpublished/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET", type: "GET",
...@@ -80,7 +80,7 @@ admin.draftList = { ...@@ -80,7 +80,7 @@ admin.draftList = {
$("#loadMsg").text(""); $("#loadMsg").text("");
return; return;
} }
var articles = result.articles, var articles = result.articles,
articleData = []; articleData = [];
for (var i = 0; i < articles.length; i++) { for (var i = 0; i < articles.length; i++) {
...@@ -91,15 +91,15 @@ admin.draftList = { ...@@ -91,15 +91,15 @@ admin.draftList = {
articleData[i].articleViewCount = '<span data-uvstaturl="' + Label.servePath + articles[i].articlePermalink + '">0</span>'; articleData[i].articleViewCount = '<span data-uvstaturl="' + Label.servePath + articles[i].articlePermalink + '">0</span>';
articleData[i].author = articles[i].authorName; articleData[i].author = articles[i].authorName;
articleData[i].title = "<a class='no-underline' href='" + Label.servePath + articleData[i].title = "<a class='no-underline' href='" + Label.servePath +
articles[i].articlePermalink + "' target='_blank'>" + articles[i].articlePermalink + "' target='_blank'>" +
articles[i].articleTitle + "</a><span class='table-tag'>" + articles[i].articleTags + "</span>"; articles[i].articleTitle + "</a><span class='table-tag'>" + articles[i].articleTags + "</span>";
articleData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.article.get('" + articles[i].oId + "', false);\">" + Label.updateLabel + "</a> \ articleData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.article.get('" + articles[i].oId + "', false);\">" + Label.updateLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.article.del('" + articles[i].oId + "', 'draft', '" + encodeURIComponent(articles[i].articleTitle) + "')\">" + Label.removeLabel + "</a> \ <a href='javascript:void(0)' onclick=\"admin.article.del('" + articles[i].oId + "', 'draft', '" + encodeURIComponent(articles[i].articleTitle) + "')\">" + Label.removeLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.comment.open('" + articles[i].oId + "', 'draft')\">" + Label.commentLabel + "</a>"; <a href='javascript:void(0)' onclick=\"admin.comment.open('" + articles[i].oId + "', 'draft')\">" + Label.commentLabel + "</a>";
} }
that.tablePagination.updateTablePagination(articleData, pageNum, result.pagination); that.tablePagination.updateTablePagination(articleData, pageNum, result.pagination);
Util.uvstat.renderStat()
$("#loadMsg").text(""); $("#loadMsg").text("");
} }
}); });
...@@ -107,10 +107,10 @@ admin.draftList = { ...@@ -107,10 +107,10 @@ admin.draftList = {
}; };
/* /*
* 注册到 admin 进行管理 * 注册到 admin 进行管理
*/ */
admin.register["draft-list"] = { admin.register["draft-list"] = {
"obj": admin.draftList, "obj": admin.draftList,
"init": admin.draftList.init, "init": admin.draftList.init,
"refresh": admin.draftList.getList "refresh": admin.draftList.getList
}; };
\ No newline at end of file
...@@ -28,13 +28,14 @@ ...@@ -28,13 +28,14 @@
* @static * @static
*/ */
var Util = { var Util = {
uvstat: undefined,
/** /**
* 初始化浏览数 * 初始化浏览数
*/ */
initViewCnt: function () { initViewCnt: function () {
const uvstat = new Uvstat({loading:'<span>0</span>'}) Util.uvstat = new Uvstat({loading:'<span>0</span>'})
uvstat.setStat() Util.uvstat.setStat()
uvstat.renderStat() Util.uvstat.renderStat()
}, },
/** /**
* 是否为文章页面 * 是否为文章页面
...@@ -106,6 +107,7 @@ var Util = { ...@@ -106,6 +107,7 @@ var Util = {
callback: function () { callback: function () {
Util.parseMarkdown() Util.parseMarkdown()
Util.parseLanguage() Util.parseLanguage()
Util.uvstat.renderStat()
cb && cb() cb && cb()
}, },
}) })
......
...@@ -325,6 +325,8 @@ var timeline = { ...@@ -325,6 +325,8 @@ var timeline = {
$(".module img").imagesLoaded(function() { $(".module img").imagesLoaded(function() {
$(window).resize(); $(window).resize();
}); });
Util.uvstat.renderStat()
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment