Commit 659f70bdfb74700845952761d122a514e00284f0

Authored by Adhidarma Hadiwinoto
1 parent 882408a124
Exists in master

pause, resume, and terminate

Showing 1 changed file with 21 additions and 0 deletions Side-by-side Diff

... ... @@ -74,6 +74,23 @@ function renderConfigAdd(req, res){
74 74 });
75 75 }
76 76  
  77 +function submitPause(req, res) {
  78 + matrix.pause = 1;
  79 + res.redirect('/');
  80 + return;
  81 +}
  82 +
  83 +function submitResume(req, res) {
  84 + matrix.pause = 0;
  85 + res.redirect('/');
  86 + return;
  87 +}
  88 +
  89 +function submitTerminate(req, res) {
  90 + res.end('Terminating....');
  91 + process.exit();
  92 +}
  93 +
77 94 function submitConfigEdit(req, res) {
78 95  
79 96 if (req.scope == 'expresso' && req.keyword == 'password') {
... ... @@ -280,6 +297,10 @@ function createServer() {
280 297 app.post('/config/add/:scope', loggedIn, submitConfigAdd);
281 298  
282 299 app.get('/config/save', loggedIn, submitConfigSave);
  300 +
  301 + app.get('/pause', loggedIn, submitPause);
  302 + app.get('/resume', loggedIn, submitResume);
  303 + app.get('/terminate', loggedIn, submitTerminate);
283 304  
284 305 app.get('/dashboard', loggedIn, renderDashboardIndex);
285 306