Added pinhole to enhanced list

This commit is contained in:
KodeStar
2018-02-08 23:45:37 +00:00
parent bbd85d2516
commit 7229d32e8b
7 changed files with 88 additions and 4 deletions

View File

@@ -11,6 +11,8 @@ $.when( $.ready ).then(function() {
if($('.livestats-container').length) {
$('.livestats-container').each(function(index){
var id = $(this).data('id');
var dataonly = $(this).data('dataonly');
var increaseby = (dataonly == 1) ? 20000 : 1000;
var container = $(this);
var max_timer = 30000;
var timer = 5000;
@@ -19,7 +21,7 @@ $.when( $.ready ).then(function() {
url: '/get_stats/'+id,
success: function(data) {
container.html(data);
if(data != '') timer = 1000;
if(data != '') timer = increaseby;
else {
if(timer < max_timer) timer += 2000;
}

View File

@@ -60,6 +60,7 @@ return [
'apps.password' => 'Password',
'apps.config' => 'Config',
'apps.apikey' => 'Api Key',
'apps.enable' => 'Enable',
'url' => 'Url',
'title' => 'Title',

View File

@@ -8,7 +8,7 @@
<div class="details">
<div class="title">{{ $app->title }}</div>
@if(isset($app->config->enabled) && ((bool)$app->config->enabled === true))
<div data-id="{{ $app->id }}" class="livestats-container"></div>
<div data-id="{{ $app->id }}" data-dataonly="{{ $app->config->dataonly or '0' }}" class="livestats-container"></div>
@endif
</div>
<a class="link" href="{{ $app->url }}"><i class="fas fa-arrow-alt-to-right"></i></a>

View File

@@ -0,0 +1,19 @@
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }})</h2>
<div class="items">
<input type="hidden" data-config="type" class="config-item" name="config[type]" value="\App\SupportedApps\Pihole" />
<input type="hidden" data-config="dataonly" class="config-item" name="config[dataonly]" value="1" />
<div class="input">
<label>{{ __('app.apps.enable') }}</label>
<label class="switch">
<?php
$checked = false;
if(isset($item->config->enabled) && (bool)$item->config->enabled === true) $checked = true;
$set_checked = ($checked) ? ' checked="checked"' : '';
?>
{!! Form::hidden('config[enabled]', '0') !!}
<input type="checkbox" name="config[enabled]" value="1"<?php echo $set_checked;?> />
<span class="slider round"></span>
</label>
</div>
<button id="test_config">Test</button>
</div>