SEO & Update Notification
Development
This commit is contained in:
commit
c817b5d72d
|
@ -59,6 +59,8 @@ class System
|
||||||
'motd-enabled' => 'string',
|
'motd-enabled' => 'string',
|
||||||
'usefullinks-enabled' => 'string',
|
'usefullinks-enabled' => 'string',
|
||||||
'motd-message' => 'string|nullable',
|
'motd-message' => 'string|nullable',
|
||||||
|
'seo-title' => 'string|nullable',
|
||||||
|
'seo-description' => 'string|nullable',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$validator->after(function ($validator) use ($request) {
|
$validator->after(function ($validator) use ($request) {
|
||||||
|
@ -111,6 +113,8 @@ class System
|
||||||
"SETTINGS::SYSTEM:MOTD_ENABLED" => "motd-enabled",
|
"SETTINGS::SYSTEM:MOTD_ENABLED" => "motd-enabled",
|
||||||
"SETTINGS::SYSTEM:MOTD_MESSAGE" => "motd-message",
|
"SETTINGS::SYSTEM:MOTD_MESSAGE" => "motd-message",
|
||||||
"SETTINGS::SYSTEM:USEFULLINKS_ENABLED" => "usefullinks-enabled",
|
"SETTINGS::SYSTEM:USEFULLINKS_ENABLED" => "usefullinks-enabled",
|
||||||
|
"SETTINGS::SYSTEM:SEO_TITLE" => "seo-title",
|
||||||
|
"SETTINGS::SYSTEM:SEO_DESCRIPTION" => "seo-description",
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
|
|
43
app/Console/Commands/GetGithubVersion.php
Normal file
43
app/Console/Commands/GetGithubVersion.php
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class GetGithubVersion extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'cp:versioncheck:get';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Get the latest Version from Github';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
$latestVersion = Http::get('https://api.github.com/repos/controlpanel-gg/dashboard/tags')->json()[0]['name'];
|
||||||
|
Storage::disk('local')->put('latestVersion', $latestVersion);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Storage::disk('local')->put('latestVersion', "unknown");
|
||||||
|
Log::error($e);
|
||||||
|
}
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,7 @@ class Kernel extends ConsoleKernel
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
$schedule->command('credits:charge')->hourly();
|
$schedule->command('credits:charge')->hourly();
|
||||||
|
$schedule->command('cp:versioncheck:get')->daily();
|
||||||
|
|
||||||
//log cronjob activity
|
//log cronjob activity
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
|
|
|
@ -630,5 +630,20 @@ class SettingsSeeder extends Seeder
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'description' => 'MOTD Message',
|
'description' => 'MOTD Message',
|
||||||
]);
|
]);
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:SEO_TITLE',
|
||||||
|
], [
|
||||||
|
'value' => 'Controlpanel.gg',
|
||||||
|
'type' => 'text',
|
||||||
|
'description' => 'The SEO Title',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:SEO_DESCRIPTION',
|
||||||
|
], [
|
||||||
|
'value' => 'Billing software for Pterodactyl Dashboard!',
|
||||||
|
'type' => 'text',
|
||||||
|
'description' => 'SEO Description',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h1>{{__('Admin Overview')}}</h1>
|
<h1>{{__('Admin Overview')}}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<ol class="breadcrumb float-sm-right">
|
<ol class="breadcrumb float-sm-right">
|
||||||
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
|
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
|
||||||
|
@ -17,6 +18,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if(Storage::get('latestVersion') && config("app.version") < Storage::get('latestVersion'))
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<b><i class="fas fa-shield-alt"></i> {{__("Version Outdated:")}}</b></br>
|
||||||
|
{{__("You are running on")}} v{{config("app.version")}}-{{config("BRANCHNAME")}}.
|
||||||
|
{{__("The latest Version is")}} v{{Storage::get('latestVersion')}}</br>
|
||||||
|
<a href="https://controlpanel.gg/docs/Installation/updating">{{__("Consider updating now")}}</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
</section>
|
</section>
|
||||||
<!-- END CONTENT HEADER -->
|
<!-- END CONTENT HEADER -->
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,35 @@
|
||||||
class="form-control @error('minimum-credits') is-invalid @enderror" required>
|
class="form-control @error('minimum-credits') is-invalid @enderror" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col text-center">
|
||||||
|
<h1>{{ __('SEO') }}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
|
||||||
|
<label for="seo-title">{{ __('SEO Title') }}</label>
|
||||||
|
<i data-toggle="popover" data-trigger="hover" data-html="true"
|
||||||
|
data-content="{{ __('An SEO title tag must contain your target keyword. This tells both Google and searchers that your web page is relevant to this search query!') }}"
|
||||||
|
class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
<input x-model="seo-title" id="seo-title" name="seo-title"
|
||||||
|
type="text" value="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}"
|
||||||
|
class="form-control @error('seo-title') is-invalid @enderror" required>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
|
||||||
|
<label for="seo-description">{{ __('SEO Description') }}</label>
|
||||||
|
<i data-toggle="popover" data-trigger="hover" data-html="true"
|
||||||
|
data-content="{{ __('The SEO site description represents your homepage. Search engines show this description in search results for your homepage if they dont find content more relevant to a visitors search terms.') }}"
|
||||||
|
class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
<input x-model="seo-description" id="seo-description" name="seo-description"
|
||||||
|
type="text" value="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}"
|
||||||
|
class="form-control @error('seo-description') is-invalid @enderror" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -454,7 +482,7 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script>tinymce.init({selector:'textarea',skin: "oxide-dark",
|
<script>tinymce.init({selector:'textarea',skin: "oxide-dark",
|
||||||
content_css: "dark",branding: false, height: 200,
|
content_css: "dark",branding: false, height: 500,
|
||||||
plugins: ['image','link'],});
|
plugins: ['image','link'],});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
|
||||||
|
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
|
||||||
|
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
|
||||||
|
|
||||||
<!-- CSRF Token -->
|
<!-- CSRF Token -->
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!-- CSRF Token -->
|
<!-- CSRF Token -->
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
|
||||||
|
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
|
||||||
|
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
|
||||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||||
<link rel="icon"
|
<link rel="icon"
|
||||||
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}"
|
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}"
|
||||||
|
|
Loading…
Reference in a new issue