[Libreoffice-commits] online.git: loleaflet/dist loleaflet/src

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Nov 14 05:35:35 UTC 2016


 loleaflet/dist/admin/adminSettings.html    |    2 ++
 loleaflet/src/admin/AdminSocketSettings.js |   10 ++++++++++
 2 files changed, 12 insertions(+)

New commits:
commit da5ef9b5a29d6373cf4eb0767fae3e3a33698f5d
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Nov 13 23:55:47 2016 -0500

    loleaflet: add shutdown command to the admin settings
    
    When we add more server controls (restart, f.e.)
    we will need to move this to a separate page.
    
    Also, we need to prompt the admin for reason,
    which we can broadcast to all users when the server
    goes down.
    
    Change-Id: Ide92e58b5b64a5107b6556aef6b1a88191d5d21b
    Reviewed-on: https://gerrit.libreoffice.org/30832
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/dist/admin/adminSettings.html b/loleaflet/dist/admin/adminSettings.html
index 94ba5b2..d860de2 100644
--- a/loleaflet/dist/admin/adminSettings.html
+++ b/loleaflet/dist/admin/adminSettings.html
@@ -73,6 +73,8 @@
 	    <input type="text" id="cpu_stats_interval" name="Cpu Stats Interval"><br/>
 	    <script>document.write('<input type="submit" value="' + l10nstrings.strSave + '"/><br/>')</script>
 	  </form>
+	  <br />
+	  <input id="btnShutdown" type="submit" value="Shutdown"/>
 	</div>
       </div>
       </div>
diff --git a/loleaflet/src/admin/AdminSocketSettings.js b/loleaflet/src/admin/AdminSocketSettings.js
index 926df06..5f4ba6f 100644
--- a/loleaflet/src/admin/AdminSocketSettings.js
+++ b/loleaflet/src/admin/AdminSocketSettings.js
@@ -25,6 +25,16 @@ var AdminSocketSettings = AdminSocketBase.extend({
 				command += ' cpu_stats_interval=' + cpuStatsInterval;
 				socketSettings.send(command);
 			});
+
+			$('#btnShutdown').click(function() {
+				vex.dialog.confirm({
+					message: _('Are you sure you want to shutdown the server?'),
+					callback: function(value) {
+						// TODO: Prompt for reason.
+						socketSettings.send('shutdown maintenance');
+					}
+				});
+			});
 		});
 	},
 


More information about the Libreoffice-commits mailing list