mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: alert template error. closes #10620
This commit is contained in:
@@ -157,26 +157,25 @@ require('../../scripts-admin');
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupRestartLinks() {
|
function setupRestartLinks() {
|
||||||
$('.rebuild-and-restart').off('click').on('click', function () {
|
require(['benchpress', 'bootbox', 'admin/modules/instance'], function (benchpress, bootbox, instance) {
|
||||||
require(['bootbox'], function (bootbox) {
|
// need to preload the compiled alert template
|
||||||
bootbox.confirm('[[admin/admin:alert.confirm-rebuild-and-restart]]', function (confirm) {
|
// otherwise it can be unloaded when rebuild & restart is run
|
||||||
if (confirm) {
|
// the client can't fetch the template file, resulting in an error
|
||||||
require(['admin/modules/instance'], function (instance) {
|
benchpress.render('alert', {}).then(function () {
|
||||||
|
$('.rebuild-and-restart').off('click').on('click', function () {
|
||||||
|
bootbox.confirm('[[admin/admin:alert.confirm-rebuild-and-restart]]', function (confirm) {
|
||||||
|
if (confirm) {
|
||||||
instance.rebuildAndRestart();
|
instance.rebuildAndRestart();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.restart').off('click').on('click', function () {
|
$('.restart').off('click').on('click', function () {
|
||||||
require(['bootbox'], function (bootbox) {
|
bootbox.confirm('[[admin/admin:alert.confirm-restart]]', function (confirm) {
|
||||||
bootbox.confirm('[[admin/admin:alert.confirm-restart]]', function (confirm) {
|
if (confirm) {
|
||||||
if (confirm) {
|
|
||||||
require(['admin/modules/instance'], function (instance) {
|
|
||||||
instance.restart();
|
instance.restart();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
define('admin/modules/instance', [
|
define('admin/modules/instance', [
|
||||||
'alerts',
|
'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) {
|
], function (alerts) {
|
||||||
const instance = {};
|
const instance = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user