fix: invalid value

This commit is contained in:
tbphp
2025-07-07 21:06:11 +08:00
parent 50454f457f
commit fb8301268d
3 changed files with 6 additions and 6 deletions

View File

@@ -133,7 +133,7 @@ export const keysApi = {
},
// 导出密钥
exportKeys(groupId: number, status: "all" | "active" | "inactive" = "all") {
exportKeys(groupId: number, status: "all" | "active" | "invalid" = "all") {
let url = `${http.defaults.baseURL}/groups/${groupId}/keys/export`;
if (status !== "all") {
url += `?status=${status}`;

View File

@@ -37,7 +37,7 @@ const props = defineProps<Props>();
const keys = ref<KeyRow[]>([]);
const loading = ref(false);
const searchText = ref("");
const statusFilter = ref<"all" | "active" | "inactive">("all");
const statusFilter = ref<"all" | "active" | "invalid">("all");
const currentPage = ref(1);
const pageSize = ref(9);
const total = ref(0);
@@ -48,7 +48,7 @@ const dialog = useDialog();
const statusOptions = [
{ label: "全部", value: "all" },
{ label: "有效", value: "active" },
{ label: "无效", value: "inactive" },
{ label: "无效", value: "invalid" },
];
// 更多操作下拉菜单选项
@@ -277,7 +277,7 @@ function getStatusClass(status: KeyStatus): string {
switch (status) {
case "active":
return "status-valid";
case "inactive":
case "invalid":
return "status-invalid";
default:
return "status-unknown";
@@ -305,7 +305,7 @@ async function copyInvalidKeys() {
return;
}
keysApi.exportKeys(props.selectedGroup.id, "inactive");
keysApi.exportKeys(props.selectedGroup.id, "invalid");
}
async function restoreAllInvalid() {

View File

@@ -1,5 +1,5 @@
// 密钥状态
export type KeyStatus = "active" | "inactive" | undefined;
export type KeyStatus = "active" | "invalid" | undefined;
// 数据模型定义
export interface APIKey {