mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-04 22:13:54 +09:00
fixes #109
This commit is contained in:
20
app/Item.php
20
app/Item.php
@@ -7,6 +7,7 @@ use Symfony\Component\ClassLoader\ClassMapGenerator;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
use App\Application;
|
||||||
|
|
||||||
class Item extends Model
|
class Item extends Model
|
||||||
{
|
{
|
||||||
@@ -200,7 +201,26 @@ class Item extends Model
|
|||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function applicationDetails($class)
|
||||||
|
{
|
||||||
|
if(!empty($class)) {
|
||||||
|
$name = self::nameFromClass($class);
|
||||||
|
$application = Application::where('name', $name)->first();
|
||||||
|
if($application) return $application;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getApplicationDescription($class)
|
||||||
|
{
|
||||||
|
$details = self::applicationDetails($class);
|
||||||
|
if($details !== false) {
|
||||||
|
return $details->description.' - '.$details->license;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the user that owns the item.
|
* Get the user that owns the item.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div data-id="{{ $app->id }}" data-dataonly="{{ $app->getconfig()->dataonly ?? '0' }}" class="livestats-container{{ title_color($app->colour) }}"></div>
|
<div data-id="{{ $app->id }}" data-dataonly="{{ $app->getconfig()->dataonly ?? '0' }}" class="livestats-container{{ title_color($app->colour) }}"></div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<a class="link{{ title_color($app->colour) }}"{!! $app->link_target !!} href="{{ $app->link }}"><i class="fas {{ $app->link_icon }}"></i></a>
|
<a title="{{ App\Item::getApplicationDescription($app->class) }}" class="link{{ title_color($app->colour) }}"{!! $app->link_target !!} href="{{ $app->link }}"><i class="fas {{ $app->link_icon }}"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<a class="item-edit" href="{{ route($app->link_type.'.edit', [ $app->id ], false) }}"><i class="fas fa-pencil"></i></a>
|
<a class="item-edit" href="{{ route($app->link_type.'.edit', [ $app->id ], false) }}"><i class="fas fa-pencil"></i></a>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user