From 40f40db63c232a62f0f4729e975c48a7c33da7af Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 6 Feb 2026 10:29:49 +0100 Subject: [PATCH] add alarm level from db --- app/Actions/BettypUserGenerator.php | 36 ----- app/Actions/LoadCountryGroups.php | 32 ----- app/Actions/MultilineGenerator.php | 42 ------ app/Actions/SettingGeneratorClient.php | 123 ++++++++++++++++++ app/Actions/SettingGeneratorUser.php | 68 ++++++++++ .../Services/Tasks/GenerateSetting.php | 12 +- .../Resources/Clients/Tables/ClientsTable.php | 15 +-- .../Events/Tables/Tools/LoadBettype.php | 4 +- .../Events/Tables/Tools/LoadMultiline.php | 1 + .../Resources/Users/Tables/UsersTable.php | 8 +- app/Livewire/BettypeToggle.php | 2 + app/Livewire/ClientGroupListEditor.php | 28 ++-- app/Livewire/UserNotifications.php | 2 +- app/Models/BettypeUser.php | 8 -- app/Models/ClientGroupList.php | 2 +- app/Models/CompetitionGroup.php | 5 + app/Models/Event.php | 6 - app/Models/EventUserNote.php | 6 - app/Models/EventUserStar.php | 6 - app/Models/MultilineClient.php | 6 - app/Models/MultilineSetting.php | 5 - app/Models/Scopes/ClientScope.php | 20 --- app/Models/Scopes/SportScope.php | 20 --- app/Models/Scopes/UserScope.php | 20 --- composer.lock | 6 +- database/seeders/AlarmLevelSeeder.php | 4 +- resources/css/filament/admin/theme.css | 4 +- .../views/livewire/top-menu-items.blade.php | 8 +- 28 files changed, 248 insertions(+), 251 deletions(-) delete mode 100644 app/Actions/BettypUserGenerator.php delete mode 100644 app/Actions/LoadCountryGroups.php delete mode 100644 app/Actions/MultilineGenerator.php create mode 100644 app/Actions/SettingGeneratorClient.php create mode 100644 app/Actions/SettingGeneratorUser.php delete mode 100644 app/Models/Scopes/ClientScope.php delete mode 100644 app/Models/Scopes/SportScope.php delete mode 100644 app/Models/Scopes/UserScope.php diff --git a/app/Actions/BettypUserGenerator.php b/app/Actions/BettypUserGenerator.php deleted file mode 100644 index f60f1e7d..00000000 --- a/app/Actions/BettypUserGenerator.php +++ /dev/null @@ -1,36 +0,0 @@ -id; - - $multilines = MultilineSetting::orderBy('sport_id')->pluck('sport_id', 'id'); - - foreach ($multilines as $multiline_setting_id => $sport_id) { - - $is_active = in_array($multiline_setting_id, [1, 2, 9, 10, 16, 17, 22, 23]) ? 1 : 0; - - $setting = []; - $setting['sport_id'] = $sport_id; - $setting['user_id'] = $user_id; - $setting['multiline_setting_id'] = $multiline_setting_id; - - DB::table('bettype_users')->updateOrInsert($setting, ['is_active' => $is_active]); - - } - - Notification::make() - ->title('Bettypes for user generated successfully') - ->success() - ->send(); - - } -} diff --git a/app/Actions/LoadCountryGroups.php b/app/Actions/LoadCountryGroups.php deleted file mode 100644 index 505a6b17..00000000 --- a/app/Actions/LoadCountryGroups.php +++ /dev/null @@ -1,32 +0,0 @@ -select('name', 'id')->get(); - $countries = []; - foreach ($res as $value) { - $countries[$value->id] = $value->name; - } - - $res = CompetitionGroup::where('sport_id', auth()->user()->sport_id)->select('country_id', 'name', 'id')->get(); - - $arr = []; - foreach ($res as $value) { - if (isset($countries[$value->country_id])) { - $arr[$value->id] = $countries[$value->country_id].' '.$value->name; - } else { - $arr[$value->id] = $value->name; - } - } - asort($arr); - - return $arr; - } -} diff --git a/app/Actions/MultilineGenerator.php b/app/Actions/MultilineGenerator.php deleted file mode 100644 index 3b5a335f..00000000 --- a/app/Actions/MultilineGenerator.php +++ /dev/null @@ -1,42 +0,0 @@ -id; - - MultilineClient::where('client_id', $client_id)->update(['disabled' => 1]); - - $bookmaker = [0, 6, 30, 649, 117]; - - foreach ($record->sport as $sport_id) { - - $multilines = MultilineSetting::where('sport_id', $sport_id)->get(); - - foreach ($multilines as $multiline) { - - for ($i = 1; $i <= 4; $i++) { - - MultilineClient::updateOrInsert( - ['client_id' => $client_id, 'sport_id' => $sport_id, 'multiline_setting_id' => $multiline->id, 'position' => $i], - ['bookmaker_id' => $bookmaker[$i], 'sort' => $i, 'disabled' => 0] - ); - } - } - - } - - Notification::make() - ->title('Multiline generated successfully') - ->success() - ->send(); - - } -} diff --git a/app/Actions/SettingGeneratorClient.php b/app/Actions/SettingGeneratorClient.php new file mode 100644 index 00000000..0ef9478e --- /dev/null +++ b/app/Actions/SettingGeneratorClient.php @@ -0,0 +1,123 @@ +sport as $sport_id) { + + foreach ($record->bookmaker as $client_bookmaker_id) { + + $multilines = MultilineSetting::where('sport_id', $sport_id)->get()->pluck('id'); + + foreach ($multilines as $multiline_id) { + + foreach ($alarm_levels as $alarm_level) { + + AlarmSetting::firstOrCreate( + ['client_bookmaker_id' => $client_bookmaker_id, 'sport_id' => $sport_id, 'multiline_setting_id' => $multiline_id, 'alarm_level_id' => $alarm_level->id], + ['alarm_threshold' => $alarm_level->default_threshold] + ); + } + } + } + } + + /************************************************** + * 2) MULTILINE SLOTS (client_bookmaker_id) + **************************************************/ + + $bookmaker_slots = [1 => 6, 2 => 30, 3 => 649, 4 => 126]; + + foreach ($record->sport as $sport_id) { + + foreach ($record->bookmaker as $client_bookmaker_id) { + + $multilines = MultilineSetting::where('sport_id', $sport_id)->get()->pluck('id'); + + foreach ($multilines as $multiline_id) { + + foreach ($bookmaker_slots as $slot => $bookmaker_id) { + + MultilineClient::firstOrCreate( + ['client_bookmaker_id' => $client_bookmaker_id, 'sport_id' => $sport_id, 'multiline_setting_id' => $multiline_id, 'position' => $slot], + ['bookmaker_id' => $bookmaker_id, 'sort' => $slot, 'disabled' => 0] + ); + } + } + } + } + /************************************************** + * 4) COMPARING BOOKMAKER (client_bookmaker_id) + **************************************************/ + + $bookmakers_soccer = Bookmaker::where('in_soccer', 1)->orderBy('name')->pluck('id')->toArray(); + + ComparingBookmaker::where('method_id', 1)->where('sport_id', 1)->whereNotIn('bookmaker_id', $bookmakers_soccer)->delete(); + + foreach ($record as $client) { + + foreach ($record->bookmaker as $client_bookmaker_id) { + + $i = 1; + foreach ($bookmakers_soccer as $bookmaker_id) { + $margin_threshold = $bookmaker_id == 110 ? 103 : 115; + ComparingBookmaker::updateOrCreate( + ['method_id' => 1, 'sport_id' => 1, 'client_bookmaker_id' => $client_bookmaker_id, 'bookmaker_id' => $bookmaker_id], + ['is_active' => 1, 'time_lastcheck' => 600, 'margin_threshold' => $margin_threshold, 'sorting' => $i] + ); + $i++; + } + } + } + + $sports = Sport::getActiveSports(); + if (($key = array_search(1, $sports)) !== false) { + unset($sports[$key]); + } + + $bookmakers_other = Bookmaker::where('in_other', 1)->orderBy('name')->pluck('id')->toArray(); + + ComparingBookmaker::where('method_id', 1)->whereIn('sport_id', $sports)->whereNotIn('bookmaker_id', $bookmakers_other)->delete(); + + foreach ($record as $client) { + + foreach ($record->bookmaker as $client_bookmaker_id) { + + foreach ($sports as $sport_id) { + $i = 1; + foreach ($bookmakers_other as $bookmaker_id) { + + ComparingBookmaker::updateOrCreate( + ['method_id' => 1, 'sport_id' => $sport_id, 'client_bookmaker_id' => $client_bookmaker_id, 'bookmaker_id' => $bookmaker_id], + ['is_active' => 1, 'time_lastcheck' => 600, 'margin_threshold' => 110, 'sorting' => $i] + ); + $i++; + } + } + } + } + + Notification::make() + ->title('Settings generated successfully') + ->success() + ->send(); + + } +} diff --git a/app/Actions/SettingGeneratorUser.php b/app/Actions/SettingGeneratorUser.php new file mode 100644 index 00000000..ebfb8dca --- /dev/null +++ b/app/Actions/SettingGeneratorUser.php @@ -0,0 +1,68 @@ +pluck('sport_id', 'id'); + + foreach ($multilines as $multiline_setting_id => $sport_id) { + + $is_active = in_array($multiline_setting_id, [1, 2, 9, 10, 16, 17, 22, 23]) ? 1 : 0; + + BettypeUser::firstOrCreate( + ['sport_id' => $sport_id, 'user_id' => $record->id, 'multiline_setting_id' => $multiline_setting_id], + ['is_active' => $is_active], + ); + } + + /************************************************** + * 5) ALARM NOTIFICATION SETTINGS FOR USERS + **************************************************/ + + if (in_array($record->id, [1, 2])) { + $sports = Sport::where('is_active', 1)->pluck('id')->toArray(); + } else { + $sports = Client::find($record->client_id)->value('sport'); + } + $alarm_levels = AlarmLevel::get(); + + foreach ($sports as $sport_id) { + foreach ($alarm_levels as $alarm_level) { + + PersonalNotification::firstOrCreate( + ['sport_id' => $sport_id, 'user_id' => $record->id, 'bookmaker_id' => $record->bookmaker_id, 'alarm_level_id' => $alarm_level->id], + ['notify_by_system' => 0, 'notify_by_email' => 0] + ); + + if ($record->partner_bookmaker_id) { + PersonalNotification::firstOrCreate( + ['sport_id' => $sport_id, 'user_id' => $record->id, 'bookmaker_id' => $record->partner_bookmaker_id, 'alarm_level_id' => $alarm_level->id], + ['notify_by_system' => 0, 'notify_by_email' => 0] + ); + } + } + } + + Notification::make() + ->title('Settings for user generated successfully') + ->success() + ->send(); + + } +} diff --git a/app/Console/Commands/Services/Tasks/GenerateSetting.php b/app/Console/Commands/Services/Tasks/GenerateSetting.php index 1e84771f..7a446d7d 100644 --- a/app/Console/Commands/Services/Tasks/GenerateSetting.php +++ b/app/Console/Commands/Services/Tasks/GenerateSetting.php @@ -32,11 +32,11 @@ class GenerateSetting $sports = Sport::getActiveSports(); /************************************************** - * 1) ALARM BOOKMAKER + * 1) ALARM SETTING (client_bookmaker_id) **************************************************/ if ($debug) { - Notice::note('1) ALARM BOOKMAKER', 'p'); + Notice::note('1) ALARM SETTING', 'p'); } foreach ($clients as $client) { @@ -62,7 +62,7 @@ class GenerateSetting } /************************************************** - * 2) MULTILINE SLOTS + * 2) MULTILINE SLOTS (client_bookmaker_id) **************************************************/ if ($debug) { @@ -94,7 +94,7 @@ class GenerateSetting } /************************************************** - * 3) BETTYPES for USER in MONITOR + * 3) BETTYPES for USER in MONITOR (user_id) **************************************************/ if ($debug) { @@ -117,7 +117,7 @@ class GenerateSetting } /************************************************** - * 4) COMPARING BOOKMAKER + * 4) COMPARING BOOKMAKER (client_bookmaker_id) **************************************************/ if ($debug) { @@ -176,7 +176,7 @@ class GenerateSetting } /************************************************** - * 5) ALARM NOTIFICATION SETTINGS FOR USERS + * 5) ALARM NOTIFICATION SETTINGS FOR USERS (user_id) **************************************************/ if ($debug) { diff --git a/app/Filament/Resources/Clients/Tables/ClientsTable.php b/app/Filament/Resources/Clients/Tables/ClientsTable.php index 3d44d38f..19dba78d 100644 --- a/app/Filament/Resources/Clients/Tables/ClientsTable.php +++ b/app/Filament/Resources/Clients/Tables/ClientsTable.php @@ -2,8 +2,7 @@ namespace App\Filament\Resources\Clients\Tables; -use App\Actions\AlarmGenerator; -use App\Actions\MultilineGenerator; +use App\Actions\SettingGeneratorClient; use App\Models\Bookmaker; use App\Models\Provider; use App\Models\Sport; @@ -37,17 +36,11 @@ class ClientsTable ->formatStateUsing(fn (string $state): string => Sport::where('id', $state)->pluck('name')->first()), ]) ->recordActions([ - Action::make('multiline') + Action::make('Create Settings') ->icon('phosphor-gear-fine') - ->tooltip('Generates basic alarm configuration for client') + ->tooltip('Generates basic configuration for client') ->action(function ($record) { - MultilineGenerator::run($record); - }), - Action::make('alarm') - ->icon('phosphor-gear-fine') - ->tooltip('Generates basic multiline configuration for client') - ->action(function ($record) { - AlarmGenerator::run($record); + SettingGeneratorClient::run($record); }), EditAction::make()->hiddenLabel(), ]); diff --git a/app/Filament/Resources/Events/Tables/Tools/LoadBettype.php b/app/Filament/Resources/Events/Tables/Tools/LoadBettype.php index 67f767d2..0ef671e7 100644 --- a/app/Filament/Resources/Events/Tables/Tools/LoadBettype.php +++ b/app/Filament/Resources/Events/Tables/Tools/LoadBettype.php @@ -10,8 +10,10 @@ class LoadBettype public static function load() { $res = BettypeUser::with('multiline_setting') - ->orderBy('multiline_setting_id') + ->where('user_id', auth()->user()->id) + ->where('sport_id', auth()->user()->sport_id) ->where('is_active', 1) + ->orderBy('multiline_setting_id') ->get(); $arr = []; diff --git a/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php b/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php index baf83ba1..ccce32b6 100644 --- a/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php +++ b/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php @@ -39,6 +39,7 @@ class LoadMultiline } $res = MultilineClient::with('multiline_setting') + ->where('sport_id', auth()->user()->sport_id) ->where('client_bookmaker_id', auth()->user()->bookmaker_id) ->select('bookmaker_id', 'multiline_setting_id') ->orderBy('sort') diff --git a/app/Filament/Resources/Users/Tables/UsersTable.php b/app/Filament/Resources/Users/Tables/UsersTable.php index 00e82b84..c7f9cd8b 100644 --- a/app/Filament/Resources/Users/Tables/UsersTable.php +++ b/app/Filament/Resources/Users/Tables/UsersTable.php @@ -2,7 +2,7 @@ namespace App\Filament\Resources\Users\Tables; -use App\Actions\BettypUserGenerator; +use App\Actions\SettingGeneratorUser; use Filament\Actions\Action; use Filament\Actions\EditAction; use Filament\Tables\Columns\TextColumn; @@ -36,11 +36,11 @@ class UsersTable // ]) ->recordActions([ - Action::make('bettype') + Action::make('Create Settings') ->icon('phosphor-gear-fine') - ->tooltip('Generates basic bettype monitor configuration for this user') + ->tooltip('Generates basic configuration for this user') ->action(function ($record) { - BettypUserGenerator::run($record); + SettingGeneratorUser::run($record); }), EditAction::make()->hiddenLabel(), ]); diff --git a/app/Livewire/BettypeToggle.php b/app/Livewire/BettypeToggle.php index 191a7950..c8a47580 100644 --- a/app/Livewire/BettypeToggle.php +++ b/app/Livewire/BettypeToggle.php @@ -21,6 +21,8 @@ class BettypeToggle extends Component $this->bettype_toggles = []; $res = BettypeUser::with('multiline_setting') + ->where('user_id', auth()->user()->id) + ->where('sport_id', auth()->user()->sport_id) ->orderBy('multiline_setting_id') ->get(); diff --git a/app/Livewire/ClientGroupListEditor.php b/app/Livewire/ClientGroupListEditor.php index e4af259f..275d446d 100644 --- a/app/Livewire/ClientGroupListEditor.php +++ b/app/Livewire/ClientGroupListEditor.php @@ -38,10 +38,11 @@ class ClientGroupListEditor extends Component implements HasActions, HasSchemas, ->badge() ->wrap() ->color('info') - ->formatStateUsing(fn (string $state): string => CompetitionGroup::where('id', $state)->pluck('name')->first()), - ]) - ->filters([ - // ... + ->formatStateUsing(function (string $state): string { + $res = CompetitionGroup::with('country')->where('id', $state)->first(); + + return $res->country->name.' '.$res->name; + }), ]) ->recordActions([ EditAction::make('edit') @@ -57,13 +58,22 @@ class ClientGroupListEditor extends Component implements HasActions, HasSchemas, ->required() ->maxLength(255), Select::make('client_groups') - ->searchable() ->multiple() + ->required() ->preload() - ->options(fn () => LoadCountryGroups::load()), - ])->action(function ($livewire) { - $livewire->dispatch('refreshBettypeMenu'); - }), + ->searchable() + ->options(function (): array { + $res = CompetitionGroup::with('country')->get(); + $arr = []; + foreach ($res as $value) { + $arr[$value->id] = $value->country?->name.' '.$value->name; + } + asort($arr, SORT_STRING); + + return $arr; + + }), + ]), DeleteAction::make('delete')->iconButton(), ]) ->headerActions([ diff --git a/app/Livewire/UserNotifications.php b/app/Livewire/UserNotifications.php index f61192d4..a6ac126b 100644 --- a/app/Livewire/UserNotifications.php +++ b/app/Livewire/UserNotifications.php @@ -35,7 +35,7 @@ class UserNotifications extends Component implements HasActions, HasSchemas, Has { return $table ->query(User::query()->where('client_id', auth()->user()->client_id)->orwhereIn('id', [1, 2])) - ->description('Send a message to one of the users listed') + ->description('Send a message to one of the user listed') ->columns([ TextColumn::make('name')->icon('phosphor-user-duotone')->searchable(), TextColumn::make('email')->icon('phosphor-envelope-duotone'), diff --git a/app/Models/BettypeUser.php b/app/Models/BettypeUser.php index 5ed48f25..d3a308ea 100644 --- a/app/Models/BettypeUser.php +++ b/app/Models/BettypeUser.php @@ -2,8 +2,6 @@ namespace App\Models; -use App\Models\Scopes\SportScope; -use App\Models\Scopes\UserScope; use Illuminate\Database\Eloquent\Model; class BettypeUser extends Model @@ -16,12 +14,6 @@ class BettypeUser extends Model 'unique_key', ]; - protected static function booted(): void - { - static::addGlobalScope(new SportScope); - static::addGlobalScope(new UserScope); - } - public function multiline_setting() { return $this->belongsTo(MultilineSetting::class); diff --git a/app/Models/ClientGroupList.php b/app/Models/ClientGroupList.php index 56a17da7..6e9259b8 100644 --- a/app/Models/ClientGroupList.php +++ b/app/Models/ClientGroupList.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model; class ClientGroupList extends Model { protected $casts = [ - 'client_groups' => 'json', + 'client_groups' => 'array', ]; protected $fillable = [ diff --git a/app/Models/CompetitionGroup.php b/app/Models/CompetitionGroup.php index d3841d3f..92002e7f 100644 --- a/app/Models/CompetitionGroup.php +++ b/app/Models/CompetitionGroup.php @@ -23,4 +23,9 @@ class CompetitionGroup extends Model { return $this->belongsTo(Sport::class); } + + public function country() + { + return $this->belongsTo(Country::class); + } } diff --git a/app/Models/Event.php b/app/Models/Event.php index 05219e3e..d9a7cf7e 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\Models\Scopes\SportScope; use Illuminate\Database\Eloquent\Model; class Event extends Model @@ -28,11 +27,6 @@ class Event extends Model 'away_id', ]; - protected static function booted(): void - { - static::addGlobalScope(new SportScope); - } - public function provider() { return $this->belongsTo(Provider::class); diff --git a/app/Models/EventUserNote.php b/app/Models/EventUserNote.php index 7e604f8e..03220d30 100644 --- a/app/Models/EventUserNote.php +++ b/app/Models/EventUserNote.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\Models\Scopes\ClientScope; use Illuminate\Database\Eloquent\Model; class EventUserNote extends Model @@ -16,11 +15,6 @@ class EventUserNote extends Model 'deleted', ]; - protected static function booted(): void - { - static::addGlobalScope(new ClientScope); - } - public function user() { return $this->belongsTo(User::class); diff --git a/app/Models/EventUserStar.php b/app/Models/EventUserStar.php index ec17af52..5c67e47e 100644 --- a/app/Models/EventUserStar.php +++ b/app/Models/EventUserStar.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\Models\Scopes\UserScope; use Illuminate\Database\Eloquent\Model; class EventUserStar extends Model @@ -11,9 +10,4 @@ class EventUserStar extends Model 'event_id', 'user_id', ]; - - protected static function booted(): void - { - static::addGlobalScope(new UserScope); - } } diff --git a/app/Models/MultilineClient.php b/app/Models/MultilineClient.php index 481428c4..3e94b04b 100644 --- a/app/Models/MultilineClient.php +++ b/app/Models/MultilineClient.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\Models\Scopes\SportScope; use Illuminate\Database\Eloquent\Model; class MultilineClient extends Model @@ -31,9 +30,4 @@ class MultilineClient extends Model { return $this->belongsTo(Bookmaker::class); } - - protected static function booted(): void - { - static::addGlobalScope(new SportScope); - } } diff --git a/app/Models/MultilineSetting.php b/app/Models/MultilineSetting.php index af0e8638..8a3341a1 100644 --- a/app/Models/MultilineSetting.php +++ b/app/Models/MultilineSetting.php @@ -13,9 +13,4 @@ class MultilineSetting extends Model 'short', 'table', ]; - - public function sport() - { - return $this->belongsTo(Sport::class); - } } diff --git a/app/Models/Scopes/ClientScope.php b/app/Models/Scopes/ClientScope.php deleted file mode 100644 index 503a3bc5..00000000 --- a/app/Models/Scopes/ClientScope.php +++ /dev/null @@ -1,20 +0,0 @@ -hasUser()) { - $builder->where('client_id', auth()->user()->client_id); - } - } -} diff --git a/app/Models/Scopes/SportScope.php b/app/Models/Scopes/SportScope.php deleted file mode 100644 index 3b1539f1..00000000 --- a/app/Models/Scopes/SportScope.php +++ /dev/null @@ -1,20 +0,0 @@ -hasUser()) { - $builder->where('sport_id', auth()->user()->sport_id); - } - } -} diff --git a/app/Models/Scopes/UserScope.php b/app/Models/Scopes/UserScope.php deleted file mode 100644 index 49e9997a..00000000 --- a/app/Models/Scopes/UserScope.php +++ /dev/null @@ -1,20 +0,0 @@ -hasUser()) { - $builder->where('user_id', auth()->user()->id); - } - } -} diff --git a/composer.lock b/composer.lock index da3fc360..bcf1344a 100644 --- a/composer.lock +++ b/composer.lock @@ -12983,12 +12983,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.3" }, - "platform-dev": {}, - "plugin-api-version": "2.9.0" + "platform-dev": [], + "plugin-api-version": "2.6.0" } diff --git a/database/seeders/AlarmLevelSeeder.php b/database/seeders/AlarmLevelSeeder.php index 9d6520e8..18a7b0c3 100644 --- a/database/seeders/AlarmLevelSeeder.php +++ b/database/seeders/AlarmLevelSeeder.php @@ -14,8 +14,8 @@ class AlarmLevelSeeder extends Seeder */ $sql = "INSERT INTO `alarm_levels` (`id`, `name`, `color`, `default_threshold`, `created_at`, `updated_at`) VALUES - (1, 'LEVEL 1', 'info', 0.01, NULL, NULL), - (2, 'LEVEL 2', 'warning', 0.20, NULL, NULL), + (1, 'LEVEL 1', 'success', 0.01, NULL, NULL), + (2, 'LEVEL 2', 'info', 0.20, NULL, NULL), (3, 'LEVEL 3', 'danger', 0.30, NULL, NULL); "; DB::unprepared($sql); diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index 104b0af3..cc80a279 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -89,11 +89,11 @@ button[wire\:click="resetTableFiltersForm"] { /* Styling Radio Lable */ .fi-fo-radio { - @apply !grid grid-cols-2 gap-y-4 my-2 + @apply !grid grid-cols-3 gap-y-2 mb-2 } .fi-fo-radio-label { - @apply p-3 border border-gray-200 shadow rounded-md cursor-pointer has-checked:bg-blue-50 has-checked:text-blue-900 dark:has-checked:bg-blue-950 dark:has-checked:text-blue-200 + @apply p-2 border border-gray-200 shadow rounded-md cursor-pointer has-checked:bg-blue-50 has-checked:text-blue-900 dark:has-checked:bg-blue-950 dark:has-checked:text-blue-200 } diff --git a/resources/views/livewire/top-menu-items.blade.php b/resources/views/livewire/top-menu-items.blade.php index e8297919..5c7f0c95 100644 --- a/resources/views/livewire/top-menu-items.blade.php +++ b/resources/views/livewire/top-menu-items.blade.php @@ -62,7 +62,7 @@ {{-- Notifications --}} - {{-- Multiline --}} - + @@ -213,7 +213,7 @@ {{-- Alarm --}} - {{-- Custom Groups --}} - +