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() {
|
||||
$('.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) {
|
||||
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 () {
|
||||
bootbox.confirm('[[admin/admin:alert.confirm-rebuild-and-restart]]', function (confirm) {
|
||||
if (confirm) {
|
||||
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) {
|
||||
$('.restart').off('click').on('click', function () {
|
||||
bootbox.confirm('[[admin/admin:alert.confirm-restart]]', function (confirm) {
|
||||
if (confirm) {
|
||||
instance.restart();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user