Merge branch 'development' into product_linking
This commit is contained in:
commit
9dda7c429b
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
/vendor
|
/vendor
|
||||||
/storage/credit_deduction_log
|
/storage/credit_deduction_log
|
||||||
|
storage/debugbar
|
||||||
.env
|
.env
|
||||||
.env.testing
|
.env.testing
|
||||||
.env.backup
|
.env.backup
|
||||||
|
|
|
@ -50,7 +50,7 @@ class OverViewController extends Controller
|
||||||
'syncLastUpdate' => $syncLastUpdate
|
'syncLastUpdate' => $syncLastUpdate
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Sync locations,nodes,nests,eggs with the linked pterodactyl panel
|
* @description Sync locations,nodes,nests,eggs with the linked pterodactyl panel
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,11 +4,14 @@ namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
class Configuration extends Model
|
class Configuration extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
|
public const CACHE_TAG = 'configuration';
|
||||||
|
|
||||||
public $primaryKey = 'key';
|
public $primaryKey = 'key';
|
||||||
|
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
|
@ -21,14 +24,25 @@ class Configuration extends Model
|
||||||
'type',
|
'type',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
|
||||||
|
static::updated(function (Configuration $configuration) {
|
||||||
|
Cache::forget(self::CACHE_TAG .':'. $configuration->key);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param $default
|
* @param $default
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public static function getValueByKey(string $key , $default = null)
|
public static function getValueByKey(string $key, $default = null)
|
||||||
{
|
{
|
||||||
$configuration = self::find($key);
|
return Cache::rememberForever(self::CACHE_TAG .':'. $key, function () use ($default, $key) {
|
||||||
return $configuration ? $configuration->value : $default;
|
$configuration = self::find($key);
|
||||||
|
return $configuration ? $configuration->value : $default;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,42 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if(Auth::user()->role == 'admin')
|
@if(Auth::user()->role == 'admin')
|
||||||
<li class="nav-header">Admin</li>
|
|
||||||
|
<li class="nav-header">Administration</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{{route('admin.overview.index')}}"
|
||||||
|
class="nav-link @if(Request::routeIs('admin.overview.*')) active @endif">
|
||||||
|
<i class="nav-icon fa fa-home"></i>
|
||||||
|
<p>Overview</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{{route('admin.configurations.index')}}"
|
||||||
|
class="nav-link @if(Request::routeIs('admin.configurations.*')) active @endif">
|
||||||
|
<i class="nav-icon fas fa-cogs"></i>
|
||||||
|
<p>Configurations</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{{route('admin.settings.index')}}"
|
||||||
|
class="nav-link @if(Request::routeIs('admin.settings.*')) active @endif">
|
||||||
|
<i class="nav-icon fas fa-tools"></i>
|
||||||
|
<p>Settings</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{{route('admin.api.index')}}"
|
||||||
|
class="nav-link @if(Request::routeIs('admin.api.*')) active @endif">
|
||||||
|
<i class="nav-icon fa fa-gamepad"></i>
|
||||||
|
<p>Application API</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-header">Management</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{{route('admin.users.index')}}"
|
<a href="{{route('admin.users.index')}}"
|
||||||
|
@ -247,23 +282,8 @@
|
||||||
{{-- </a>--}}
|
{{-- </a>--}}
|
||||||
{{-- </li>--}}
|
{{-- </li>--}}
|
||||||
|
|
||||||
<li class="nav-header">Dashboard</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-header">Other</li>
|
||||||
<a href="{{route('admin.overview.index')}}"
|
|
||||||
class="nav-link @if(Request::routeIs('admin.overview.*')) active @endif">
|
|
||||||
<i class="nav-icon fa fa-gamepad"></i>
|
|
||||||
<p>Overview</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="{{route('admin.api.index')}}"
|
|
||||||
class="nav-link @if(Request::routeIs('admin.api.*')) active @endif">
|
|
||||||
<i class="nav-icon fa fa-gamepad"></i>
|
|
||||||
<p>Application API</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{{route('admin.usefullinks.index')}}"
|
<a href="{{route('admin.usefullinks.index')}}"
|
||||||
|
@ -273,24 +293,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-header">Settings</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="{{route('admin.configurations.index')}}"
|
|
||||||
class="nav-link @if(Request::routeIs('admin.configurations.*')) active @endif">
|
|
||||||
<i class="nav-icon fas fa-cogs"></i>
|
|
||||||
<p>Configurations</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="{{route('admin.settings.index')}}"
|
|
||||||
class="nav-link @if(Request::routeIs('admin.settings.*')) active @endif">
|
|
||||||
<i class="nav-icon fas fa-tools"></i>
|
|
||||||
<p>Settings</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-header">Logs</li>
|
<li class="nav-header">Logs</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|
|
@ -39,8 +39,10 @@
|
||||||
<div class="alert alert-danger p-2 m-2">
|
<div class="alert alert-danger p-2 m-2">
|
||||||
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Error!')}}</h5>
|
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Error!')}}</h5>
|
||||||
<p class="pl-4">
|
<p class="pl-4">
|
||||||
{{__('Make sure to link your products to nodes and eggs.')}} <br>
|
@if(Auth::user()->role == 'admin')
|
||||||
{{__('There has to be at least 1 valid product for server creation')}}
|
{{__('Make sure to link your products to nodes and eggs.')}} <br>
|
||||||
|
{{__('There has to be at least 1 valid product for server creation')}}
|
||||||
|
@endif
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
@if($productCount === 0 )
|
@if($productCount === 0 )
|
||||||
|
|
Loading…
Reference in a new issue