don't try to get live stats for items that haven't been configured
This commit is contained in:
parent
912c6512fb
commit
b2dd3f803e
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -4,9 +4,12 @@
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- guzzlehttp/guzzle as a dependency
|
- guzzlehttp/guzzle as a dependency
|
||||||
|
- Variable polling, so interval is increased when an app is idle and decreased when it's active
|
||||||
|
- Turkish language translation
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Updated composer dependencies
|
- Updated composer dependencies
|
||||||
|
- Added live stats to Nzbget supported application
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -17,6 +20,19 @@
|
||||||
### Added
|
### Added
|
||||||
- Translation support
|
- Translation support
|
||||||
- Initial "Supported" application support
|
- Initial "Supported" application support
|
||||||
|
- Finnish translation
|
||||||
|
- Swedish translation
|
||||||
|
- German translation
|
||||||
|
- French translation
|
||||||
|
- Spanish translation
|
||||||
|
- Duplicati supported application
|
||||||
|
- Emby supported application
|
||||||
|
- Nzbget supported application
|
||||||
|
- Pfsense supported application
|
||||||
|
- Pihole supported application
|
||||||
|
- Plex supported application
|
||||||
|
- Portainer supported application
|
||||||
|
- Unifi supported application
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- button layout and behaviour
|
- button layout and behaviour
|
||||||
|
|
|
@ -139,8 +139,7 @@ class ItemController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = $request->input('config');
|
$config = Item::checkConfig($request->input('config'));
|
||||||
$config = (!empty($config)) ? json_encode($config) : null;
|
|
||||||
$request->merge([
|
$request->merge([
|
||||||
'description' => $config
|
'description' => $config
|
||||||
]);
|
]);
|
||||||
|
@ -201,12 +200,10 @@ class ItemController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = $request->input('config');
|
$config = Item::checkConfig($request->input('config'));
|
||||||
$config = (!empty($config)) ? json_encode($config) : null;
|
|
||||||
$request->merge([
|
$request->merge([
|
||||||
'description' => $config
|
'description' => $config
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
Item::find($id)->update($request->all());
|
Item::find($id)->update($request->all());
|
||||||
|
|
||||||
|
|
20
app/Item.php
20
app/Item.php
|
@ -67,4 +67,24 @@ class Item extends Model
|
||||||
}
|
}
|
||||||
return (object)$output;
|
return (object)$output;
|
||||||
}
|
}
|
||||||
|
public static function checkConfig($config)
|
||||||
|
{
|
||||||
|
if(empty($config)) {
|
||||||
|
$config = null;
|
||||||
|
} else {
|
||||||
|
$store = false;
|
||||||
|
foreach($config as $key => $check) {
|
||||||
|
if($key == 'type') continue;
|
||||||
|
if(!empty($check)) {
|
||||||
|
$store = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$config['enabled'] = ($store) ? true : false;
|
||||||
|
$config = json_encode($config);
|
||||||
|
}
|
||||||
|
return $config;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@endif
|
@endif
|
||||||
<div class="details">
|
<div class="details">
|
||||||
<div class="title">{{ $app->title }}</div>
|
<div class="title">{{ $app->title }}</div>
|
||||||
@if(isset($app->description) && !empty($app->description))
|
@if(isset($app->config->enabled) && ((bool)$app->config->enabled === true))
|
||||||
<div data-id="{{ $app->id }}" class="livestats-container"></div>
|
<div data-id="{{ $app->id }}" class="livestats-container"></div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue