improve announce check authkey

This commit is contained in:
xiaomlove
2022-11-06 16:12:15 +08:00
parent b5451cecd6
commit 80cb362ed7
9 changed files with 40 additions and 255 deletions

View File

@@ -72,12 +72,12 @@ class IconResource extends Resource
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('folder'),
Tables\Columns\TextColumn::make('cssfile'),
Tables\Columns\TextColumn::make('multilang'),
Tables\Columns\TextColumn::make('secondicon'),
Tables\Columns\TextColumn::make('designer'),
Tables\Columns\TextColumn::make('name')->label(__('label.name')),
Tables\Columns\TextColumn::make('folder')->label(__('label.icon.folder')),
Tables\Columns\TextColumn::make('multilang')->label(__('label.icon.multilang')),
Tables\Columns\TextColumn::make('secondicon')->label(__('label.icon.secondicon')),
Tables\Columns\TextColumn::make('cssfile')->label(__('label.icon.cssfile')),
Tables\Columns\TextColumn::make('designer')->label(__('label.icon.designer')),
])
->filters([
//

View File

@@ -1,115 +0,0 @@
<?php
namespace App\Filament\Resources\System;
use App\Filament\OptionsTrait;
use App\Filament\Resources\System\CategoryIconResource\Pages;
use App\Filament\Resources\System\CategoryIconResource\RelationManagers;
use App\Models\Icon;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\Resource;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class CategoryIconResource extends Resource
{
use OptionsTrait;
protected static ?string $model = Icon::class;
protected static ?string $navigationIcon = 'heroicon-o-collection';
protected static ?string $navigationGroup = 'System';
protected static ?int $navigationSort = 3;
protected static function getNavigationLabel(): string
{
return __('admin.sidebar.icon');
}
public static function getBreadcrumb(): string
{
return self::getNavigationLabel();
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')->label(__('label.name'))->required(),
Forms\Components\TextInput::make('folder')
->label(__('label.icon.folder'))
->helperText(__('label.icon.folder_help'))
->required()
,
Forms\Components\Radio::make('multilang')
->options(self::$yesOrNo)
->default('no')
->label(__('label.icon.multilang'))
->helperText(__('label.icon.multilang_help'))
,
Forms\Components\Radio::make('secondicon')
->options(self::$yesOrNo)
->default('no')
->label(__('label.icon.secondicon'))
->helperText(__('label.icon.secondicon_help'))
,
Forms\Components\TextInput::make('cssfile')
->label(__('label.icon.cssfile'))
->helperText(__('label.icon.cssfile_help'))
,
Forms\Components\TextInput::make('designer')
->label(__('label.icon.designer'))
->helperText(__('label.icon.designer_help'))
,
Forms\Components\TextInput::make('comment')
->label(__('label.icon.comment'))
->helperText(__('label.icon.comment_help'))
,
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
Tables\Columns\TextColumn::make('name')->label(__('label.name')),
Tables\Columns\TextColumn::make('folder')->label(__('label.icon.folder')),
Tables\Columns\TextColumn::make('multilang')->label(__('label.icon.multilang')),
Tables\Columns\TextColumn::make('secondicon')->label(__('label.icon.secondicon')),
Tables\Columns\TextColumn::make('cssfile')->label(__('label.icon.cssfile')),
Tables\Columns\TextColumn::make('designer')->label(__('label.icon.designer')),
Tables\Columns\TextColumn::make('comment')->label(__('label.icon.comment')),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListCategoryIcons::route('/'),
'create' => Pages\CreateCategoryIcon::route('/create'),
'edit' => Pages\EditCategoryIcon::route('/{record}/edit'),
];
}
}

View File

@@ -1,31 +0,0 @@
<?php
namespace App\Filament\Resources\System\CategoryIconResource\Pages;
use App\Filament\Resources\System\CategoryIconResource;
use Filament\Pages\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreateCategoryIcon extends CreateRecord
{
protected static string $resource = CategoryIconResource::class;
protected static string $view = 'filament.resources.system.category-icon-resource.pages.create-record';
protected function mutateFormDataBeforeCreate(array $data): array
{
return array_filter($data);
}
protected function getRedirectUrl(): string
{
return static::$resource::getUrl('index');
}
protected function getViewData(): array
{
return [
'desc' => nexus_trans('label.icon.desc')
];
}
}

View File

@@ -1,38 +0,0 @@
<?php
namespace App\Filament\Resources\System\CategoryIconResource\Pages;
use App\Filament\Resources\System\CategoryIconResource;
use Filament\Pages\Actions;
use Filament\Resources\Pages\EditRecord;
class EditCategoryIcon extends EditRecord
{
protected static string $resource = CategoryIconResource::class;
protected static string $view = 'filament.resources.system.category-icon-resource.pages.edit-record';
protected function getActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
protected function mutateFormDataBeforeSave(array $data): array
{
return array_filter($data);
}
protected function getRedirectUrl(): string
{
return static::$resource::getUrl('index');
}
protected function getViewData(): array
{
return [
'desc' => nexus_trans('label.icon.desc')
];
}
}

View File

@@ -1,27 +0,0 @@
<?php
namespace App\Filament\Resources\System\CategoryIconResource\Pages;
use App\Filament\PageList;
use App\Filament\Resources\System\CategoryIconResource;
use Filament\Pages\Actions;
use Filament\Resources\Pages\ListRecords;
class ListCategoryIcons extends PageList
{
protected static string $resource = CategoryIconResource::class;
protected function getActions(): array
{
return [
Actions\CreateAction::make(),
];
}
protected function getViewData(): array
{
return [
'desc' => nexus_trans('label.icon.desc')
];
}
}