diff --git a/src/ui/app/static/js/pages/bans.js b/src/ui/app/static/js/pages/bans.js index ebf4cb367..7c3e3fb0c 100644 --- a/src/ui/app/static/js/pages/bans.js +++ b/src/ui/app/static/js/pages/bans.js @@ -513,7 +513,13 @@ $(document).ready(function () { bans_table.on("select", function (e, dt, type, indexes) { // Enable the actions button - $(".action-button").removeClass("disabled").parent().tooltip("dispose"); + $(".action-button") + .removeClass("disabled") + .parent() + .attr("data-bs-toggle", null) + .attr("data-bs-original-title", null) + .attr("data-bs-placement", null) + .tooltip("dispose"); }); bans_table.on("deselect", function (e, dt, type, indexes) { @@ -522,6 +528,7 @@ $(document).ready(function () { $(".action-button") .addClass("disabled") .parent() + .attr("data-bs-toggle", "tooltip") .attr( "data-bs-original-title", "Please select one or more rows to perform an action.", diff --git a/src/ui/app/static/js/pages/configs.js b/src/ui/app/static/js/pages/configs.js index 0354b2e1c..a14f3f664 100644 --- a/src/ui/app/static/js/pages/configs.js +++ b/src/ui/app/static/js/pages/configs.js @@ -505,7 +505,13 @@ $(document).ready(function () { configs_table.on("select", function (e, dt, type, indexes) { // Enable the actions button - $(".action-button").removeClass("disabled").parent().tooltip("dispose"); + $(".action-button") + .removeClass("disabled") + .parent() + .attr("data-bs-toggle", null) + .attr("data-bs-original-title", null) + .attr("data-bs-placement", null) + .tooltip("dispose"); }); configs_table.on("deselect", function (e, dt, type, indexes) { @@ -514,6 +520,7 @@ $(document).ready(function () { $(".action-button") .addClass("disabled") .parent() + .attr("data-bs-toggle", "tooltip") .attr( "data-bs-original-title", "Please select one or more rows to perform an action.", diff --git a/src/ui/app/static/js/pages/instances.js b/src/ui/app/static/js/pages/instances.js index 216fb571f..b6679c2fc 100644 --- a/src/ui/app/static/js/pages/instances.js +++ b/src/ui/app/static/js/pages/instances.js @@ -622,7 +622,13 @@ $(document).ready(function () { instances_table.on("select", function (e, dt, type, indexes) { // Enable the actions button - $(".action-button").removeClass("disabled").parent().tooltip("dispose"); + $(".action-button") + .removeClass("disabled") + .parent() + .attr("data-bs-toggle", null) + .attr("data-bs-original-title", null) + .attr("data-bs-placement", null) + .tooltip("dispose"); }); instances_table.on("deselect", function (e, dt, type, indexes) { @@ -631,6 +637,7 @@ $(document).ready(function () { $(".action-button") .addClass("disabled") .parent() + .attr("data-bs-toggle", "tooltip") .attr( "data-bs-original-title", "Please select one or more rows to perform an action.", diff --git a/src/ui/app/static/js/pages/jobs.js b/src/ui/app/static/js/pages/jobs.js index 4c9c495c1..ee35cf163 100644 --- a/src/ui/app/static/js/pages/jobs.js +++ b/src/ui/app/static/js/pages/jobs.js @@ -402,7 +402,13 @@ $(document).ready(function () { jobs_table.on("select", function (e, dt, type, indexes) { // Enable the actions button - $(".action-button").removeClass("disabled").parent().tooltip("dispose"); + $(".action-button") + .removeClass("disabled") + .parent() + .attr("data-bs-toggle", null) + .attr("data-bs-original-title", null) + .attr("data-bs-placement", null) + .tooltip("dispose"); }); jobs_table.on("deselect", function (e, dt, type, indexes) { @@ -411,6 +417,7 @@ $(document).ready(function () { $(".action-button") .addClass("disabled") .parent() + .attr("data-bs-toggle", "tooltip") .attr( "data-bs-original-title", "Please select one or more rows to perform an action.", diff --git a/src/ui/app/static/js/pages/logs.js b/src/ui/app/static/js/pages/logs.js index 5448269b4..9d7351f3f 100644 --- a/src/ui/app/static/js/pages/logs.js +++ b/src/ui/app/static/js/pages/logs.js @@ -2,7 +2,17 @@ $(document).ready(function () { const editorElement = $("#raw-logs"); const initialContent = editorElement.text().trim(); const editor = ace.edit(editorElement[0]); - editor.setTheme("ace/theme/cloud9_day"); // cloud9_night when dark mode is supported + var theme = $("#theme").val(); + + function setEditorTheme() { + if (theme === "dark") { + editor.setTheme("ace/theme/cloud9_night"); + } else { + editor.setTheme("ace/theme/cloud9_day"); + } + } + + setEditorTheme(); editor.session.setMode("ace/mode/text"); editor.setReadOnly(true); @@ -43,4 +53,11 @@ $(document).ready(function () { $this.tooltip("hide").attr("data-bs-original-title", ""); }, 2000); }); + + $("#dark-mode-toggle").on("change", function () { + setTimeout(() => { + theme = $("#theme").val(); + setEditorTheme(); + }, 30); + }); }); diff --git a/src/ui/app/static/js/pages/plugins.js b/src/ui/app/static/js/pages/plugins.js index 99c6c3cc8..2006dc56e 100644 --- a/src/ui/app/static/js/pages/plugins.js +++ b/src/ui/app/static/js/pages/plugins.js @@ -497,7 +497,13 @@ $(document).ready(function () { plugins_table.on("select", function (e, dt, type, indexes) { // Enable the actions button - $(".action-button").removeClass("disabled").parent().tooltip("dispose"); + $(".action-button") + .removeClass("disabled") + .parent() + .attr("data-bs-toggle", null) + .attr("data-bs-original-title", null) + .attr("data-bs-placement", null) + .tooltip("dispose"); }); plugins_table.on("deselect", function (e, dt, type, indexes) { @@ -506,6 +512,7 @@ $(document).ready(function () { $(".action-button") .addClass("disabled") .parent() + .attr("data-bs-toggle", "tooltip") .attr( "data-bs-original-title", "Please select one or more rows to perform an action.", diff --git a/src/ui/app/static/js/pages/services.js b/src/ui/app/static/js/pages/services.js index 8db44b9ac..0a3a2ec0b 100644 --- a/src/ui/app/static/js/pages/services.js +++ b/src/ui/app/static/js/pages/services.js @@ -186,6 +186,10 @@ $(function () { extend: "convert_services", text: 'Convert to draft', }, + { + extend: "export_services", + text: 'Export', + }, { extend: "delete_services", className: "text-danger", @@ -289,6 +293,25 @@ $(function () { }, }; + $.fn.dataTable.ext.buttons.export_services = { + action: function () { + if (actionLock) return; + actionLock = true; + $(".dt-button-background").click(); + + const services = getSelectedServices(); + if (services.length === 0) { + actionLock = false; + return; + } + + const baseUrl = window.location.href; + const exportUrl = `${baseUrl}/export?services=${services.join(",")}`; + window.open(exportUrl, "_blank"); + actionLock = false; + }, + }; + $.fn.dataTable.ext.buttons.delete_services = { text: 'Delete', action: function () { @@ -486,7 +509,13 @@ $(function () { services_table.on("select", function (e, dt, type, indexes) { // Enable the actions button - $(".action-button").removeClass("disabled").parent().tooltip("dispose"); + $(".action-button") + .removeClass("disabled") + .parent() + .attr("data-bs-toggle", null) + .attr("data-bs-original-title", null) + .attr("data-bs-placement", null) + .tooltip("dispose"); }); services_table.on("deselect", function (e, dt, type, indexes) { @@ -495,6 +524,7 @@ $(function () { $(".action-button") .addClass("disabled") .parent() + .attr("data-bs-toggle", "tooltip") .attr( "data-bs-original-title", "Please select one or more rows to perform an action.", diff --git a/src/ui/app/templates/services.html b/src/ui/app/templates/services.html index e42cb51b9..11e92e8e3 100644 --- a/src/ui/app/templates/services.html +++ b/src/ui/app/templates/services.html @@ -65,7 +65,7 @@ {{ service['creation_date'].astimezone().isoformat() }} {{ service['last_update'].astimezone().isoformat() }} -
+
+ + +