Browse Source

supported apps stuff

pull/74/head
KodeStar 7 years ago
parent
commit
3a3446151e
  1. 15
      app/Item.php
  2. 4
      public/mix-manifest.json
  3. 10
      resources/views/items/form.blade.php
  4. 1
      resources/views/supportedapps/nzbget.blade.php

15
app/Item.php

@ -45,4 +45,19 @@ class Item extends Model
{
return $query->where('pinned', 1);
}
public function getConfigAttribute()
{
$output = null;
if(isset($this->description) && !empty($this->description)){
$output = json_decode($this->description);
if(isset($output->type) && !empty($output->type)) {
$class = $output->type;
$sap = new $class();
$view = $sap->configDetails();
}
$output->view = $view;
}
return (object)$output;
}
}

4
public/mix-manifest.json

@ -1,4 +1,4 @@
{
"/css/app.css": "/css/app.css?id=c4fd68c39261024e61ed",
"/js/app.js": "/js/app.js?id=906019381e165da0f941"
"/css/app.css": "/css/app.css?id=8c034347751a0b8faeb2",
"/js/app.js": "/js/app.js?id=559585a774e3f088503a"
}

10
resources/views/items/form.blade.php

@ -52,9 +52,15 @@
</div>
</div>
@if(isset($item) && $item->config)
<div id="sapconfig" style="display: block;">
@if(isset($item))
@include('supportedapps.'.$item->config->view)
@endif
</div>
@else
<div id="sapconfig"></div>
@endif
</div>
<footer>

1
resources/views/supportedapps/nzbget.blade.php

@ -1,5 +1,6 @@
<h2>Config (optional)</h2>
<div class="items">
<input type="hidden" name="config[type]" value="\App\SupportedApps\Nzbget" />
<div class="input">
<label>Username</label>
{!! Form::text('config[username]', null, array('placeholder' => 'Username', 'class' => 'form-control')) !!}

Loading…
Cancel
Save