Merge pull request #2629 from Thijmen/instance-name
Ability to give a name to an instance
This commit is contained in:
commit
4c652b5818
@ -29,6 +29,7 @@ class Configuration extends Component
|
||||
'settings.public_port_min' => 'required',
|
||||
'settings.public_port_max' => 'required',
|
||||
'settings.custom_dns_servers' => 'nullable',
|
||||
'settings.instance_name' => 'nullable',
|
||||
];
|
||||
|
||||
protected $validationAttributes = [
|
||||
|
@ -47,4 +47,14 @@ public function getRecepients($notification)
|
||||
|
||||
return explode(',', $recipients);
|
||||
}
|
||||
|
||||
public function getTitleDisplayName(): string
|
||||
{
|
||||
$instanceName = $this->instance_name;
|
||||
if (! $instanceName) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return "[{$instanceName}]";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('instance_settings', function (Blueprint $table) {
|
||||
$table->string('instance_name')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('instance_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('instance_name');
|
||||
});
|
||||
}
|
||||
};
|
@ -15,7 +15,21 @@
|
||||
<link rel="preload" href="https://cdn.fonts.coollabs.io/inter/normal/800.woff2" as="style" />
|
||||
<link href="https://api.fonts.coollabs.io/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<meta name="robots" content="noindex">
|
||||
<title>{{ $title ?? 'Coolify' }}</title>
|
||||
@use('App\Models\InstanceSettings')
|
||||
@php
|
||||
|
||||
$instanceSettings = InstanceSettings::first();
|
||||
$name = null;
|
||||
|
||||
if($instanceSettings) {
|
||||
$displayName = $instanceSettings->getTitleDisplayName();
|
||||
|
||||
if(strlen($displayName) > 0) {
|
||||
$name = $displayName . ' ';
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<title>{{ $name }}{{ $title ?? 'Coolify' }}</title>
|
||||
@env('local')
|
||||
<link rel="icon" href="{{ asset('favicon-dev.png') }}" type="image/x-icon" />
|
||||
@else
|
||||
|
@ -11,6 +11,7 @@
|
||||
<div class="flex flex-col gap-2 pt-4">
|
||||
<div class="flex flex-wrap items-end gap-2">
|
||||
<x-forms.input id="settings.fqdn" label="Instance's Domain" placeholder="https://coolify.io" />
|
||||
<x-forms.input id="settings.instance_name" label="Instance's Name" placeholder="Coolify" />
|
||||
<x-forms.input id="settings.custom_dns_servers" label="DNS Servers"
|
||||
helper="DNS servers for validation FQDNs againts. A comma separated list of DNS servers."
|
||||
placeholder="1.1.1.1,8.8.8.8" />
|
||||
|
Loading…
Reference in New Issue
Block a user