mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
plugins and themes now trigger a restart
This commit is contained in:
@@ -8,14 +8,10 @@ var fork = require('child_process').fork,
|
||||
|
||||
nbb.on('message', function(cmd) {
|
||||
if (cmd === 'nodebb:restart') {
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
nbb.on('exit', function() {
|
||||
start();
|
||||
});
|
||||
nbb.kill();
|
||||
} else {
|
||||
console.log('[app] Development Mode is on, restart aborted.');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,14 +15,6 @@ define(function() {
|
||||
pluginTgl = $('.plugins li[data-plugin-id="' + status.id + '"] button');
|
||||
pluginTgl.html('<i class="fa fa-power-off"></i> ' + (status.active ? 'Dea' : 'A') + 'ctivate');
|
||||
pluginTgl.toggleClass('btn-warning', status.active).toggleClass('btn-success', !status.active);
|
||||
|
||||
app.alert({
|
||||
alert_id: 'plugin_toggled_' + status.id,
|
||||
title: 'Plugin ' + (status.active ? 'Enabled' : 'Disabled'),
|
||||
message: 'You may need to restart NodeBB in order for these changes to be reflected.',
|
||||
type: 'warning',
|
||||
timeout: 5000
|
||||
})
|
||||
});
|
||||
} else {
|
||||
pluginsList.append('<li><p><i>No plugins found.</i></p></li>');
|
||||
|
||||
@@ -21,14 +21,6 @@ define(['forum/admin/settings'], function(Settings) {
|
||||
type: themeType,
|
||||
id: themeId,
|
||||
src: cssSrc
|
||||
}, function(err) {
|
||||
app.alert({
|
||||
alert_id: 'admin:theme',
|
||||
type: 'success',
|
||||
title: 'Theme Changed',
|
||||
message: 'You have successfully changed your NodeBB\'s theme. Please restart to see the changes.',
|
||||
timeout: 2500
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -274,12 +274,16 @@ SocketAdmin.themes.set = function(socket, data, callback) {
|
||||
if(!data) {
|
||||
return callback(new Error('invalid data'));
|
||||
}
|
||||
meta.themes.set(data, callback);
|
||||
meta.themes.set(data, function() {
|
||||
callback();
|
||||
meta.restart()
|
||||
});
|
||||
};
|
||||
|
||||
SocketAdmin.plugins.toggle = function(socket, plugin_id) {
|
||||
plugins.toggleActive(plugin_id, function(status) {
|
||||
socket.emit('admin.plugins.toggle', status);
|
||||
meta.restart();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user