Commit 196b9439 authored by Liyuan Li's avatar Liyuan Li

🎨 fix 后台增加服务端日志浏览 #91

parent faff9caa
......@@ -25,10 +25,10 @@
<div>
<label>${content1Label}</label>
<div class="fn__right">
<label for="articleThumbnail" style="margin-bottom: 0">
${useTumbnailLabel}
<input type="checkbox" style="vertical-align: middle;"
id="articleThumbnail" onclick="$('.article__thumbnail').slideToggle()" />
<label for="articleThumbnail" class="checkbox" style="margin-top: 0">
<input type="checkbox"
id="articleThumbnail" onclick="$('.article__thumbnail').slideToggle()"/>
<span>&nbsp;${useTumbnailLabel}</span>
</label>
</div>
<div class="fn__clear"></div>
......@@ -38,7 +38,7 @@
</div>
<div>
<div id="articleContent" name="articleContent"
style="height: 500px;width:100%;"></div>
style="height: 500px;width:100%;"></div>
</div>
</div>
<div>
......@@ -56,11 +56,11 @@
<div class="fn__flex">
<div class="fn__flex fn__flex-1" style="align-items: center">
<label for="permalink" class="permalink__label" style="margin-bottom: 0">${permalink1Label}</label>
<input id="permalink" class="fn__flex-1" type="text" style="margin: 0 12px 0 6px;" />
<input id="permalink" class="fn__flex-1" type="text" style="margin: 0 12px 0 6px;"/>
</div>
<div class="fn__right viewpwd__panel">
<label for="viewPwd">${articleViewPwd1Label}</label>
<input id="viewPwd" type="text" style="width: 156px" />
<input id="viewPwd" type="text" style="width: 156px"/>
</div>
</div>
<div>
......@@ -73,13 +73,14 @@
</span>
<div class="fn__right article-commentable__panel">
<label class="checkbox">
<input type="checkbox" id="articleCommentable" checked />
${allowCommentLabel}
<input type="checkbox" id="articleCommentable" checked/>
<span>&nbsp;${allowCommentLabel}</span>
</label>
&nbsp;
<span id="postToCommunityPanel">
<label class="checkbox">
<input id="postToCommunity" type="checkbox" />
<input id="postToCommunity" type="checkbox"/>
<span>&nbsp;</span>
<a href="https://hacpai.com/article/1546941897596" target="_blank">${syncToCommunityLabel}</a>
</label>
</span>
......@@ -87,10 +88,11 @@
<div class="fn__clear"></div>
</div>
<div class="fn__right">
<button id="unSubmitArticle" class="fn__none marginRight12" onclick="admin.article.unPublish();">${unPublishLabel}</button>
<button id="unSubmitArticle" class="fn__none marginRight12"
onclick="admin.article.unPublish();">${unPublishLabel}</button>
<button class="marginRight12" id="saveArticle">${saveLabel}${draftListLabel}</button>
<button id="submitArticle">${publishLabel}</button>
</div>
<div class="fn__clear"></div>
</div>
${plugins}
\ No newline at end of file
${plugins}
......@@ -29,6 +29,11 @@
<a href="#tools/others/data">${exportDataLabel}</a>
</div>
</li>
<li>
<div id="tabOthers_log">
<a href="#tools/others/log">${viewLogLabel}</a>
</div>
</li>
</ul>
</div>
<div id="tabOthersPanel" class="sub-tabs-main">
......@@ -43,5 +48,8 @@
<button class="fn__margin12" onclick="admin.others.exportJSON();">${exportJSONLabel}</button>
<button class="fn__margin12" onclick="admin.others.exportHexo();">${exportHexoLabel}</button>
</div>
<div id="tabOthersPanel_log" class="fn__none form">
<textarea rows="32" readonly></textarea>
</div>
</div>
${plugins}
......@@ -264,7 +264,7 @@ eval("/*\n * Solo - A small and beautiful blogging system written in Java.\n * C
/*! no static exports found */
/***/ (function(module, exports) {
eval("/*\n * Solo - A small and beautiful blogging system written in Java.\n * Copyright (c) 2010-present, b3log.org\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <https://www.gnu.org/licenses/>.\n */\n\n/**\n * others for admin.\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.4.1.0, Jan 14, 2020\n */\n\n/* others 相关操作 */\nadmin.others = {\n /*\n * @description 初始化\n */\n init: function init() {\n $(\"#tabOthers\").tabs();\n $('#loadMsg').text('');\n },\n\n /*\n * @description 移除未使用的存档\n */\n removeUnusedArchives: function removeUnusedArchives() {\n $(\"#tipMsg\").text(\"\");\n $.ajax({\n url: Label.servePath + \"/console/archive/unused\",\n type: \"DELETE\",\n cache: false,\n success: function success(result, textStatus) {\n $(\"#tipMsg\").text(result.msg);\n }\n });\n },\n\n /*\n * @description 移除未使用的标签\n */\n removeUnusedTags: function removeUnusedTags() {\n $(\"#tipMsg\").text(\"\");\n $.ajax({\n url: Label.servePath + \"/console/tag/unused\",\n type: \"DELETE\",\n cache: false,\n success: function success(result, textStatus) {\n $(\"#tipMsg\").text(result.msg);\n }\n });\n },\n\n /*\n * @description 导出数据为 SQL 文件\n */\n exportSQL: function exportSQL() {\n $(\"#tipMsg\").text(\"\");\n $.ajax({\n url: Label.servePath + \"/console/export/sql\",\n type: \"GET\",\n cache: false,\n success: function success(result, textStatus) {\n // AJAX 下载文件的话这里会发两次请求,用 sc 来判断是否是文件,如果没有 sc 说明文件可以下载(实际上就是 result)\n if (!result.sc) {\n // 再发一次请求进行正式下载\n window.location = Label.servePath + \"/console/export/sql\";\n } else {\n $(\"#tipMsg\").text(result.msg);\n }\n }\n });\n },\n\n /*\n * @description 导出数据为 JSON 文件\n */\n exportJSON: function exportJSON() {\n $(\"#tipMsg\").text(\"\");\n window.open(Label.servePath + \"/console/export/json\");\n },\n\n /*\n * @description 导出数据为 Hexo Markdown 文件\n */\n exportHexo: function exportHexo() {\n $(\"#tipMsg\").text(\"\");\n window.open(Label.servePath + \"/console/export/hexo\");\n },\n\n /*\n * 获取未使用的标签。\n * XXX: Not used this function yet.\n */\n getUnusedTags: function getUnusedTags() {\n $.ajax({\n url: Label.servePath + \"/console/tag/unused\",\n type: \"GET\",\n cache: false,\n success: function success(result, textStatus) {\n $(\"#tipMsg\").text(result.msg);\n\n if (!result.sc) {\n $(\"#loadMsg\").text(\"\");\n return;\n }\n\n var unusedTags = result.unusedTags;\n\n if (0 === unusedTags.length) {\n return;\n }\n }\n });\n }\n};\n/*\n * 注册到 admin 进行管理\n */\n\nadmin.register.others = {\n \"obj\": admin.others,\n \"init\": admin.others.init,\n \"refresh\": function refresh() {\n admin.clearTip();\n }\n};\n\n//# sourceURL=webpack:///./src/main/resources/js/admin/others.js?");
eval("/*\n * Solo - A small and beautiful blogging system written in Java.\n * Copyright (c) 2010-present, b3log.org\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <https://www.gnu.org/licenses/>.\n */\n\n/**\n * others for admin.\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.4.1.0, Apr 2, 2020\n */\n\n/* others 相关操作 */\nadmin.others = {\n intervalId: 0,\n\n /*\n * @description 初始化\n */\n init: function init() {\n $('#tabOthers').tabs();\n $('#loadMsg').text('');\n clearInterval(admin.others.intervalId);\n admin.others.intervalId = setInterval(function () {\n admin.others.getLog();\n }, 5000);\n admin.others.getLog();\n },\n getLog: function getLog() {\n $.ajax({\n url: Label.servePath + '/console/log',\n cache: false,\n timeout: 3000,\n success: function success(result) {\n $('#tabOthersPanel_log textarea').val(result.log);\n }\n });\n },\n\n /*\n * @description 移除未使用的存档\n */\n removeUnusedArchives: function removeUnusedArchives() {\n $('#tipMsg').text('');\n $.ajax({\n url: Label.servePath + '/console/archive/unused',\n type: 'DELETE',\n cache: false,\n success: function success(result, textStatus) {\n $('#tipMsg').text(result.msg);\n }\n });\n },\n\n /*\n * @description 移除未使用的标签\n */\n removeUnusedTags: function removeUnusedTags() {\n $('#tipMsg').text('');\n $.ajax({\n url: Label.servePath + '/console/tag/unused',\n type: 'DELETE',\n cache: false,\n success: function success(result, textStatus) {\n $('#tipMsg').text(result.msg);\n }\n });\n },\n\n /*\n * @description 导出数据为 SQL 文件\n */\n exportSQL: function exportSQL() {\n $('#tipMsg').text('');\n $.ajax({\n url: Label.servePath + '/console/export/sql',\n type: 'GET',\n cache: false,\n success: function success(result, textStatus) {\n // AJAX 下载文件的话这里会发两次请求,用 sc 来判断是否是文件,如果没有 sc 说明文件可以下载(实际上就是 result)\n if (!result.sc) {\n // 再发一次请求进行正式下载\n window.location = Label.servePath + '/console/export/sql';\n } else {\n $('#tipMsg').text(result.msg);\n }\n }\n });\n },\n\n /*\n * @description 导出数据为 JSON 文件\n */\n exportJSON: function exportJSON() {\n $('#tipMsg').text('');\n window.open(Label.servePath + '/console/export/json');\n },\n\n /*\n * @description 导出数据为 Hexo Markdown 文件\n */\n exportHexo: function exportHexo() {\n $('#tipMsg').text('');\n window.open(Label.servePath + '/console/export/hexo');\n },\n\n /*\n * 获取未使用的标签。\n * XXX: Not used this function yet.\n */\n getUnusedTags: function getUnusedTags() {\n $.ajax({\n url: Label.servePath + '/console/tag/unused',\n type: 'GET',\n cache: false,\n success: function success(result, textStatus) {\n $('#tipMsg').text(result.msg);\n\n if (!result.sc) {\n $('#loadMsg').text('');\n return;\n }\n\n var unusedTags = result.unusedTags;\n\n if (0 === unusedTags.length) {\n return;\n }\n }\n });\n }\n};\n/*\n * 注册到 admin 进行管理\n */\n\nadmin.register.others = {\n 'obj': admin.others,\n 'init': admin.others.init,\n 'refresh': function refresh() {\n admin.clearTip();\n }\n};\n\n//# sourceURL=webpack:///./src/main/resources/js/admin/others.js?");
/***/ }),
......
......@@ -20,82 +20,98 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.4.1.0, Jan 14, 2020
* @version 1.4.1.0, Apr 2, 2020
*/
/* others 相关操作 */
admin.others = {
intervalId: 0,
/*
* @description 初始化
*/
init: function () {
$("#tabOthers").tabs();
$('#tabOthers').tabs()
$('#loadMsg').text('')
clearInterval(admin.others.intervalId)
admin.others.intervalId = setInterval(() => {
admin.others.getLog()
}, 5000)
admin.others.getLog()
},
getLog: () => {
$.ajax({
url: Label.servePath + '/console/log',
cache: false,
timeout: 3000,
success: function (result) {
$('#tabOthersPanel_log textarea').val(result.log)
},
})
},
/*
* @description 移除未使用的存档
*/
removeUnusedArchives: function () {
$("#tipMsg").text("");
$('#tipMsg').text('')
$.ajax({
url: Label.servePath + "/console/archive/unused",
type: "DELETE",
url: Label.servePath + '/console/archive/unused',
type: 'DELETE',
cache: false,
success: function (result, textStatus) {
$("#tipMsg").text(result.msg);
}
});
$('#tipMsg').text(result.msg)
},
})
},
/*
* @description 移除未使用的标签
*/
removeUnusedTags: function () {
$("#tipMsg").text("");
$('#tipMsg').text('')
$.ajax({
url: Label.servePath + "/console/tag/unused",
type: "DELETE",
url: Label.servePath + '/console/tag/unused',
type: 'DELETE',
cache: false,
success: function (result, textStatus) {
$("#tipMsg").text(result.msg);
}
});
$('#tipMsg').text(result.msg)
},
})
},
/*
* @description 导出数据为 SQL 文件
*/
exportSQL: function () {
$("#tipMsg").text("");
$('#tipMsg').text('')
$.ajax({
url: Label.servePath + "/console/export/sql",
type: "GET",
url: Label.servePath + '/console/export/sql',
type: 'GET',
cache: false,
success: function (result, textStatus) {
// AJAX 下载文件的话这里会发两次请求,用 sc 来判断是否是文件,如果没有 sc 说明文件可以下载(实际上就是 result)
if (!result.sc) {
// 再发一次请求进行正式下载
window.location = Label.servePath + "/console/export/sql";
window.location = Label.servePath + '/console/export/sql'
} else {
$("#tipMsg").text(result.msg);
$('#tipMsg').text(result.msg)
}
}
});
},
})
},
/*
* @description 导出数据为 JSON 文件
*/
exportJSON: function () {
$("#tipMsg").text("");
window.open(Label.servePath + "/console/export/json")
$('#tipMsg').text('')
window.open(Label.servePath + '/console/export/json')
},
/*
* @description 导出数据为 Hexo Markdown 文件
*/
exportHexo: function () {
$("#tipMsg").text("");
window.open(Label.servePath + "/console/export/hexo")
$('#tipMsg').text('')
window.open(Label.servePath + '/console/export/hexo')
},
/*
* 获取未使用的标签。
......@@ -103,32 +119,32 @@ admin.others = {
*/
getUnusedTags: function () {
$.ajax({
url: Label.servePath + "/console/tag/unused",
type: "GET",
url: Label.servePath + '/console/tag/unused',
type: 'GET',
cache: false,
success: function (result, textStatus) {
$("#tipMsg").text(result.msg);
$('#tipMsg').text(result.msg)
if (!result.sc) {
$("#loadMsg").text("");
return;
$('#loadMsg').text('')
return
}
var unusedTags = result.unusedTags;
var unusedTags = result.unusedTags
if (0 === unusedTags.length) {
return;
return
}
}
});
}
};
},
})
},
}
/*
* 注册到 admin 进行管理
*/
admin.register.others = {
"obj": admin.others,
"init": admin.others.init,
"refresh": function () {
admin.clearTip();
}
};
'obj': admin.others,
'init': admin.others.init,
'refresh': function () {
admin.clearTip()
},
}
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