fix: alert template error. closes #10620

isekai-main
Barış Soner Uşaklı 3 years ago
parent 3a009f96cd
commit 24a640d93e

@ -157,29 +157,28 @@ require('../../scripts-admin');
}
function setupRestartLinks() {
require(['benchpress', 'bootbox', 'admin/modules/instance'], function (benchpress, bootbox, instance) {
// need to preload the compiled alert template
// otherwise it can be unloaded when rebuild & restart is run
// the client can't fetch the template file, resulting in an error
benchpress.render('alert', {}).then(function () {
$('.rebuild-and-restart').off('click').on('click', function () {
require(['bootbox'], function (bootbox) {
bootbox.confirm('[[admin/admin:alert.confirm-rebuild-and-restart]]', function (confirm) {
if (confirm) {
require(['admin/modules/instance'], function (instance) {
instance.rebuildAndRestart();
});
}
});
});
});
$('.restart').off('click').on('click', function () {
require(['bootbox'], function (bootbox) {
bootbox.confirm('[[admin/admin:alert.confirm-restart]]', function (confirm) {
if (confirm) {
require(['admin/modules/instance'], function (instance) {
instance.restart();
});
}
});
});
});
});
}
function configureSlidemenu() {

@ -2,10 +2,6 @@
define('admin/modules/instance', [
'alerts',
// need to preload the compiled alert template
// otherwise it can be unloaded when rebuild & restart is run
// the client can't fetch the template file, resulting in an error
config.relative_path + '/assets/templates/alert.js',
], function (alerts) {
const instance = {};

Loading…
Cancel
Save