mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 14:52:56 +00:00
feat(components): 增强 FaForm/FaDialog/FaDrawer 并重构业务页面
- FaForm 新增 scrollbar 和 maxHeight 属性,支持表单滚动条 - FaForm 暴露 resetFields、clearValidate、validateField 方法 - FaDialog 和 FaDrawer 新增 formMode、confirmLoading 等属性及 confirm/cancel 事件 - 使用 FaDescriptions 和 FaForm 重构 demo 和 memory 页面,减少模板冗余 - 修复布局组件路径引用,统一至 @/components/layouts - 补充 Fa 前缀组件的 ESLint 全局变量声明
This commit is contained in:
+3
-2
@@ -13,7 +13,7 @@
|
||||
<span class="font-medium">Redis监控信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<ElDescriptions :column="6" border>
|
||||
<FaDescriptions :column="6" :scrollbar="false">
|
||||
<ElDescriptionsItem label="Redis版本">
|
||||
{{ cache.info?.redis_version || "-" }}
|
||||
</ElDescriptionsItem>
|
||||
@@ -55,7 +55,7 @@
|
||||
{{ cache.info?.instantaneous_input_kbps || 0 }}kps/
|
||||
{{ cache.info?.instantaneous_output_kbps || 0 }}kps
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
</FaDescriptions>
|
||||
</ElCard>
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
@@ -262,6 +262,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import FaDescriptions from "@/components/others/fa-descriptions/index.vue";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import CacheAPI, {
|
||||
type CacheInfo,
|
||||
|
||||
@@ -66,7 +66,6 @@ import FaTable from "@/components/tables/fa-table/index.vue";
|
||||
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
|
||||
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue";
|
||||
import ArtButtonTable from "@/components/forms/fa-button-table/index.vue";
|
||||
import CopyButton from "@/components/others/fa-copy-button/index.vue";
|
||||
import OnlineAPI, { type OnlineUserTable } from "@/api/module_monitor/online";
|
||||
import type { ColumnOption } from "@/types/component";
|
||||
@@ -235,7 +234,7 @@ const {
|
||||
}
|
||||
return h(ElTooltip, { content: "强退", placement: "top" }, () =>
|
||||
h("span", { class: "inline-flex" }, [
|
||||
h(ArtButtonTable, {
|
||||
h(FaButtonTable, {
|
||||
type: "delete",
|
||||
onClick: () => kickSession(row.session_id),
|
||||
}),
|
||||
|
||||
@@ -222,7 +222,6 @@ import FaTable from "@/components/tables/fa-table/index.vue";
|
||||
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
|
||||
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
|
||||
import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue";
|
||||
import ArtButtonTable from "@/components/forms/fa-button-table/index.vue";
|
||||
import FaDialog from "@/components/modal/fa-dialog/index.vue";
|
||||
import { ResourceAPI, type ResourceItem } from "@/api/module_monitor/resource";
|
||||
import type { ColumnOption } from "@/types/component";
|
||||
@@ -406,7 +405,7 @@ const {
|
||||
!row.is_dir && hasAuth("module_monitor:resource:download")
|
||||
? h(ElTooltip, { content: "下载", placement: "top" }, () =>
|
||||
h("span", { class: "inline-flex" }, [
|
||||
h(ArtButtonTable, {
|
||||
h(FaButtonTable, {
|
||||
type: "view",
|
||||
icon: "ri:download-line",
|
||||
onClick: () => void handleDownload(row),
|
||||
@@ -417,7 +416,7 @@ const {
|
||||
hasAuth("module_monitor:resource:rename")
|
||||
? h(ElTooltip, { content: "重命名", placement: "top" }, () =>
|
||||
h("span", { class: "inline-flex" }, [
|
||||
h(ArtButtonTable, {
|
||||
h(FaButtonTable, {
|
||||
type: "edit",
|
||||
onClick: () => void handleRenameOpen(row),
|
||||
}),
|
||||
@@ -427,7 +426,7 @@ const {
|
||||
hasAuth("module_monitor:resource:delete")
|
||||
? h(ElTooltip, { content: "删除", placement: "top" }, () =>
|
||||
h("span", { class: "inline-flex" }, [
|
||||
h(ArtButtonTable, {
|
||||
h(FaButtonTable, {
|
||||
type: "delete",
|
||||
onClick: () => void handleDelete(row),
|
||||
}),
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
>
|
||||
<span class="text-sm">{{ (server.cpu?.used || 0).toFixed(1) }}%</span>
|
||||
</ElProgress>
|
||||
<ElDescriptions :column="2" border size="small">
|
||||
<FaDescriptions :column="2" size="small" :scrollbar="false">
|
||||
<ElDescriptionsItem label="核心数">
|
||||
{{ server.cpu?.cpu_num || 0 }}
|
||||
</ElDescriptionsItem>
|
||||
@@ -38,7 +38,7 @@
|
||||
<ElDescriptionsItem label="系统使用率">
|
||||
{{ (server.cpu?.sys || 0).toFixed(1) }}%
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
</FaDescriptions>
|
||||
</div>
|
||||
</div>
|
||||
</ElCard>
|
||||
@@ -68,7 +68,7 @@
|
||||
>
|
||||
<span class="text-sm">{{ (server.mem?.usage || 0).toFixed(1) }}%</span>
|
||||
</ElProgress>
|
||||
<ElDescriptions :column="2" border size="small">
|
||||
<FaDescriptions :column="2" size="small" :scrollbar="false">
|
||||
<ElDescriptionsItem label="总内存">
|
||||
{{ server.mem?.total }}
|
||||
</ElDescriptionsItem>
|
||||
@@ -81,7 +81,7 @@
|
||||
<ElDescriptionsItem label="Python内存">
|
||||
{{ server.py?.memory_usage ? server.py.memory_usage.toFixed(1) + "%" : "-" }}
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
</FaDescriptions>
|
||||
</div>
|
||||
</div>
|
||||
</ElCard>
|
||||
@@ -98,7 +98,7 @@
|
||||
<span class="font-medium">服务器基本信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<ElDescriptions :column="2" border size="small">
|
||||
<FaDescriptions :column="2" size="small" :scrollbar="false">
|
||||
<ElDescriptionsItem label="服务器名称">
|
||||
{{ server.sys?.computer_name || "-" }}
|
||||
</ElDescriptionsItem>
|
||||
@@ -111,7 +111,7 @@
|
||||
<ElDescriptionsItem label="系统架构">
|
||||
{{ server.sys?.os_arch || "-" }}
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
</FaDescriptions>
|
||||
</ElCard>
|
||||
</ElCol>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<span class="font-medium">Python运行环境</span>
|
||||
</div>
|
||||
</template>
|
||||
<ElDescriptions :column="2" border size="small">
|
||||
<FaDescriptions :column="2" size="small" :scrollbar="false">
|
||||
<ElDescriptionsItem label="Python名称">
|
||||
{{ server.py?.name || "-" }}
|
||||
</ElDescriptionsItem>
|
||||
@@ -143,7 +143,7 @@
|
||||
<ElDescriptionsItem label="项目路径" :span="2">
|
||||
{{ server.sys?.user_dir || "-" }}
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
</FaDescriptions>
|
||||
</ElCard>
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
@@ -186,6 +186,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import FaDescriptions from "@/components/others/fa-descriptions/index.vue";
|
||||
import ServerAPI, { type ServerInfo } from "@/api/module_monitor/server";
|
||||
|
||||
defineOptions({ name: "ServerMonitor" });
|
||||
|
||||
Reference in New Issue
Block a user