feat: 删除密钥按钮

This commit is contained in:
tbphp
2025-07-05 12:28:57 +08:00
parent 17f1f06070
commit ef4309cd7a
3 changed files with 18 additions and 7 deletions

11
web/package-lock.json generated
View File

@@ -9,6 +9,7 @@
"version": "0.1.0",
"license": "MIT",
"dependencies": {
"@vicons/ionicons5": "^0.13.0",
"axios": "^1.9.0",
"naive-ui": "^2.41.0",
"vue": "^3.5.13",
@@ -30,10 +31,6 @@
"typescript": "~5.8.3",
"vite": "^6.3.5",
"vue-tsc": "^2.2.8"
},
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8.0.0"
}
},
"node_modules/@babel/helper-string-parser": {
@@ -1359,6 +1356,12 @@
"url": "https://opencollective.com/eslint"
}
},
"node_modules/@vicons/ionicons5": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@vicons/ionicons5/-/ionicons5-0.13.0.tgz",
"integrity": "sha512-zvZKBPjEXKN7AXNo2Na2uy+nvuv6SP4KAMQxpKL2vfHMj0fSvuw7JZcOPCjQC3e7ayssKnaoFVAhbYcW6v41qQ==",
"license": "MIT"
},
"node_modules/@vitejs/plugin-vue": {
"version": "5.2.4",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz",

View File

@@ -32,6 +32,7 @@
},
"packageManager": "pnpm@8.15.0",
"dependencies": {
"@vicons/ionicons5": "^0.13.0",
"axios": "^1.9.0",
"naive-ui": "^2.41.0",
"vue": "^3.5.13",

View File

@@ -1,7 +1,8 @@
<script setup lang="ts">
import { keysApi } from "@/api/keys";
import type { APIKey, Group } from "@/types/models";
import { NButton, NDropdown, NEmpty, NInput, NSelect, NSpace, NSpin } from "naive-ui";
import { AddCircleOutline, RemoveCircleOutline } from "@vicons/ionicons5";
import { NButton, NDropdown, NEmpty, NIcon, NInput, NSelect, NSpace, NSpin } from "naive-ui";
import { computed, ref, watch } from "vue";
interface Props {
@@ -335,12 +336,18 @@ function changePageSize(size: number) {
<!-- 工具栏 -->
<div class="toolbar">
<div class="toolbar-left">
<n-button type="primary" size="small" @click="addKey">
<n-button type="success" size="small" @click="addKey">
<template #icon>
<span style="font-size: 12px">+</span>
<n-icon :component="AddCircleOutline" />
</template>
添加密钥
</n-button>
<n-button type="error" size="small">
<template #icon>
<n-icon :component="RemoveCircleOutline" />
</template>
删除密钥
</n-button>
</div>
<div class="toolbar-right">
<n-space :size="12">