migration script

# Conflicts:
#	app/Filament/Resources/Torrent/AnnounceLogResource.php
This commit is contained in:
NekoCH
2025-09-21 18:07:38 +08:00
parent f0b50e4826
commit 532f3bdb3f
131 changed files with 2177 additions and 1644 deletions
@@ -2,6 +2,17 @@
namespace App\Filament\Resources\System\SettingResource\Pages;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Schemas\Schema;
use Filament\Schemas\Components\Tabs;
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\CheckboxList;
use Filament\Forms\Components\Repeater;
use Filament\Schemas\Components\Section;
use App\Auth\Permission;
use App\Filament\OptionsTrait;
use App\Filament\Resources\System\SettingResource;
@@ -20,13 +31,13 @@ use Illuminate\Support\HtmlString;
use Meilisearch\Contracts\Index\Settings;
use Nexus\Database\NexusDB;
class EditSetting extends Page implements Forms\Contracts\HasForms
class EditSetting extends Page implements HasForms
{
use Forms\Concerns\InteractsWithForms, OptionsTrait;
use InteractsWithForms, OptionsTrait;
protected static string $resource = SettingResource::class;
protected static string $view = 'filament.resources.system.setting-resource.pages.edit-hit-and-run';
protected string $view = 'filament.resources.system.setting-resource.pages.edit-hit-and-run';
public ?array $data = [];
@@ -41,10 +52,10 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
$this->fillForm();
}
public function form(Forms\Form $form): Forms\Form
public function form(Schema $schema): Schema
{
return $form
->schema($this->getFormSchema())
return $schema
->components($this->getFormSchema())
->statePath('data');
}
@@ -59,7 +70,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
protected function getFormSchema(): array
{
return [
Forms\Components\Tabs::make('Heading')
Tabs::make('Heading')
->tabs($this->getTabs())
];
}
@@ -109,7 +120,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
private function getTabs(): array
{
$tabs = [];
$tabs[] = Forms\Components\Tabs\Tab::make(__('label.setting.hr.tab_header'))
$tabs[] = Tab::make(__('label.setting.hr.tab_header'))
->id('hr')
->schema($this->getHitAndRunSchema())
->columns(2)
@@ -120,102 +131,102 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
// ->columns(2)
// ;
$tabs[] = Forms\Components\Tabs\Tab::make(__('label.setting.backup.tab_header'))
$tabs[] = Tab::make(__('label.setting.backup.tab_header'))
->id('backup')
->schema([
Forms\Components\Radio::make('backup.enabled')->options(self::$yesOrNo)->inline(true)->label(__('label.enabled'))->helperText(__('label.setting.backup.enabled_help')),
Forms\Components\Radio::make('backup.frequency')->options(['daily' => 'daily', 'hourly' => 'hourly'])->inline(true)->label(__('label.setting.backup.frequency'))->helperText(__('label.setting.backup.frequency_help')),
Forms\Components\Select::make('backup.hour')->options(range(0, 23))->label(__('label.setting.backup.hour'))->helperText(__('label.setting.backup.hour_help')),
Forms\Components\Select::make('backup.minute')->options(range(0, 59))->label(__('label.setting.backup.minute'))->helperText(__('label.setting.backup.minute_help')),
Radio::make('backup.enabled')->options(self::$yesOrNo)->inline(true)->label(__('label.enabled'))->helperText(__('label.setting.backup.enabled_help')),
Radio::make('backup.frequency')->options(['daily' => 'daily', 'hourly' => 'hourly'])->inline(true)->label(__('label.setting.backup.frequency'))->helperText(__('label.setting.backup.frequency_help')),
Select::make('backup.hour')->options(range(0, 23))->label(__('label.setting.backup.hour'))->helperText(__('label.setting.backup.hour_help')),
Select::make('backup.minute')->options(range(0, 59))->label(__('label.setting.backup.minute'))->helperText(__('label.setting.backup.minute_help')),
// Forms\Components\TextInput::make('backup.google_drive_client_id')->label(__('label.setting.backup.google_drive_client_id')),
// Forms\Components\TextInput::make('backup.google_drive_client_secret')->label(__('label.setting.backup.google_drive_client_secret')),
// Forms\Components\TextInput::make('backup.google_drive_refresh_token')->label(__('label.setting.backup.google_drive_refresh_token')),
// Forms\Components\TextInput::make('backup.google_drive_folder_id')->label(__('label.setting.backup.google_drive_folder_id')),
Forms\Components\TextInput::make('backup.export_path')->label(__('label.setting.backup.export_path'))->helperText(new HtmlString(__('label.setting.backup.export_path_help', ['default_path' => ToolRepository::getBackupExportPathDefault()]))),
Forms\Components\TextInput::make('backup.retention_count')->numeric()->label(__('label.setting.backup.retention_count'))->helperText(new HtmlString(__('label.setting.backup.retention_count_help', ['default_count' => ToolRepository::BACKUP_RETENTION_COUNT_DEFAULT]))),
Forms\Components\Radio::make('backup.via_ftp')->options(self::$yesOrNo)->inline(true)->label(__('label.setting.backup.via_ftp'))->helperText(new HtmlString(__('label.setting.backup.via_ftp_help'))),
Forms\Components\Radio::make('backup.via_sftp')->options(self::$yesOrNo)->inline(true)->label(__('label.setting.backup.via_sftp'))->helperText(new HtmlString(__('label.setting.backup.via_sftp_help'))),
TextInput::make('backup.export_path')->label(__('label.setting.backup.export_path'))->helperText(new HtmlString(__('label.setting.backup.export_path_help', ['default_path' => ToolRepository::getBackupExportPathDefault()]))),
TextInput::make('backup.retention_count')->numeric()->label(__('label.setting.backup.retention_count'))->helperText(new HtmlString(__('label.setting.backup.retention_count_help', ['default_count' => ToolRepository::BACKUP_RETENTION_COUNT_DEFAULT]))),
Radio::make('backup.via_ftp')->options(self::$yesOrNo)->inline(true)->label(__('label.setting.backup.via_ftp'))->helperText(new HtmlString(__('label.setting.backup.via_ftp_help'))),
Radio::make('backup.via_sftp')->options(self::$yesOrNo)->inline(true)->label(__('label.setting.backup.via_sftp'))->helperText(new HtmlString(__('label.setting.backup.via_sftp_help'))),
])->columns(2);
$tabs[] = Forms\Components\Tabs\Tab::make(__('label.setting.seed_box.tab_header'))
$tabs[] = Tab::make(__('label.setting.seed_box.tab_header'))
->id('seed_box')
->schema([
Forms\Components\Radio::make('seed_box.enabled')->options(self::$yesOrNo)->inline(true)->label(__('label.enabled'))->helperText(__('label.setting.seed_box.enabled_help')),
Forms\Components\TextInput::make('seed_box.not_seed_box_max_speed')->label(__('label.setting.seed_box.not_seed_box_max_speed'))->helperText(__('label.setting.seed_box.not_seed_box_max_speed_help'))->integer(),
Forms\Components\Radio::make('seed_box.no_promotion')->options(self::$yesOrNo)->inline(true)->label(__('label.setting.seed_box.no_promotion'))->helperText(__('label.setting.seed_box.no_promotion_help')),
Forms\Components\TextInput::make('seed_box.max_uploaded')->label(__('label.setting.seed_box.max_uploaded'))->helperText(__('label.setting.seed_box.max_uploaded_help'))->integer(),
Forms\Components\TextInput::make('seed_box.max_uploaded_duration')->label(__('label.setting.seed_box.max_uploaded_duration'))->helperText(__('label.setting.seed_box.max_uploaded_duration_help'))->integer(),
Radio::make('seed_box.enabled')->options(self::$yesOrNo)->inline(true)->label(__('label.enabled'))->helperText(__('label.setting.seed_box.enabled_help')),
TextInput::make('seed_box.not_seed_box_max_speed')->label(__('label.setting.seed_box.not_seed_box_max_speed'))->helperText(__('label.setting.seed_box.not_seed_box_max_speed_help'))->integer(),
Radio::make('seed_box.no_promotion')->options(self::$yesOrNo)->inline(true)->label(__('label.setting.seed_box.no_promotion'))->helperText(__('label.setting.seed_box.no_promotion_help')),
TextInput::make('seed_box.max_uploaded')->label(__('label.setting.seed_box.max_uploaded'))->helperText(__('label.setting.seed_box.max_uploaded_help'))->integer(),
TextInput::make('seed_box.max_uploaded_duration')->label(__('label.setting.seed_box.max_uploaded_duration'))->helperText(__('label.setting.seed_box.max_uploaded_duration_help'))->integer(),
])->columns(2);
$id = "meilisearch";
$tabs[] = Forms\Components\Tabs\Tab::make(__("label.setting.$id.tab_header"))
$tabs[] = Tab::make(__("label.setting.$id.tab_header"))
->id($id)
->schema($this->getTabMeilisearchSchema($id))
->columns(2)
;
$id = "image_hosting";
$tabs[] = Forms\Components\Tabs\Tab::make(__("label.setting.$id.tab_header"))
$tabs[] = Tab::make(__("label.setting.$id.tab_header"))
->id($id)
->schema($this->getTabImageHostingSchema($id))
->columns(2)
;
$id = "permission";
$tabs[] = Forms\Components\Tabs\Tab::make(__("label.setting.$id.tab_header"))
$tabs[] = Tab::make(__("label.setting.$id.tab_header"))
->id($id)
->schema($this->getTabPermissionSchema($id))
->columns(2)
;
$tabs[] = Forms\Components\Tabs\Tab::make(__('label.setting.system.tab_header'))
$tabs[] = Tab::make(__('label.setting.system.tab_header'))
->id('system')
->schema([
Forms\Components\Radio::make('system.change_username_card_allow_characters_outside_the_alphabets')
Radio::make('system.change_username_card_allow_characters_outside_the_alphabets')
->options(self::$yesOrNo)
->inline(true)
->label(__('label.setting.system.change_username_card_allow_characters_outside_the_alphabets'))
,
Forms\Components\TextInput::make('system.change_username_min_interval_in_days')
TextInput::make('system.change_username_min_interval_in_days')
->integer()
->label(__('label.setting.system.change_username_min_interval_in_days'))
,
Forms\Components\TextInput::make('system.maximum_number_of_medals_can_be_worn')
TextInput::make('system.maximum_number_of_medals_can_be_worn')
->integer()
->label(__('label.setting.system.maximum_number_of_medals_can_be_worn'))
,
Forms\Components\TextInput::make('system.cookie_valid_days')
TextInput::make('system.cookie_valid_days')
->integer()
->label(__('label.setting.system.cookie_valid_days'))
,
Forms\Components\TextInput::make('system.maximum_upload_speed')
TextInput::make('system.maximum_upload_speed')
->integer()
->label(__('label.setting.system.maximum_upload_speed'))
->helperText(__('label.setting.system.maximum_upload_speed_help'))
,
Forms\Components\Radio::make('system.is_invite_pre_email_and_username')
Radio::make('system.is_invite_pre_email_and_username')
->options(self::$yesOrNo)
->inline(true)
->label(__('label.setting.system.is_invite_pre_email_and_username'))
->helperText(__('label.setting.system.is_invite_pre_email_and_username_help'))
,
Forms\Components\Radio::make('system.is_record_announce_log')
Radio::make('system.is_record_announce_log')
->options(self::$yesOrNo)
->inline(true)
->label(__('label.setting.system.is_record_announce_log'))
->helperText(__('label.setting.system.is_record_announce_log_help'))
,
Forms\Components\Radio::make('system.is_record_seeding_bonus_log')
Radio::make('system.is_record_seeding_bonus_log')
->options(self::$yesOrNo)
->inline(true)
->label(__('label.setting.system.is_record_seeding_bonus_log'))
->helperText(__('label.setting.system.is_record_seeding_bonus_log_help'))
,
Forms\Components\Select::make('system.access_admin_class_min')
Select::make('system.access_admin_class_min')
->options(User::listClass(User::CLASS_VIP))
->label(__('label.setting.system.access_admin_class_min'))
->helperText(__('label.setting.system.access_admin_class_min_help'))
,
Forms\Components\TextInput::make('system.alarm_email_receiver')
TextInput::make('system.alarm_email_receiver')
->label(__('label.setting.system.alarm_email_receiver'))
->helperText(__('label.setting.system.alarm_email_receiver_help'))
,
@@ -228,13 +239,13 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
private function getHitAndRunSchema()
{
$default = [
Forms\Components\Radio::make('hr.mode')->options(HitAndRun::listModes(true))->inline(true)->label(__('label.setting.hr.mode')),
Forms\Components\TextInput::make('hr.inspect_time')->helperText(__('label.setting.hr.inspect_time_help'))->label(__('label.setting.hr.inspect_time'))->integer(),
Forms\Components\TextInput::make('hr.seed_time_minimum')->helperText(__('label.setting.hr.seed_time_minimum_help'))->label(__('label.setting.hr.seed_time_minimum'))->integer(),
Forms\Components\TextInput::make('hr.leech_time_minimum')->helperText(__('label.setting.hr.leech_time_minimum_help'))->label(__('label.setting.hr.leech_time_minimum'))->integer(),
Forms\Components\TextInput::make('hr.ignore_when_ratio_reach')->helperText(__('label.setting.hr.ignore_when_ratio_reach_help'))->label(__('label.setting.hr.ignore_when_ratio_reach'))->integer(),
Forms\Components\TextInput::make('hr.ban_user_when_counts_reach')->helperText(__('label.setting.hr.ban_user_when_counts_reach_help'))->label(__('label.setting.hr.ban_user_when_counts_reach'))->integer(),
Forms\Components\TextInput::make('hr.include_rate')->helperText(__('label.setting.hr.include_rate_help'))->label(__('label.setting.hr.include_rate'))->numeric(),
Radio::make('hr.mode')->options(HitAndRun::listModes(true))->inline(true)->label(__('label.setting.hr.mode')),
TextInput::make('hr.inspect_time')->helperText(__('label.setting.hr.inspect_time_help'))->label(__('label.setting.hr.inspect_time'))->integer(),
TextInput::make('hr.seed_time_minimum')->helperText(__('label.setting.hr.seed_time_minimum_help'))->label(__('label.setting.hr.seed_time_minimum'))->integer(),
TextInput::make('hr.leech_time_minimum')->helperText(__('label.setting.hr.leech_time_minimum_help'))->label(__('label.setting.hr.leech_time_minimum'))->integer(),
TextInput::make('hr.ignore_when_ratio_reach')->helperText(__('label.setting.hr.ignore_when_ratio_reach_help'))->label(__('label.setting.hr.ignore_when_ratio_reach'))->integer(),
TextInput::make('hr.ban_user_when_counts_reach')->helperText(__('label.setting.hr.ban_user_when_counts_reach_help'))->label(__('label.setting.hr.ban_user_when_counts_reach'))->integer(),
TextInput::make('hr.include_rate')->helperText(__('label.setting.hr.include_rate_help'))->label(__('label.setting.hr.include_rate'))->numeric(),
];
return apply_filter("hit_and_run_setting_schema", $default);
}
@@ -242,42 +253,42 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
private function getRequireSeedSectionSchema(): array
{
return [
Forms\Components\Radio::make('require_seed_section.enabled')->options(self::$yesOrNo)->label(__('label.enabled'))->helperText(__('label.setting.require_seed_section.enabled_help')),
Forms\Components\TextInput::make('require_seed_section.menu_title')->label(__('label.setting.require_seed_section.menu_title'))->helperText(__('label.setting.require_seed_section.menu_title_help')),
Forms\Components\TextInput::make('require_seed_section.seeder_lte')->label(__('label.setting.require_seed_section.seeder_lte'))->helperText(__('label.setting.require_seed_section.seeder_lte_help'))->integer(),
Forms\Components\TextInput::make('require_seed_section.seeder_gte')->label(__('label.setting.require_seed_section.seeder_gte'))->helperText(__('label.setting.require_seed_section.seeder_gte_help'))->integer(),
Forms\Components\CheckboxList::make('require_seed_section.require_tags')->label(__('label.setting.require_seed_section.require_tags'))->helperText(__('label.setting.require_seed_section.require_tags_help'))->options(Tag::query()->pluck('name', 'id'))->columns(4),
Forms\Components\Select::make('require_seed_section.promotion_state')->label(__('label.setting.require_seed_section.promotion_state'))->helperText(__('label.setting.require_seed_section.promotion_state_help'))->options(Torrent::listPromotionTypes(true)),
Forms\Components\TextInput::make('require_seed_section.daily_seed_time_min')->label(__('label.setting.require_seed_section.daily_seed_time_min'))->helperText(__('label.setting.require_seed_section.daily_seed_time_min_help'))->integer(),
Forms\Components\TextInput::make('require_seed_section.torrent_count_max')->label(__('label.setting.require_seed_section.torrent_count_max'))->helperText(__('label.setting.require_seed_section.torrent_count_max_help'))->integer(),
Forms\Components\Repeater::make('require_seed_section.bonus_reward')
Radio::make('require_seed_section.enabled')->options(self::$yesOrNo)->label(__('label.enabled'))->helperText(__('label.setting.require_seed_section.enabled_help')),
TextInput::make('require_seed_section.menu_title')->label(__('label.setting.require_seed_section.menu_title'))->helperText(__('label.setting.require_seed_section.menu_title_help')),
TextInput::make('require_seed_section.seeder_lte')->label(__('label.setting.require_seed_section.seeder_lte'))->helperText(__('label.setting.require_seed_section.seeder_lte_help'))->integer(),
TextInput::make('require_seed_section.seeder_gte')->label(__('label.setting.require_seed_section.seeder_gte'))->helperText(__('label.setting.require_seed_section.seeder_gte_help'))->integer(),
CheckboxList::make('require_seed_section.require_tags')->label(__('label.setting.require_seed_section.require_tags'))->helperText(__('label.setting.require_seed_section.require_tags_help'))->options(Tag::query()->pluck('name', 'id'))->columns(4),
Select::make('require_seed_section.promotion_state')->label(__('label.setting.require_seed_section.promotion_state'))->helperText(__('label.setting.require_seed_section.promotion_state_help'))->options(Torrent::listPromotionTypes(true)),
TextInput::make('require_seed_section.daily_seed_time_min')->label(__('label.setting.require_seed_section.daily_seed_time_min'))->helperText(__('label.setting.require_seed_section.daily_seed_time_min_help'))->integer(),
TextInput::make('require_seed_section.torrent_count_max')->label(__('label.setting.require_seed_section.torrent_count_max'))->helperText(__('label.setting.require_seed_section.torrent_count_max_help'))->integer(),
Repeater::make('require_seed_section.bonus_reward')
->label(__('label.setting.require_seed_section.bonus_reward'))
->helperText(__('label.setting.require_seed_section.bonus_reward_help'))
->schema([
Forms\Components\TextInput::make('seeders')
TextInput::make('seeders')
->label(__('label.setting.require_seed_section.seeders'))
->required()
->integer()
->columnSpan(2)
,
Forms\Components\Repeater::make('seed_time_reward')
Repeater::make('seed_time_reward')
->label(__('label.setting.require_seed_section.seed_time_reward'))
->schema([
Forms\Components\TextInput::make('begin')->label(__('label.setting.require_seed_section.seed_time_reward_begin'))->helperText(__('label.setting.require_seed_section.seed_time_reward_begin_help')),
Forms\Components\TextInput::make('end')->label(__('label.setting.require_seed_section.seed_time_reward_end'))->helperText(__('label.setting.require_seed_section.seed_time_reward_end_help')),
Forms\Components\TextInput::make('window')->label(__('label.setting.require_seed_section.seed_time_reward_window'))->helperText(__('label.setting.require_seed_section.seed_time_reward_window_help')),
Forms\Components\TextInput::make('reward')->label(__('label.setting.require_seed_section.seed_time_reward_reward'))->helperText(__('label.setting.require_seed_section.seed_time_reward_reward_help')),
TextInput::make('begin')->label(__('label.setting.require_seed_section.seed_time_reward_begin'))->helperText(__('label.setting.require_seed_section.seed_time_reward_begin_help')),
TextInput::make('end')->label(__('label.setting.require_seed_section.seed_time_reward_end'))->helperText(__('label.setting.require_seed_section.seed_time_reward_end_help')),
TextInput::make('window')->label(__('label.setting.require_seed_section.seed_time_reward_window'))->helperText(__('label.setting.require_seed_section.seed_time_reward_window_help')),
TextInput::make('reward')->label(__('label.setting.require_seed_section.seed_time_reward_reward'))->helperText(__('label.setting.require_seed_section.seed_time_reward_reward_help')),
])
->columns(4)
->columnSpan(5)
,
Forms\Components\Repeater::make('data_traffic_reward')
Repeater::make('data_traffic_reward')
->label(__('label.setting.require_seed_section.data_traffic_reward'))
->schema([
Forms\Components\TextInput::make('begin')->label(__('label.setting.require_seed_section.data_traffic_reward_begin'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_begin_help')),
Forms\Components\TextInput::make('end')->label(__('label.setting.require_seed_section.data_traffic_reward_end'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_end_help')),
Forms\Components\TextInput::make('window')->label(__('label.setting.require_seed_section.data_traffic_reward_window'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_window_help')),
Forms\Components\TextInput::make('reward')->label(__('label.setting.require_seed_section.data_traffic_reward_reward'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_reward_help')),
TextInput::make('begin')->label(__('label.setting.require_seed_section.data_traffic_reward_begin'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_begin_help')),
TextInput::make('end')->label(__('label.setting.require_seed_section.data_traffic_reward_end'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_end_help')),
TextInput::make('window')->label(__('label.setting.require_seed_section.data_traffic_reward_window'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_window_help')),
TextInput::make('reward')->label(__('label.setting.require_seed_section.data_traffic_reward_reward'))->helperText(__('label.setting.require_seed_section.data_traffic_reward_reward_help')),
])
->columns(4)
->columnSpan(5)
@@ -294,7 +305,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
$schema = [];
$name = "$id.enabled";
$schema[] = Forms\Components\Radio::make($name)
$schema[] = Radio::make($name)
->options(self::$yesOrNo)
->inline(true)
->label(__('label.enabled'))
@@ -302,7 +313,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
;
$name = "$id.search_description";
$schema[] = Forms\Components\Radio::make($name)
$schema[] = Radio::make($name)
->options(self::$yesOrNo)
->inline(true)
->label(__("label.setting.$name"))
@@ -310,7 +321,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
;
$name = "$id.default_search_mode";
$schema[] = Forms\Components\Radio::make($name)
$schema[] = Radio::make($name)
->options(SearchBox::listSearchModes())
->inline(true)
->label(__("label.setting.$name"))
@@ -324,7 +335,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
{
$schema = [];
$name = "$id.driver";
$schema[] = Forms\Components\Radio::make($name)
$schema[] = Radio::make($name)
->options(['local' => 'local', 'chevereto' => 'chevereto', 'lsky' => 'lsky'])
->inline(true)
->label(__("label.setting.$name"))
@@ -337,19 +348,19 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
$driverId = sprintf("%s_%s", $id, $driverName);
$driverSchemas = [];
$field = "upload_api_endpoint";
$driverSchemas[] = Forms\Components\TextInput::make("$driverId.$field")
$driverSchemas[] = TextInput::make("$driverId.$field")
->label(__("label.setting.$id.$field"))
;
$field = "upload_token";
$driverSchemas[] = Forms\Components\TextInput::make("$driverId.$field")
$driverSchemas[] = TextInput::make("$driverId.$field")
->label(__("label.setting.$id.$field"))
;
$field = "base_url";
$driverSchemas[] = Forms\Components\TextInput::make("$driverId.$field")
$driverSchemas[] = TextInput::make("$driverId.$field")
->label(__("label.setting.$id.$field"))
;
$driverSection = Forms\Components\Section::make($driverName)->schema($driverSchemas);
$driverSection = Section::make($driverName)->schema($driverSchemas);
$schema[] = $driverSection;
//lsky
@@ -357,18 +368,18 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
$driverId = sprintf("%s_%s", $id, $driverName);
$driverSchemas = [];
$field = "upload_api_endpoint";
$driverSchemas[] = Forms\Components\TextInput::make("$driverId.$field")
$driverSchemas[] = TextInput::make("$driverId.$field")
->label(__("label.setting.$id.$field"))
;
$field = "upload_token";
$driverSchemas[] = Forms\Components\TextInput::make("$driverId.$field")
$driverSchemas[] = TextInput::make("$driverId.$field")
->label(__("label.setting.$id.$field"))
;
$field = "base_url";
$driverSchemas[] = Forms\Components\TextInput::make("$driverId.$field")
$driverSchemas[] = TextInput::make("$driverId.$field")
->label(__("label.setting.$id.$field"))
;
$driverSection = Forms\Components\Section::make($driverName)->schema($driverSchemas);
$driverSection = Section::make($driverName)->schema($driverSchemas);
$schema[] = $driverSection;
@@ -380,7 +391,7 @@ class EditSetting extends Page implements Forms\Contracts\HasForms
$schema = [];
$name = "$id.user_token_allowed";
$schema[] = Forms\Components\CheckboxList::make($name)
$schema[] = CheckboxList::make($name)
->options(TokenRepository::listUserTokenPermissions())
->label(__("label.setting.{$name}"))
->helperText(__("label.setting.{$name}_help"))