If running a custom run state, show the state instead of Running. Also select the running state in the state change popup. (#2604)
This commit is contained in:
parent
eb005e8b9c
commit
96f578f1bd
|
@ -233,7 +233,12 @@ function getNavBarHTML($reload = null) {
|
|||
ob_start();
|
||||
if ( $running == null )
|
||||
$running = daemonCheck();
|
||||
$status = $running?translate('Running'):translate('Stopped');
|
||||
if ( $running ) {
|
||||
$state = dbFetchOne('SELECT Name FROM States WHERE isActive=1', 'Name');
|
||||
if ( $state == 'default' )
|
||||
$state = '';
|
||||
}
|
||||
$status = $running ? ($state ? $state : translate('Running')) : translate('Stopped');
|
||||
?>
|
||||
<div class="navbar navbar-inverse navbar-static-top">
|
||||
<div class="container-fluid">
|
||||
|
@ -244,7 +249,9 @@ function getNavBarHTML($reload = null) {
|
|||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<div class="navbar-brand"><a href="<?php echo validHtmlStr(ZM_HOME_URL); ?>" target="<?php echo validHtmlStr(ZM_WEB_TITLE); ?>"><?php echo ZM_HOME_CONTENT ?></a></div>
|
||||
<div class="navbar-brand">
|
||||
<a href="<?php echo validHtmlStr(ZM_HOME_URL); ?>" target="<?php echo validHtmlStr(ZM_WEB_TITLE); ?>"><?php echo ZM_HOME_CONTENT ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="main-header-nav">
|
||||
|
@ -326,7 +333,7 @@ if (isset($_REQUEST['filter']['Query']['terms']['attr'])) {
|
|||
<button type="button" class="btn btn-default navbar-btn" data-toggle="modal" data-target="#modalState"><?php echo $status ?></button>
|
||||
|
||||
<?php } else if ( canView('System') ) { ?>
|
||||
<p class="navbar-text"> <?php echo $status ?></p>
|
||||
<p class="navbar-text"><?php echo $status ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } # end if !$user or $user['Id'] meaning logged in ?>
|
||||
|
|
|
@ -54,7 +54,9 @@ if ( $running ) {
|
|||
$states = dbFetchAll('SELECT * FROM States');
|
||||
foreach ( $states as $state ) {
|
||||
?>
|
||||
<option value="<?php echo validHtmlStr($state['Name']) ?>"><?php echo validHtmlStr($state['Name']); ?></option>
|
||||
<option value="<?php echo validHtmlStr($state['Name']) ?>" <?php echo $state['IsActive'] ? 'selected="selected"' : '' ?>>
|
||||
<?php echo validHtmlStr($state['Name']); ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue