chore: 优化站点ip检查

This commit is contained in:
xiaojunnuo
2025-05-28 15:49:48 +08:00
parent 41f4617e66
commit 45814ceb49
9 changed files with 71 additions and 11 deletions
@@ -56,6 +56,16 @@ export const siteInfoApi = {
});
},
async DisabledChange(id: number, disabled: boolean) {
return await request({
url: apiPrefix + "/disabledChange",
method: "post",
data: {
id,
disabled,
},
});
},
async IpCheckChange(id: number, ipCheck: boolean) {
return await request({
url: apiPrefix + "/ipCheckChange",
@@ -360,6 +360,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
width: 100,
sorter: true,
align: "center",
component: {
name: "fs-dict-switch",
vModel: "checked",
on: {
async change({ row, $event }) {
await api.DisabledChange(row.id, $event);
await crudExpose.doRefresh();
},
},
},
},
},
ipCheck: {
@@ -367,8 +377,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: false, color: "green" },
{ label: "禁用", value: true, color: "gray" },
{ label: "启用", value: true, color: "green" },
{ label: "禁用", value: false, color: "gray" },
],
}),
form: {
@@ -380,7 +390,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
width: 100,
conditionalRender: false,
component: {
name: "a-switch",
name: "fs-dict-switch",
vModel: "checked",
on: {
change({ row, $event }) {
@@ -9,7 +9,7 @@ import { onActivated, onMounted, ref, Ref } from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { siteIpApi } from "./api";
import { Modal, notification } from "ant-design-vue";
defineOptions({
name: "SiteIpCertMonitor",
});