diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e7a755..4844ff3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,5 +48,5 @@ jobs: file: ${{ github.workspace }}/Dockerfile push: true tags: | - gitgud.foo/thegrind/flowtodo:latest - gitgud.foo/thegrind/flowtodo:${{ github.event.release.tag_name }} \ No newline at end of file + gitgud.foo/thegrind/authentikate:latest + gitgud.foo/thegrind/authentikate:${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/app/Livewire/AppContainer.php b/app/Livewire/AppContainer.php new file mode 100644 index 0000000..b857dc7 --- /dev/null +++ b/app/Livewire/AppContainer.php @@ -0,0 +1,58 @@ +loadApps(); + } + + public function loadApps() + { + $this->apps = Application::orderBy('id')->get(); + } + + #[On('app-updated')] + public function handleAppUpdated($id) + { + $new = Application::find($id); + $this->apps = $this->apps->map(fn($app) => $app->id == $id ? $new : $app); + } + + public function confirmDelete($id) + { + $this->confirmDeleteApp = $this->apps->where('id', $id)->first(); + Flux::modal('delete-app-confirm')->show(); + } + + public function deleteApp() + { + $this->confirmDeleteApp->delete(); + $deletedId = $this->confirmDeleteApp->id; + $this->confirmDeleteApp = null; + $this->apps = $this->apps->filter(fn($app) => $app->id != $deletedId); + Flux::modal('delete-app-confirm')->close(); + } + + public function cancelDelete() + { + $this->confirmDeleteApp = null; + Flux::modal('delete-app-confirm')->close(); + } + + public function render() + { + return view('livewire.app-container'); + } +} diff --git a/app/Livewire/AppInfoModal.php b/app/Livewire/AppInfoModal.php new file mode 100644 index 0000000..c36795e --- /dev/null +++ b/app/Livewire/AppInfoModal.php @@ -0,0 +1,57 @@ +loadApp(4); + } + + public function updated($prop) + { + if ($prop == "query") { + if (empty($this->query)) { + return null; + } + $s = str($this->query)->kebab()->toString(); + $icon = "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/{$s}.webp"; + $this->icon = $icon; + } + } + + #[On('appinfo')] + public function loadApp($id) + { + $this->app = Application::find($id); + $this->name = $this->app->name; + $this->icon = $this->app->getIconUrl(); + } + + public function save() + { + $this->app->update([ + 'name' => $this->name, + 'icon' => $this->icon, + ]); + + $this->dispatch('app-updated', ['id' => $this->app->id]); + } + + public function render() + { + return view('livewire.app-info-modal'); + } +} diff --git a/app/Models/Application.php b/app/Models/Application.php index 44d058f..6673f38 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model; class Application extends Model { protected $guarded = ['id']; + + public function getIconUrl() + { + return $this->icon; + } } diff --git a/database/migrations/2025_07_27_194829_add_icons_to_apps.php b/database/migrations/2025_07_27_194829_add_icons_to_apps.php new file mode 100644 index 0000000..e3ee215 --- /dev/null +++ b/database/migrations/2025_07_27_194829_add_icons_to_apps.php @@ -0,0 +1,28 @@ +string('icon')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('applications', function (Blueprint $table) { + $table->dropColumn('icon'); + }); + } +}; diff --git a/public/img/authentikate-logo-2.svg b/public/img/authentikate-logo-2.svg new file mode 100644 index 0000000..204f47b --- /dev/null +++ b/public/img/authentikate-logo-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/img/logo.svg b/public/img/logo.svg new file mode 100644 index 0000000..9d8339e --- /dev/null +++ b/public/img/logo.svg @@ -0,0 +1,54 @@ + + diff --git a/resources/views/components/app-logo-icon.blade.php b/resources/views/components/app-logo-icon.blade.php index 0adc3a2..8ed1108 100644 --- a/resources/views/components/app-logo-icon.blade.php +++ b/resources/views/components/app-logo-icon.blade.php @@ -1,8 +1,30 @@ - +{{-- +fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" {{ $attributes }} +--}} + + \ No newline at end of file diff --git a/resources/views/components/app-logo.blade.php b/resources/views/components/app-logo.blade.php index 2ccc081..66aa2d9 100644 --- a/resources/views/components/app-logo.blade.php +++ b/resources/views/components/app-logo.blade.php @@ -1,6 +1,7 @@ -