Merge pull request #3041 from shuichiro-makigaki/add-major-outage-rate-setting

Add rate setting for major outage
This commit is contained in:
James Brooks 2018-05-14 09:29:06 +01:00 committed by GitHub
commit c18b9e813d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -64,7 +64,8 @@ class System implements SystemContract
$totalComponents = Component::enabled()->authenticated($includePrivate)->count();
$majorOutages = Component::enabled()->authenticated($includePrivate)->status(4)->count();
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;
$majorOutageRate = (int) $this->config->get('setting.major_outage_rate', '50');
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents)*100 >= $majorOutageRate : false;
// Default data
$status = [

View File

@ -154,6 +154,7 @@ return [
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'time_before_refresh' => 'Status page refresh rate (in seconds)',
'major_outage_rate' => 'Major outage threshold (in %)',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide",
'subscribers' => 'Allow people to signup to email notifications?',

View File

@ -57,6 +57,14 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label>{{ trans('forms.settings.app-setup.major_outage_rate') }}</label>
<input type="number" name="major_outage_rate" class="form-control" value="{{ Config::get('setting.major_outage_rate', 50) }}" placeholder="{{ trans('forms.settings.app-setup.major_outage_rate') }}">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="checkbox">