|
7 | 7 | use App\Settings\DataIntegrationSettings; |
8 | 8 | use Filament\Actions\Action; |
9 | 9 | use Filament\Forms\Components\Checkbox; |
| 10 | +use Filament\Forms\Components\TagsInput; |
10 | 11 | use Filament\Forms\Components\TextInput; |
11 | 12 | use Filament\Forms\Components\Toggle; |
12 | 13 | use Filament\Notifications\Notification; |
13 | 14 | use Filament\Pages\SettingsPage; |
14 | 15 | use Filament\Schemas\Components\Actions; |
15 | 16 | use Filament\Schemas\Components\Grid; |
16 | | -use Filament\Schemas\Components\Section; |
| 17 | +use Filament\Schemas\Components\Tabs; |
| 18 | +use Filament\Schemas\Components\Tabs\Tab; |
17 | 19 | use Filament\Schemas\Components\Utilities\Get; |
18 | 20 | use Filament\Schemas\Schema; |
| 21 | +use Filament\Support\Icons\Heroicon; |
19 | 22 | use Illuminate\Support\Facades\Auth; |
20 | 23 |
|
21 | 24 | class DataIntegration extends SettingsPage |
@@ -52,16 +55,14 @@ public function form(Schema $schema): Schema |
52 | 55 | { |
53 | 56 | return $schema |
54 | 57 | ->components([ |
55 | | - Grid::make([ |
56 | | - 'default' => 1, |
57 | | - 'md' => 3, |
58 | | - ]) |
| 58 | + Tabs::make() |
59 | 59 | ->schema([ |
60 | | - Section::make(__('settings/data_integration.influxdb_v2')) |
61 | | - ->description(__('settings/data_integration.influxdb_v2_description')) |
| 60 | + Tab::make(__('settings/data_integration.influxdb_v2')) |
| 61 | + ->icon(Heroicon::OutlinedCircleStack) |
62 | 62 | ->schema([ |
63 | 63 | Toggle::make('influxdb_v2_enabled') |
64 | 64 | ->label(__('settings/data_integration.influxdb_v2_enabled')) |
| 65 | + ->helpertext(__('settings/data_integration.influxdb_v2_description')) |
65 | 66 | ->reactive() |
66 | 67 | ->columnSpanFull(), |
67 | 68 | Grid::make(['default' => 1, 'md' => 3]) |
@@ -127,7 +128,26 @@ public function form(Schema $schema): Schema |
127 | 128 | ]), |
128 | 129 | ]), |
129 | 130 | ]) |
130 | | - ->compact() |
| 131 | + ->columnSpanFull(), |
| 132 | + Tab::make(__('settings/data_integration.prometheus')) |
| 133 | + ->icon(Heroicon::OutlinedChartBar) |
| 134 | + ->schema([ |
| 135 | + Toggle::make('prometheus_enabled') |
| 136 | + ->label(__('settings/data_integration.prometheus_enabled')) |
| 137 | + ->helperText(__('settings/data_integration.influxdb_v2_description')) |
| 138 | + ->reactive() |
| 139 | + ->columnSpanFull(), |
| 140 | + Grid::make(['default' => 1, 'md' => 3]) |
| 141 | + ->hidden(fn (Get $get) => $get('prometheus_enabled') !== true) |
| 142 | + ->schema([ |
| 143 | + TagsInput::make('prometheus_allowed_ips') |
| 144 | + ->label(__('settings/data_integration.prometheus_allowed_ips')) |
| 145 | + ->helperText(__('settings/data_integration.prometheus_allowed_ips_helper')) |
| 146 | + ->placeholder('192.168.1.100') |
| 147 | + ->splitKeys(['Tab', ',', ' ']) |
| 148 | + ->columnSpanFull(), |
| 149 | + ]), |
| 150 | + ]) |
131 | 151 | ->columnSpanFull(), |
132 | 152 | ]) |
133 | 153 | ->columnSpanFull(), |
|
0 commit comments