Security Update

This commit is contained in:
SuperSonic 2020-02-08 16:05:32 +08:00
parent 189a1e2c7d
commit 471fccbfa0

View file

@ -6,10 +6,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
(function () {
$.get("/api/i", function (data) {
yuuki_name = data;
});
function header2html(yuuki_name) {
var page_list = {
"/": "Dashboard",
"/groups": "Groups",
@ -23,8 +20,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
else
nav_list += "<a class=\"nav-link\" data-transition-enter=\"slideleft\" href=\"" + p_key + "\">" + page_list[p_key] + "</a>";
}
var html_text =
"<nav class=\"navbar navbar-expand-md navbar-dark fixed-top bg-dark\">" +
return "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top bg-dark\">" +
"<a class=\"navbar-brand\" href=\"/\">" + yuuki_name + " - WebAdmin</a>" +
"<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarCollapse\"aria-controls=\"navbarCollapse\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">" +
"<span class=\"navbar-toggler-icon\"></span>" +
@ -37,5 +33,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
"<div class=\"nav-scroller bg-white shadow-sm\">" +
"<nav class=\"nav nav-underline\">" + nav_list + "</nav>" +
"</div>";
$("#header").html(html_text);
})();
}
$(function () {
$.get("/api/i", function (data) {
$("#header").html(header2html(data));
});
});