diff --git a/CHANGELOG.md b/CHANGELOG.md index cff14ed9..3d4eca03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,12 @@ ### Added - 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 - Updated composer dependencies +- Added live stats to Nzbget supported application ### Fixed @@ -17,6 +20,19 @@ ### Added - Translation 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 - button layout and behaviour diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 1cc2a9a9..6c575b43 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -139,8 +139,7 @@ class ItemController extends Controller ]); } - $config = $request->input('config'); - $config = (!empty($config)) ? json_encode($config) : null; + $config = Item::checkConfig($request->input('config')); $request->merge([ 'description' => $config ]); @@ -201,12 +200,10 @@ class ItemController extends Controller ]); } - $config = $request->input('config'); - $config = (!empty($config)) ? json_encode($config) : null; + $config = Item::checkConfig($request->input('config')); $request->merge([ 'description' => $config ]); - Item::find($id)->update($request->all()); diff --git a/app/Item.php b/app/Item.php index 878937aa..83de752c 100644 --- a/app/Item.php +++ b/app/Item.php @@ -67,4 +67,24 @@ class Item extends Model } 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; + + } } diff --git a/resources/views/item.blade.php b/resources/views/item.blade.php index 4fe48669..3e6bf5ca 100644 --- a/resources/views/item.blade.php +++ b/resources/views/item.blade.php @@ -7,7 +7,7 @@ @endif
{{ $app->title }}
- @if(isset($app->description) && !empty($app->description)) + @if(isset($app->config->enabled) && ((bool)$app->config->enabled === true))
@endif