mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	Fixes #6261
If a connection to the parent process is not detected, disable the restart and reload buttons (as they won't work anyway).
This commit is contained in:
		| @@ -36,9 +36,10 @@ | |||||||
| 	"search-plugin-tooltip": "Install a search plugin from the plugin page in order to activate search functionality", | 	"search-plugin-tooltip": "Install a search plugin from the plugin page in order to activate search functionality", | ||||||
|  |  | ||||||
| 	"control-panel": "System Control", | 	"control-panel": "System Control", | ||||||
| 	"reload": "Reload", | 	"reload": "Restart", | ||||||
| 	"restart": "Restart", | 	"restart": "Rebuild & Restart", | ||||||
| 	"restart-warning": "Reloading or Restarting your NodeBB will drop all existing connections for a few seconds.", | 	"restart-warning": "Rebuilding or Restarting your NodeBB will drop all existing connections for a few seconds.", | ||||||
|  | 	"restart-disabled": "Rebuilding and Restarting your NodeBB has been disabled as you do not seem to be running it via the appropriate daemon.", | ||||||
| 	"maintenance-mode": "Maintenance Mode", | 	"maintenance-mode": "Maintenance Mode", | ||||||
| 	"maintenance-mode-title": "Click here to set up maintenance mode for NodeBB", | 	"maintenance-mode-title": "Click here to set up maintenance mode for NodeBB", | ||||||
| 	"realtime-chart-updates": "Realtime Chart Updates", | 	"realtime-chart-updates": "Realtime Chart Updates", | ||||||
|   | |||||||
| @@ -48,6 +48,7 @@ dashboardController.get = function (req, res, next) { | |||||||
| 				version: nconf.get('version'), | 				version: nconf.get('version'), | ||||||
| 				notices: results.notices, | 				notices: results.notices, | ||||||
| 				stats: results.stats, | 				stats: results.stats, | ||||||
|  | 				canRestart: !!process.send, | ||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
| 	], next); | 	], next); | ||||||
|   | |||||||
| @@ -101,13 +101,15 @@ | |||||||
| 			<div class="panel-heading">[[admin/general/dashboard:control-panel]]</div> | 			<div class="panel-heading">[[admin/general/dashboard:control-panel]]</div> | ||||||
| 			<div class="panel-body text-center"> | 			<div class="panel-body text-center"> | ||||||
| 				<p> | 				<p> | ||||||
| 					<div class="btn-group"> | 					<button class="btn btn-block btn-warning reload"<!-- IF !canRestart --> disabled<!-- END -->>[[admin/general/dashboard:reload]]</button> | ||||||
| 						<button class="btn btn-warning reload">[[admin/general/dashboard:reload]]</button> | 					<button class="btn btn-block btn-danger restart"<!-- IF !canRestart --> disabled<!-- END -->>[[admin/general/dashboard:restart]]</button> | ||||||
| 						<button class="btn btn-danger restart">[[admin/general/dashboard:restart]]</button> |  | ||||||
| 					</div> |  | ||||||
| 				</p> | 				</p> | ||||||
| 				<p class="help-block"> | 				<p class="<!-- IF canRestart -->help-block<!-- ELSE -->alert alert-warning<!-- END -->"> | ||||||
|  | 					<!-- IF canRestart --> | ||||||
| 					[[admin/general/dashboard:restart-warning]] | 					[[admin/general/dashboard:restart-warning]] | ||||||
|  | 					<!-- ELSE --> | ||||||
|  | 					[[admin/general/dashboard:restart-disabled]] | ||||||
|  | 					<!-- END --> | ||||||
| 				</p> | 				</p> | ||||||
| 				<p> | 				<p> | ||||||
| 					<a href="{config.relative_path}/admin/settings/advanced" class="btn btn-info btn-block" data-placement="bottom" data-toggle="tooltip" title="[[admin/general/dashboard:maintenance-mode-title]]">[[admin/general/dashboard:maintenance-mode]]</a> | 					<a href="{config.relative_path}/admin/settings/advanced" class="btn btn-info btn-block" data-placement="bottom" data-toggle="tooltip" title="[[admin/general/dashboard:maintenance-mode-title]]">[[admin/general/dashboard:maintenance-mode]]</a> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user