diff --git a/app/Http/Livewire/Project/Application/Danger.php b/app/Http/Livewire/Project/Application/Danger.php index 72873665e..4af90927e 100644 --- a/app/Http/Livewire/Project/Application/Danger.php +++ b/app/Http/Livewire/Project/Application/Danger.php @@ -4,14 +4,17 @@ use App\Models\Application; use Livewire\Component; +use Visus\Cuid2\Cuid2; class Danger extends Component { public Application $application; public array $parameters; + public string|null $modalId = null; public function mount() { + $this->modalId = new Cuid2(7); $this->parameters = getRouteParameters(); } public function delete() diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php index 9b1b78a00..9b35de54f 100644 --- a/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php +++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php @@ -29,6 +29,7 @@ public function mount() } public function submit() { + ray('submitting'); $this->validate(); $this->emitUp('submit', [ 'key' => $this->key, @@ -36,6 +37,7 @@ public function submit() 'is_build_time' => $this->is_build_time, 'is_preview' => $this->is_preview, ]); + $this->clear(); } public function clear() { diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/All.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/All.php index 1dcd605cd..f1ac75917 100644 --- a/app/Http/Livewire/Project/Application/EnvironmentVariable/All.php +++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/All.php @@ -5,11 +5,17 @@ use App\Models\Application; use App\Models\EnvironmentVariable; use Livewire\Component; +use Visus\Cuid2\Cuid2; class All extends Component { public Application $application; + public string|null $modalId = null; protected $listeners = ['refreshEnvs', 'submit']; + public function mount() + { + $this->modalId = new Cuid2(7); + } public function refreshEnvs() { $this->application->refresh(); @@ -17,6 +23,11 @@ public function refreshEnvs() public function submit($data) { try { + $found = $this->application->environment_variables()->where('key', $data['key'])->first(); + if ($found) { + $this->emit('error', 'Environment variable already exists.'); + return; + } EnvironmentVariable::create([ 'key' => $data['key'], 'value' => $data['value'], @@ -27,7 +38,6 @@ public function submit($data) $this->application->refresh(); $this->emit('success', 'Environment variable added successfully.'); - $this->emit('clearAddEnv'); } catch (\Exception $e) { return general_error_handler(err: $e, that: $this); } diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php index 61ecaf3de..c5260e77c 100644 --- a/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php +++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php @@ -4,12 +4,13 @@ use App\Models\EnvironmentVariable as ModelsEnvironmentVariable; use Livewire\Component; +use Visus\Cuid2\Cuid2; class Show extends Component { public $parameters; public ModelsEnvironmentVariable $env; - + public string|null $modalId = null; protected $rules = [ 'env.key' => 'required|string', 'env.value' => 'required|string', @@ -22,6 +23,7 @@ class Show extends Component ]; public function mount() { + $this->modalId = new Cuid2(7); $this->parameters = getRouteParameters(); } public function submit() diff --git a/app/Http/Livewire/Project/Application/Storages/Show.php b/app/Http/Livewire/Project/Application/Storages/Show.php index 41c3c1fb8..ef6042baf 100644 --- a/app/Http/Livewire/Project/Application/Storages/Show.php +++ b/app/Http/Livewire/Project/Application/Storages/Show.php @@ -3,10 +3,12 @@ namespace App\Http\Livewire\Project\Application\Storages; use Livewire\Component; +use Visus\Cuid2\Cuid2; class Show extends Component { public $storage; + public string|null $modalId = null; protected $rules = [ 'storage.name' => 'required|string', 'storage.mount_path' => 'required|string', @@ -17,6 +19,10 @@ class Show extends Component 'mount_path' => 'mount', 'host_path' => 'host', ]; + public function mount() + { + $this->modalId = new Cuid2(7); + } public function submit() { $this->validate(); diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.php index fc98c05bf..c7c056665 100644 --- a/app/Http/Livewire/Server/Form.php +++ b/app/Http/Livewire/Server/Form.php @@ -5,6 +5,7 @@ use App\Actions\Server\InstallDocker; use App\Models\Server; use Livewire\Component; +use Visus\Cuid2\Cuid2; class Form extends Component { @@ -13,6 +14,7 @@ class Form extends Component public $dockerVersion; public string|null $wildcard_domain = null; public int $cleanup_after_percentage; + public string|null $modalId = null; protected $rules = [ 'server.name' => 'required|min:6', @@ -35,6 +37,7 @@ class Form extends Component ]; public function mount() { + $this->modalId = new Cuid2(7); $this->wildcard_domain = $this->server->settings->wildcard_domain; $this->cleanup_after_percentage = $this->server->settings->cleanup_after_percentage; } @@ -98,4 +101,4 @@ public function submit() $this->server->save(); $this->emit('success', 'Server updated successfully.'); } -} \ No newline at end of file +} diff --git a/app/View/Components/Forms/Button.php b/app/View/Components/Forms/Button.php new file mode 100644 index 000000000..8621db72a --- /dev/null +++ b/app/View/Components/Forms/Button.php @@ -0,0 +1,30 @@ +id)) $this->id = new Cuid2(7); + if (is_null($this->name)) $this->name = $this->id; + + $this->label = Str::title($this->label); + return view('components.forms.select'); + } +} diff --git a/app/View/Components/Forms/Textarea.php b/app/View/Components/Forms/Textarea.php new file mode 100644 index 000000000..f4d1f0bee --- /dev/null +++ b/app/View/Components/Forms/Textarea.php @@ -0,0 +1,43 @@ +id)) $this->id = new Cuid2(7); + if (is_null($this->name)) $this->name = $this->id; + + $this->label = Str::title($this->label); + return view('components.forms.textarea'); + } +} diff --git a/app/View/Components/Modal.php b/app/View/Components/Modal.php new file mode 100644 index 000000000..b317d3c44 --- /dev/null +++ b/app/View/Components/Modal.php @@ -0,0 +1,33 @@ +=16.9.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/daisyui" - }, - "peerDependencies": { - "postcss": "^8" } }, "node_modules/delayed-stream": { diff --git a/package.json b/package.json index 2884c7466..ed81d6a26 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@tailwindcss/typography": "0.5.9", "alpinejs": "3.12.2", - "daisyui": "3.0.3", + "daisyui": "3.2.1", "tailwindcss-scrollbar": "0.1.0" } } \ No newline at end of file diff --git a/resources/css/app.css b/resources/css/app.css index b788c6e6d..5bca7271f 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -2,19 +2,22 @@ @tailwind components; @tailwind utilities; -.scrollbar { - @apply scrollbar-thumb-coollabs-100 scrollbar-track-coolgray-200 scrollbar-w-2; -} html { @apply text-neutral-400; } body { @apply text-sm antialiased scrollbar; } +button[isError] { + @apply bg-red-600 hover:bg-red-500; +} +.scrollbar { + @apply scrollbar-thumb-coollabs-100 scrollbar-track-coolgray-200 scrollbar-w-2; +} .main { @apply max-w-screen-xl pt-4 pl-24 pr-10 mx-auto; } -input { +/* input { @apply w-full text-white rounded outline-none input input-sm h-7 placeholder:text-neutral-700 bg-coolgray-200 read-only:bg-coolgray-200/50 read-only:text-opacity-25; } input:not(input[type="checkbox"]) { @@ -22,14 +25,14 @@ input:not(input[type="checkbox"]) { } input[type="checkbox"] { @apply rounded toggle toggle-warning toggle-xs disabled:toggle-warning; -} +} */ -textarea { +/* textarea { @apply text-xs leading-5 text-white rounded textarea read-only:bg-coolgray-200/50 disabled:border-none read-only:text-opacity-25 placeholder:text-neutral-700 scrollbar bg-coolgray-200; } select { @apply font-normal text-white border-none rounded h-7 select select-xs disabled:bg-coolgray-200 disabled:opacity-50 placeholder:text-neutral-700 bg-coolgray-200; -} +} */ .label-text, label { @apply text-neutral-400; @@ -39,12 +42,12 @@ .loading { @apply w-4 text-warning; } -button[isWarning] { +/* button[isWarning] { @apply bg-red-600 hover:bg-red-500; } button[isHighlighted] { @apply text-white btn-primary; -} +} */ h1 { @apply text-3xl font-bold text-white; } diff --git a/resources/views/components/applications/actions.blade.php b/resources/views/components/applications/actions.blade.php index 141a9b151..fe5b235fc 100644 --- a/resources/views/components/applications/actions.blade.php +++ b/resources/views/components/applications/actions.blade.php @@ -8,7 +8,7 @@ class="relative text-xs text-white normal-case rounded -ml-44 min-w-max menu bg-coolgray-200"> @if ($application->status === 'running')
  • -
    @@ -19,10 +19,10 @@ class="relative text-xs text-white normal-case rounded -ml-44 min-w-max menu bg- Restart
  • -
    +
    @@ -35,7 +35,7 @@ class="relative text-xs text-white normal-case rounded -ml-44 min-w-max menu bg-
  • -
    @@ -49,7 +49,7 @@ class="relative text-xs text-white normal-case rounded -ml-44 min-w-max menu bg-
  • @else
  • -
    @@ -60,7 +60,7 @@ class="relative text-xs text-white normal-case rounded -ml-44 min-w-max menu bg-
  • -
    diff --git a/resources/views/components/applications/links.blade.php b/resources/views/components/applications/links.blade.php index 4a8e14672..b410cf0e1 100644 --- a/resources/views/components/applications/links.blade.php +++ b/resources/views/components/applications/links.blade.php @@ -6,7 +6,8 @@ @else -