From 3ca450fefcf9c202ab85b08335f2ce476f7825fb Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Fri, 2 Nov 2012 15:10:01 +0000 Subject: [PATCH] make the server save settings --- src/node/hooks/express/adminsettings.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/node/hooks/express/adminsettings.js b/src/node/hooks/express/adminsettings.js index 4290a27f6..2a6b590d9 100644 --- a/src/node/hooks/express/adminsettings.js +++ b/src/node/hooks/express/adminsettings.js @@ -23,7 +23,6 @@ exports.socketio = function (hook_name, args, cb) { if (!socket.handshake.session.user || !socket.handshake.session.user.is_admin) return; socket.on("load", function (query) { -// socket.emit("installed-results", {results: plugins.plugins}); fs.readFile('settings.json', 'utf8', function (err,data) { if (err) { return console.log(err); @@ -35,16 +34,14 @@ exports.socketio = function (hook_name, args, cb) { }); }); -/* - socket.on("search", function (query) { - socket.emit("progress", {progress:0, message:'Fetching results...'}); - installer.search(query, true, function (progress) { - if (progress.results) - socket.emit("search-result", progress); - socket.emit("progress", progress); + socket.on("saveSettings", function (settings) { + fs.writeFile('settings.json', settings, function (err) { + if (err) throw err; + socket.emit("saveprogress", "saved"); }); }); +/* socket.on("install", function (plugin_name) { socket.emit("progress", {progress:0, message:'Downloading and installing ' + plugin_name + "..."}); installer.install(plugin_name, function (progress) {