added auto-refresh on master status page

This commit is contained in:
jvictor 2017-08-31 16:09:27 +02:00
parent 197493b9d7
commit 6330f8a2fb
8 changed files with 33 additions and 0 deletions

View File

@ -81,6 +81,7 @@ class AppComposer
$view->withAutomaticLocalization($this->config->get('setting.automatic_localization'));
$view->withEnableExternalDependencies($this->config->get('setting.enable_external_dependencies'));
$view->withShowTimezone($this->config->get('setting.show_timezone'));
$view->withAppRefreshRate($this->config->get('setting.app_refresh_rate'));
$view->withTimezone($this->dates->getTimezone());
$view->withSiteTitle($this->config->get('setting.app_name'));
$view->withFontSubset($this->config->get('langs.'.$this->config->get('app.locale').'.subset', 'latin'));

View File

@ -393,6 +393,9 @@ EINCIDENT;
], [
'key' => 'app_incident_days',
'value' => '7',
], [
'key' => 'app_refresh_rate',
'value' => '0',
], [
'key' => 'app_analytics',
'value' => 'UA-58442674-3',

View File

@ -106,6 +106,13 @@ $factory->define(Setting::class, function ($faker) {
];
});
$factory->define(Setting::class, function ($faker) {
return [
'name' => 'app_refresh_rate',
'value' => '0',
];
});
$factory->define(Subscriber::class, function ($faker) {
return [
'email' => $faker->safeEmail,

View File

@ -151,6 +151,7 @@ return [
'display-graphs' => 'Display graphs on status page?',
'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).',
'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

@ -151,6 +151,7 @@ return [
'display-graphs' => 'Display graphs on status page?',
'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).',
'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

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

View File

@ -63,6 +63,17 @@
<script type="text/javascript">
var Global = {};
var refreshRate = parseInt("{{ $app_refresh_rate }}");
function refresh() {
window.location.reload(true);
}
if(refreshRate > 0) {
setTimeout(refresh, refreshRate * 1000);
}
Global.locale = '{{ $app_locale }}';
</script>
<script src="{{ mix('dist/js/all.js') }}"></script>

View File

@ -212,6 +212,7 @@
<hr >
<div class="form-group text-center">
<input type="hidden" name="settings[app_incident_days]" value="7" >
<input type="hidden" name="settings[app_refresh_rate]" value="0" >
<span class="wizard-next btn btn-info" data-current-block="3" data-next-block="2">
{{ trans('pagination.previous') }}
</span>