Merge remote-tracking branch 'upstream/master'

This commit is contained in:
mofeng-git
2024-11-20 15:18:34 +00:00
166 changed files with 5421 additions and 2645 deletions

View File

@@ -38,13 +38,13 @@ export function main() {
function __loadKvmdInfo() {
tools.httpGet("/api/info?fields=auth,meta,extras", function(http) {
tools.httpGet("/api/info", {"fields": "auth,meta,extras"}, function(http) {
if (http.status === 200) {
let info = JSON.parse(http.responseText).result;
let apps = [];
if (info.extras === null) {
wm.error("Not all applications in the menu can be displayed<br>due an error. See KVMD logs for details.");
wm.error("Not all applications in the menu can be displayed due an error.<br>See KVMD logs for details.");
} else {
apps = Object.values(info.extras).sort(function(a, b) {
if (a.place < b.place) {
@@ -100,7 +100,7 @@ function __makeApp(id, path, icon, name) {
<a href="${path}">
<div>
<img class="svg-gray" src="${icon}">
${name}
${tools.escape(name)}
</div>
</a>
</div>
@@ -108,11 +108,11 @@ function __makeApp(id, path, icon, name) {
}
function __logout() {
tools.httpPost("/api/auth/logout", function(http) {
tools.httpPost("/api/auth/logout", null, function(http) {
if (http.status === 200 || http.status === 401 || http.status === 403) {
document.location.href = "/login";
} else {
wm.error("Logout error:<br>", http.responseText);
wm.error("Logout error", http.responseText);
}
});
}