diff --git a/app.js b/app.js index 8803ed5..b84450a 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,5 @@ // Kubek version -global.kubek_version = "v2.1.10"; +global.kubek_version = "v2.1.11"; // Variables and constants initialization global.pendingTasks = {}; diff --git a/package-lock.json b/package-lock.json index c7fff1e..c6ba7ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kubek-minecraft-dashboard", - "version": "2.1.10", + "version": "2.1.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kubek-minecraft-dashboard", - "version": "2.1.10", + "version": "2.1.11", "license": "ISC", "dependencies": { "@sfirew/minecraft-motd-parser": "^1.1.1", diff --git a/package.json b/package.json index 003fc17..7eb03aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kubek-minecraft-dashboard", - "version": "2.1.10", + "version": "2.1.11", "description": "", "main": "app.js", "author": "", diff --git a/www/pages/console.css b/www/pages/console.css index 9f5e441..3951b21 100644 --- a/www/pages/console.css +++ b/www/pages/console.css @@ -14,8 +14,7 @@ grid-template-rows: 0.95fr; gap: 0px 1em; grid-auto-flow: row; - grid-template-areas: - "main-console additional-blocks"; + grid-template-areas: "main-console additional-blocks"; } .console-container .main-console-grid .main-console { @@ -26,6 +25,10 @@ grid-area: additional-blocks; } +.console-container #console-text * { + color: rgb(245, 245, 245); +} + /* Micro blocks */ .micro-block { display: grid; @@ -55,7 +58,7 @@ grid-area: label; font-size: 12pt; font-weight: 400; - align-self: end; + align-self: end; } .micro-block .percent { @@ -78,10 +81,10 @@ .mono-font, .mono-font span { - font-family: 'Roboto Mono Regular' !important; + font-family: "Roboto Mono Regular" !important; } .consolas-font, .consolas-font span { - font-family: 'Consolas' !important; -} \ No newline at end of file + font-family: "Consolas" !important; +} diff --git a/www/pages/console.js b/www/pages/console.js index 79188d2..4a71160 100644 --- a/www/pages/console.js +++ b/www/pages/console.js @@ -96,31 +96,10 @@ function setCTFontFamily(fs) { function refreshConsole(data) { split = data.split(/\r?\n/); $("#console-text").html(""); - + split.forEach(function (line) { - line = mineParse(line.replaceAll("<", "<")).parsed.innerHTML; - - htmlObject = document.createElement("div"); - htmlObject.innerHTML = line; - if (htmlObject.firstChild.firstChild != null) { - html_text = - htmlObject.firstChild.firstChild.wholeText.replaceAll("<", "<") + - "
"; - if (htmlObject.firstChild.style.color != "") { - stl = "color:" + htmlObject.firstChild.style.color + " !important;"; - } else { - stl = ""; - } - html_text = linkify(html_text); - html_text = - "" + - html_text + - ""; - - $("#console-text").html($("#console-text").html() + html_text); - } + html_text = linkify(mineParse(line).raw) + "
"; + $("#console-text").html($("#console-text").html() + html_text); }); if ($("#autoscrollConsoleCheckbox").is(":checked")) { $("#console-text").scrollTop($("#console-text")[0].scrollHeight); diff --git a/www/pages/file_manager.html b/www/pages/file_manager.html index ade080a..2312feb 100644 --- a/www/pages/file_manager.html +++ b/www/pages/file_manager.html @@ -118,44 +118,7 @@ - - - -
- - Kubek Uptime -
- - {{unknown}} - - - -
- - {{os-sysmon}} -
- - {{unknown}} - - - -
- - {{osbuild-sysmon}} -
- - {{unknown}} - - + diff --git a/www/pages/mods.html b/www/pages/mods.html index 884c1e8..4134068 100644 --- a/www/pages/mods.html +++ b/www/pages/mods.html @@ -51,7 +51,7 @@ onclick="uploadPlugin()" class="py-2.5 px-5 mr-2 mb-2 text-sm font-medium text-gray-900 focus:outline-none glassmorphed dark:text-gray-400" > - + @@ -60,7 +60,10 @@ class="w-full text-sm text-left text-gray-500 dark:text-gray-400" > - + {{plugins-repo}} - NEW - + + + @@ -99,7 +103,7 @@ onclick="uploadMod()" class="py-2.5 px-5 mr-2 mb-2 text-sm font-medium text-gray-900 focus:outline-none glassmorphed dark:text-gray-400" > - + diff --git a/www/pages/plugins_repo.js b/www/pages/plugins_repo.js index 5030d09..8582d69 100644 --- a/www/pages/plugins_repo.js +++ b/www/pages/plugins_repo.js @@ -1,12 +1,13 @@ var PR_LIST_URL = - "https://api.spiget.org/v2/resources/free?size=20&sort=-downloads"; + "https://api.modrinth.com/v2/search?filters=categories=paper%20OR%20categories=spigot"; var PR_SEARCH_URL = - "https://api.spiget.org/v2/search/resources/$?size=20&sort=-downloads&fields=url%2CexternalUrl%2Cname%2Cicon%2Cfile%2Crating%2Cdownloads%2Ctag"; + "https://api.modrinth.com/v2/search?filters=categories=paper%20OR%20categories=spigot&query=$"; var PR_TABLE_PLACEHOLDER = - '
'; + '
'; var PR_IMAGE_PLACEHOLDER = '
'; -var currentPage = 1; +var currentPage = 0; +var limit = 20; var currentMode = ""; @@ -23,10 +24,15 @@ $(document).ready(function () { loadPluginsList(); }, 100); - $("#search-input").keydown(function (e) { - if (e.originalEvent.keyCode == 13) { + $("#search-input").keyup(function (e) { + if ($(this).val() != "" && e.originalEvent.keyCode == 13) { searchPlugins(); } + if($(this).val() == ""){ + currentMode = "popular"; + currentPage = 0; + loadPluginsList(); + } }); $("#search-btn").click(function (e) { @@ -41,10 +47,10 @@ function loadPluginsList() { } animateTopbar(25, 50); currentMode = "popular"; - $.get(PR_LIST_URL + "&page=" + currentPage, function (data) { + $.get(PR_LIST_URL + "&offset=" + currentPage * limit, function (data) { animateTopbar(70, 50); $("#plugins-list").html(""); - fillTableFromData(data); + fillTableFromData(data.hits); animateTopbar(100, 10); setTimeout(function () { animateTopbar(0, 5); @@ -62,42 +68,46 @@ function searchPlugins() { currentMode = "search"; $.get( PR_SEARCH_URL.replace(/\$/gm, $("#search-input").val().trim()) + - "&page=" + - currentPage, + "&offset=" + + currentPage * limit, function (data) { animateTopbar(70, 50); $("#plugins-list").html(""); - fillTableFromData(data); + fillTableFromData(data.hits); animateTopbar(100, 10); setTimeout(function () { animateTopbar(0, 5); }, 11); } ); + } else { + currentMode = "popular"; + currentPage = 0; + loadPluginsList(); } } function fillTableFromData(data){ data.forEach((item) => { if ( - item.icon.data.length > 0 + typeof item.icon_url !== "undefined" ) { imgCode = - ''; } else { imgCode = PR_IMAGE_PLACEHOLDER; } $("#plugins-list").append( - '
' + imgCode + '
' + - item.name + + '
' + imgCode + '
' + + item.title + ' ' + - item.tag + + item.description + '
' + item.downloads + ' ' + - item.rating.average.toFixed(2) + + item.follows + '
' ); }); @@ -115,7 +125,7 @@ function nextPage() { } function previousPage() { - if (currentPage > 1) { + if (currentPage > 0) { currentPage--; } if (currentMode == "popular") {