From d38beeb0722fad31e8b347fd99e4b1f1008636dd Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Sun, 20 Oct 2024 14:29:43 -0400 Subject: [PATCH 1/2] Adding updates --- .gitignore | 2 ++ resources/themes/anchor/components/app/user-menu.blade.php | 2 +- .../themes/anchor/components/marketing/sections/hero.blade.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 457a7ab6f..b9924e85e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ resources/themes/.gitignore /resources/plugins/* !/resources/plugins/installed.json /storage/app/public/livewire-tmp +/storage/app/public/* +!/storage/app/public/demo # Ignore everything inside the resources/plugins folder resources/plugins/* diff --git a/resources/themes/anchor/components/app/user-menu.blade.php b/resources/themes/anchor/components/app/user-menu.blade.php index ea219915b..273b2dc06 100644 --- a/resources/themes/anchor/components/app/user-menu.blade.php +++ b/resources/themes/anchor/components/app/user-menu.blade.php @@ -4,7 +4,7 @@
- Wave Character + Wave Character
From ef52fd47a0b058fb20f9dd7bcfc333c25bf74c90 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Sun, 20 Oct 2024 14:43:22 -0400 Subject: [PATCH 2/2] cleaning up some files --- app/Livewire/Form.php | 52 --------- app/Livewire/Wave/DeployToDo.php | 107 ------------------ app/Providers/Filament/AdminPanelProvider.php | 38 ------- 3 files changed, 197 deletions(-) delete mode 100644 app/Livewire/Form.php delete mode 100644 app/Livewire/Wave/DeployToDo.php diff --git a/app/Livewire/Form.php b/app/Livewire/Form.php deleted file mode 100644 index e71e18291..000000000 --- a/app/Livewire/Form.php +++ /dev/null @@ -1,52 +0,0 @@ -formModel = FormModel::where('slug', $name)->first(); - $this->form->fill(); - } - - - public function form(FilamentForm $form): FilamentForm - { - return $form - ->schema([ - ...$this->dynamicFields( $this->formModel->fields ) - ]) - ->statePath('data'); - } - - public function save(){ - - $state = $this->form->getState(); - $this->validate(); - - - $this->saveDynamicFields($this->formModel->fields, $this->formModel); - - Notification::make() - ->title('Successfully saved your profile settings') - ->success() - ->send(); - } - - public function render() - { - return view('livewire.form'); - } -} diff --git a/app/Livewire/Wave/DeployToDo.php b/app/Livewire/Wave/DeployToDo.php deleted file mode 100644 index 753f202c6..000000000 --- a/app/Livewire/Wave/DeployToDo.php +++ /dev/null @@ -1,107 +0,0 @@ -deploy = json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', file_get_contents(base_path('deploy.json')) ), true); - $this->checkForAppDeployment(); - } - - private function checkForAppDeployment(){ - if(isset( $this->deploy['wave'] ) && isset( $this->deploy['wave']['app_id'] )){ - $this->app_id = $this->deploy['wave']['app_id']; - $this->api_key = $this->deploy['wave']['api_key']; - $this->deployments = $this->getDeployments(); - $this->app = $this->getAppInfo(); - } - } - - public function getDeployments(){ - $response = Http::withToken($this->api_key)->get('https://api.digitalocean.com/v2/apps/' . $this->app_id . '/deployments'); - - return json_decode($response->body(), true); - } - - public function getAppInfo(){ - $response = Http::withToken($this->api_key)->get('https://api.digitalocean.com/v2/apps/' . $this->app_id); - - return json_decode($response->body(), true); - } - - private function writeToDeployFile($id, $key, $deployFileArray){ - $deployFileArray['wave']['app_id'] = $id; - $deployFileArray['wave']['api_key'] = $key; - - - file_put_contents(base_path('deploy.json'), stripslashes(json_encode($deployFileArray, JSON_PRETTY_PRINT))); - $this->deploy = json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', file_get_contents(base_path('deploy.json')) ), true); - } - - public function deploy(){ - - if(!isset($this->app_id)){ - // repo must contain a '/', do a check for that - $repoSplit = explode('/', $this->repo); - $repoName = (isset($repoSplit[0]) && isset($repoSplit[1])) ? $repoSplit[0] . '-' . $repoSplit[1] : false; - $repoName = strtolower($repoName); - if(!$repoName){ - $this->dispatch('notify', ['type' => 'error', 'message' => 'Please make sure you enter a valiid repo (ex: user/repo)']); - return; - } - - if(empty($this->api_key)){ - $this->dispatch('notify', ['type' => 'error', 'message' => 'C\'mon, you can\'t leave the API key field empty.']); - return; - } - - if(is_null($this->deploy)){ - $this->dispatch('notify', ['type' => 'error', 'message' => 'Sorry it looks like your deploy.json does not contain valid JSON']); - return; - } - - // replace values with repoName and Repo url - $finalJSONPayload = json_encode($this->deploy); - $finalJSONPayload = str_replace('${wave.name}', str_replace('_', '-', $repoName), $finalJSONPayload); - $finalJSONPayload = str_replace('${wave.repo}', $this->repo, $finalJSONPayload); - - $response = Http::withToken($this->api_key)->withBody( $finalJSONPayload, 'application/json') - ->post('https://api.digitalocean.com/v2/apps'); - - // if the response is not successful, display the message back from DigitalOcean - if(!$response->successful()){ - $responseBody = json_decode($response->body(), true); - $this->dispatch('notify', ['type' => 'error', 'message' => $responseBody['message']]); - return; - - } - - // get app ID and set it in the JSON - $responseBody = json_decode($response->body(), true); - - $this->writeToDeployFile($responseBody['app']['id'], $this->api_key, $this->deploy); - - $this->checkForAppDeployment(); - - $this->dispatch('notify', ['type' => 'success', 'message' => 'Successfully deployed your application!']); - //dd('hit'); - } - } - - public function render() - { - return view('livewire.wave.deploy-to-do'); - } -} diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index c6a5e5d21..128b42ef0 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -36,30 +36,6 @@ class AdminPanelProvider extends PanelProvider { protected static ?string $navigationIcon = 'heroicon-o-document-text'; - public function boot(): void - { - // Filament::serving(function () { - // Filament::registerNavigationGroups([ - // NavigationGroup::make() - // ->label('Roles & Permissions') - // ->icon('phosphor-shield-star-duotone') - // ->collapsed(), - // ]); - // }); - - // Filament::navigation(function (NavigationBuilder $builder): NavigationBuilder { - // return $builder - // ->groups([ - // NavigationGroup::make('Website') - // ->items([ - // ...UserResource::getNavigationItems(), - // ...RoleResource::getNavigationItems(), - // ...PlanResource::getNavigationItems(), - // ]), - // ]); - // }); - } - public static function getNavigationIcon(): ?string { return 'heroicon-o-presentation-chart-line'; @@ -76,20 +52,6 @@ public function panel(Panel $panel): Panel ->default() ->id('admin') ->path('admin') - // ->navigation(function (NavigationBuilder $builder){ - // return $builder - // ->items([ - // ...UserResource::getNavigationItems(), - // ]) - // ->groups([ - // NavigationGroup::make('Roles & Permissions') - // ->icon('phosphor-shield-star-duotone') - // ->items([ - // ...RoleResource::getNavigationItems(), - // ...PlanResource::getNavigationItems(), - // ])->collapsed(), - // ]); - // }) ->colors([ 'primary' => Color::Blue, ])