[修改]删除了updatetoetcd的page页面、widget排布

This commit is contained in:
makotocc0107
2024-08-28 16:13:59 +08:00
committed by Coding
parent fce4719316
commit d910dbb01c
5 changed files with 25 additions and 21 deletions

23
.idea/workspace.xml generated
View File

@@ -4,11 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[增添]添加了Prometheus服务、对应的widget展示待美化"> <list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[修改]修改美化了了widget样式折线图展示">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/PrometheusMetrics.php" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Pages/UpdateToEtcd.php" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/PrometheusMemory.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/PrometheusMemory.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/UpdateConfigWidget.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/UpdateConfigWidget.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Providers/Filament/AdminPanelProvider.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Providers/Filament/AdminPanelProvider.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/management-panel/app/Providers/Filament/AdminPanelProvider.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Providers/Filament/AdminPanelProvider.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/resources/views/filament/widgets/prometheus-metrics.blade.php" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/management-panel/resources/views/filament/pages/update-to-etcd.blade.php" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -259,7 +261,7 @@
<workItem from="1724743649380" duration="22000" /> <workItem from="1724743649380" duration="22000" />
<workItem from="1724743707590" duration="5840000" /> <workItem from="1724743707590" duration="5840000" />
<workItem from="1724806979170" duration="149000" /> <workItem from="1724806979170" duration="149000" />
<workItem from="1724808563307" duration="14085000" /> <workItem from="1724808563307" duration="14880000" />
</task> </task>
<task id="LOCAL-00001" summary="[增添]添加注册"> <task id="LOCAL-00001" summary="[增添]添加注册">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -373,7 +375,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1724829229997</updated> <updated>1724829229997</updated>
</task> </task>
<option name="localTasksCounter" value="15" /> <task id="LOCAL-00015" summary="[修改]修改美化了了widget样式折线图展示">
<option name="closed" value="true" />
<created>1724831975781</created>
<option name="number" value="00015" />
<option name="presentableId" value="LOCAL-00015" />
<option name="project" value="LOCAL" />
<updated>1724831975781</updated>
</task>
<option name="localTasksCounter" value="16" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -433,6 +443,7 @@
<MESSAGE value="[增添]增添了datasource中的配置参数及对应页面" /> <MESSAGE value="[增添]增添了datasource中的配置参数及对应页面" />
<MESSAGE value="[修改]修改文本 调整了布局" /> <MESSAGE value="[修改]修改文本 调整了布局" />
<MESSAGE value="[增添]添加了Prometheus服务、对应的widget展示待美化" /> <MESSAGE value="[增添]添加了Prometheus服务、对应的widget展示待美化" />
<option name="LAST_COMMIT_MESSAGE" value="[增添]添加了Prometheus服务、对应的widget展示待美化" /> <MESSAGE value="[修改]修改美化了了widget样式折线图展示" />
<option name="LAST_COMMIT_MESSAGE" value="[修改]修改美化了了widget样式折线图展示" />
</component> </component>
</project> </project>

View File

@@ -7,7 +7,9 @@ use Filament\Widgets\ChartWidget;
class PrometheusMemory extends ChartWidget class PrometheusMemory extends ChartWidget
{ {
protected static ?string $heading = 'Chart'; protected static ?int $sort = 3;
protected static ?string $heading = '内存占用率';
protected function getData(): array protected function getData(): array
{ {
@@ -34,7 +36,7 @@ class PrometheusMemory extends ChartWidget
'labels' => $labels, 'labels' => $labels,
'datasets' => [ 'datasets' => [
[ [
'label' => 'Memory Usage (%)', 'label' => '内存占用率 (%)',
'data' => $data, 'data' => $data,
'borderColor' => '#4CAF50', 'borderColor' => '#4CAF50',
'backgroundColor' => 'rgba(76, 175, 80, 0.2)', 'backgroundColor' => 'rgba(76, 175, 80, 0.2)',

View File

@@ -11,6 +11,8 @@ use Spatie\Activitylog\ActivityLogStatus;
class UpdateConfigWidget extends Widget class UpdateConfigWidget extends Widget
{ {
protected static ?int $sort = 2;
protected static string $view = 'filament.widgets.update-config-widget'; protected static string $view = 'filament.widgets.update-config-widget';
public function updateSettingsToEtcd() public function updateSettingsToEtcd()

View File

@@ -43,8 +43,9 @@ class AdminPanelProvider extends PanelProvider
->widgets([ ->widgets([
Widgets\AccountWidget::class, Widgets\AccountWidget::class,
// Widgets\FilamentInfoWidget::class, // Widgets\FilamentInfoWidget::class,
UpdateConfigWidget::class,
PrometheusMemory::class, PrometheusMemory::class,
UpdateConfigWidget::class,
]) ])
->middleware([ ->middleware([
EncryptCookies::class, EncryptCookies::class,
@@ -59,8 +60,6 @@ class AdminPanelProvider extends PanelProvider
]) ])
->authMiddleware([ ->authMiddleware([
Authenticate::class, Authenticate::class,
])->resources([
config('filament-logger.activity_resource')
]); ]);
} }
} }

View File

@@ -1,10 +0,0 @@
<x-filament::page>
<form wire:submit.prevent="updateSettingsToEtcd" class="space-y-6">
{{$this->form }}
<div class="flex flex-wrap items-center gap-4 justify-start">
<x-filament::button type="submit">
导出配置到ETCD
</x-filament::button>
</div>
</form>
</x-filament::page>