mirror of https://github.com/MISP/MISP
chg: [update] Improved feedback for update lock type in the UI
parent
496c286f4e
commit
e058c7a302
|
@ -4267,7 +4267,9 @@ class Server extends AppModel
|
|||
'diagnostic' => array(),
|
||||
'expected_db_version' => '?',
|
||||
'error' => '',
|
||||
'remaining_lock_time' => $this->getLockRemainingTime()
|
||||
'update_locked' => $this->isUpdateLocked(),
|
||||
'remaining_lock_time' => $this->getLockRemainingTime(),
|
||||
'update_fail_number_reached' => $this->UpdateFailNumberReached()
|
||||
);
|
||||
if ($data_source == 'Database/Mysql') {
|
||||
$db_actual_schema = $this->getActualDBSchema();
|
||||
|
|
|
@ -122,10 +122,13 @@
|
|||
echo '<br/>';
|
||||
$humanReadableTime = sprintf('%smin %ssec', floor($remainingLockTime / 60), $remainingLockTime % 60);
|
||||
echo sprintf('<span class="label label-%s" title="%s" style="margin-left: 5px;">%s <i class="fas fa-%s"></i></span>',
|
||||
$remainingLockTime > 0 ? 'important' : 'success',
|
||||
$remainingLockTime > 0 ? __('Updates are locked') : __('Updates are not locked'),
|
||||
$remainingLockTime > 0 ? sprintf(__('Update unlocked in %s'), h($humanReadableTime)) : __('Updates are not locked'),
|
||||
$remainingLockTime > 0 ? 'times' : 'check'
|
||||
$updateLocked ? 'important' : 'success',
|
||||
$updateLocked ? __('Updates are locked') : __('Updates are not locked'),
|
||||
$updateLocked ? (
|
||||
$updateFailNumberReached ?
|
||||
__('Update are locked due to to many update fails') : sprintf(__('Update unlocked in %s'), h($humanReadableTime)))
|
||||
: __('Updates are not locked'),
|
||||
$updateLocked ? 'times' : 'check'
|
||||
)
|
||||
?>
|
||||
<script>
|
||||
|
|
|
@ -234,7 +234,9 @@
|
|||
'expectedDbVersion' => $dbSchemaDiagnostics['expected_db_version'],
|
||||
'actualDbVersion' => $dbSchemaDiagnostics['actual_db_version'],
|
||||
'error' => $dbSchemaDiagnostics['error'],
|
||||
'remainingLockTime' => $dbSchemaDiagnostics['remaining_lock_time']
|
||||
'remainingLockTime' => $dbSchemaDiagnostics['remaining_lock_time'],
|
||||
'updateFailNumberReached' => $dbSchemaDiagnostics['update_fail_number_reached'],
|
||||
'updateLocked' => $dbSchemaDiagnostics['update_locked']
|
||||
)); ?>
|
||||
</div>
|
||||
<h3><?= __("Redis info") ?></h3>
|
||||
|
|
|
@ -23,16 +23,21 @@ if (isset($updateProgress['preTestSuccess']) && $updateProgress['preTestSuccess'
|
|||
<div class="servers form">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($updateLocked && $updateFailNumberReached): ?>
|
||||
<?php if ($updateLocked): ?>
|
||||
<div style="width: 55%;margin: 20px auto;max-width: 1000px;" class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<div style="display:flex;flex-direction: row;justify-content: space-between;">
|
||||
<span>
|
||||
<h5 style="margin: 5px 0px; display: inline-block"><?php echo __('Update are locked due to to many update fails'); ?></h5>
|
||||
<i>(<?php echo sprintf(__('unlock in %smin %ssec'), '<span id="unlock_remaining_time_min">-</span>', '<span id="unlock_remaining_time_sec">-</span>'); ?>)</i>
|
||||
<?php if ($updateFailNumberReached): ?>
|
||||
<h5 style="margin: 5px 0px; display: inline-block"><?php echo __('Update are locked due to to many update fails'); ?></h5>
|
||||
<i>(<?php echo sprintf(__('unlock in %smin %ssec'), '<span id="unlock_remaining_time_min">-</span>', '<span id="unlock_remaining_time_sec">-</span>'); ?>)</i>
|
||||
<?php else: ?>
|
||||
<h5 style="margin: 5px 0px; display: inline-block"><?php echo __('Update are locked due to an ongoing update process. Release lock only if you know what you are doing'); ?></h5>
|
||||
<i>(<?php echo sprintf(__('automatically unlock in %smin %ssec'), '<span id="unlock_remaining_time_min">-</span>', '<span id="unlock_remaining_time_sec">-</span>'); ?>)</i>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<span>
|
||||
<?php
|
||||
<?php
|
||||
echo $this->Form->postButton('<i class="fa fa-lock-open"></i> ' . __('Release update lock'), $baseurl . '/servers/releaseUpdateLock', array(
|
||||
'style' => 'margin: 0px 0px;',
|
||||
'class' => 'btn btn-danger',
|
||||
|
|
Loading…
Reference in New Issue