This commit is contained in:
Andras Bacsai 2023-06-22 10:04:39 +02:00
parent d5d671bac1
commit 33cae2c222
19 changed files with 47 additions and 17 deletions

View File

@ -25,6 +25,8 @@ public function submit($data)
'application_id' => $this->application->id,
]);
$this->application->refresh();
$this->emit('success', 'Environment variable added successfully.');
$this->emit('clearAddEnv');
} catch (\Exception $e) {
return general_error_handler(err: $e, that: $this);

View File

@ -28,6 +28,7 @@ public function submit()
{
$this->validate();
$this->env->save();
$this->emit('success', 'Environment variable updated successfully.');
}
public function delete()
{

View File

@ -127,6 +127,7 @@ public function submit()
$this->application->fqdn = $domains->implode(',');
$this->application->save();
$this->emit('success', 'Application settings updated!');
} catch (\Exception $e) {
return general_error_handler(err: $e, that: $this);
}

View File

@ -41,6 +41,7 @@ public function submit()
$this->validate();
$this->application->preview_url_template = str_replace(' ', '', $this->application->preview_url_template);
$this->application->save();
$this->emit('success', 'Preview url template updated successfully.');
$this->generate_real_url();
}
}

View File

@ -52,6 +52,7 @@ public function submit()
}
$this->validate();
$this->application->save();
$this->emit('success', 'Resource limits updated successfully.');
} catch (\Exception $e) {
return general_error_handler(err: $e, that: $this);
}

View File

@ -25,6 +25,7 @@ public function submit($data)
'resource_type' => Application::class,
]);
$this->application->refresh();
$this->emit('success', 'Storage added successfully');
$this->emit('clearAddStorage');
} catch (\Exception $e) {
return general_error_handler(err: $e, that: $this);

View File

@ -21,6 +21,7 @@ public function submit()
{
$this->validate();
$this->storage->save();
$this->emit('success', 'Storage updated successfully');
}
public function delete()
{

View File

@ -82,5 +82,6 @@ public function submit()
// return;
// }
$this->server->save();
$this->emit('success', 'Server updated successfully.');
}
}

View File

@ -63,6 +63,7 @@ public function saveConfiguration(Server $server)
instant_remote_process([
"echo '$docker_compose_yml_base64' | base64 -d > $proxy_path/docker-compose.yml",
], $server);
$this->emit('success', 'Proxy configuration saved.');
} catch (\Exception $e) {
return general_error_handler(err: $e);
}

View File

@ -207,5 +207,6 @@ public function submit()
if ($this->settings->fqdn || $this->settings->default_redirect_404) {
dispatch(new InstanceProxyCheckJob());
}
$this->emit('success', 'Instance settings updated successfully!');
}
}

View File

@ -42,6 +42,7 @@ public function instantSave()
{
try {
$this->submit();
$this->emit('success', 'Settings saved successfully.');
} catch (\Exception $e) {
$this->settings->smtp->enabled = false;
$this->validate();
@ -73,6 +74,7 @@ public function submit()
$this->settings->smtp->test_recipients = str_replace(' ', '', $this->settings->smtp->test_recipients);
$this->settings->save();
$this->emit('success', 'Transaction email settings updated successfully.');
$this->decrypt();
}
}

View File

@ -6,6 +6,8 @@
use Illuminate\Database\Eloquent\Casts\Attribute;
use Spatie\Activitylog\Models\Activity;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Masmerise\Toaster\Toastable;
use Masmerise\Toaster\Toaster;
use Spatie\SchemalessAttributes\Casts\SchemalessAttributes;
class Application extends BaseModel

View File

@ -8,7 +8,7 @@
'noDirty' => $attributes->has('noDirty'),
'disabled' => null,
])
<div {{ $attributes->merge(['class' => 'flex cursor-pointer label']) }}>
<div {{ $attributes->merge(['class' => 'flex cursor-pointer label']) }}>
<div class="flex gap-1 label-text">
@if ($label)
{{ $label }}

View File

@ -1,7 +1,7 @@
<x-layout>
<h1>Dashboard</h1>
<div class="pt-2 pb-10">Something (more) useful will be here.</div>
<div class="w-full rounded shadow stats stats-vertical lg:stats-horizontal">
<div class="pt-2 pb-10">Something <span class="text-warning">(more)</span> useful will be here.</div>
<div class="w-full rounded stats stats-vertical lg:stats-horizontal">
<div class="stat">
<div class="stat-title">Servers</div>
<div class="stat-value">{{ $servers }}</div>

View File

@ -1,7 +1,7 @@
<form wire:submit.prevent='submit' class="flex flex-col gap-2 xl:items-end xl:flex-row"">
<x-forms.input placeholder="NODE_ENV" noDirty id="key" label="Name" required />
<x-forms.input placeholder="production" noDirty id="value" label="Value" required />
<x-forms.checkbox noDirty id="is_build_time" label="Build Variable?" />
<x-forms.checkbox class="w-96" noDirty id="is_build_time" label="Build Variable?" />
<x-forms.button type="submit">
Add New Variable
</x-forms.button>

View File

@ -4,7 +4,7 @@
<form wire:submit.prevent='submit' class="flex flex-col gap-2 xl:items-end xl:flex-row">
<x-forms.input id="env.key" label="Name" />
<x-forms.input type="password" id="env.value" label="Value" />
<x-forms.checkbox disabled id="env.is_build_time" label="Build Variable?" />
<x-forms.checkbox class="w-96" disabled id="env.is_build_time" label="Build Variable?" />
<div class="flex gap-2">
<x-forms.button type="submit">
Update

View File

@ -5,7 +5,6 @@
<div class="flex gap-2">
<h2>General</h2>
<x-forms.button type="submit">Save</x-forms.button>
</div>
<div class="flex flex-col gap-2 ">
<div class="flex flex-col w-full gap-2 lg:flex-row">

View File

@ -3,12 +3,14 @@
<div class="pt-2 pb-10 ">All Projects</div>
<div class="grid gap-2 lg:grid-cols-2">
@forelse ($projects as $project)
<div class="gap-2 cursor-pointer box group" x-data x-on:click="goto('{{ $project->uuid }}')">
<div class="gap-2 border border-transparent cursor-pointer box group" x-data
x-on:click="goto('{{ $project->uuid }}')">
<div class="flex flex-col mx-6">
<a class=" group-hover:text-white hover:no-underline"
href="{{ route('project.show', ['project_uuid' => data_get($project, 'uuid')]) }}">{{ $project->name }}</a>
<a class="text-xs group-hover:text-white hover:no-underline"
href="{{ route('project.show', ['project_uuid' => data_get($project, 'uuid')]) }}">{{ $project->description }}</a>
<div class="text-xs group-hover:text-white hover:no-underline"
href="{{ route('project.show', ['project_uuid' => data_get($project, 'uuid')]) }}">
{{ $project->description }}</div>
</div>
<div class="flex-1"></div>
<a class="mx-4 rounded hover:text-white"

View File

@ -3,20 +3,34 @@
<div class="pt-2 pb-10 ">All Servers</div>
<div class="grid gap-2 lg:grid-cols-2">
@forelse ($servers as $server)
<a class="text-center hover:no-underline box group"
href="{{ route('server.show', ['server_uuid' => data_get($server, 'uuid')]) }}">
<div class="group-hover:text-white">
<div>{{ $server->name }}</div>
@if (!$server->settings->is_reachable)
<div class="text-xs text-error">not validated</div>
@endif
<div x-data x-on:click="goto('{{ $server->uuid }}')" @class([
'gap-2 border cursor-pointer box group',
'border-transparent' => $server->settings->is_reachable,
'border-red-500' => !$server->settings->is_reachable,
])>
<div class="flex flex-col mx-6">
<div class=" group-hover:text-white">
{{ $server->name }}
@if (!$server->settings->is_reachable)
<span class="text-xs text-error">not validated yet</span>
@endif
</div>
<div class="text-xs group-hover:text-white"
href="{{ route('server.show', ['server_uuid' => data_get($server, 'uuid')]) }}">
{{ $server->description }}</div>
</div>
</a>
<div class="flex-1"></div>
</div>
@empty
<div>
<div>No servers found. Without a server, you won't be able to do much.</div>
<x-use-magic-bar />
</div>
@endforelse
<script>
function goto(uuid) {
window.location.href = '/server/' + uuid;
}
</script>
</div>
</x-layout>