protected-resources-list/plugins/named/plugin.js

21 lines
537 B
JavaScript

import {App} from "/assets/App.js";
(async function () {
$("#buttons").append(`<button id="restart-bind">Restart named</button>`);
$("#restart-bind").click(function () {
const self = $(this);
self.prop("disabled", true);
(async function () {
try {
alert(await App.RPC.__invoke("named::restart"));
} finally {
setTimeout(() => {
self.prop("disabled", false);
}, 5000);
}
})();
});
})();