feat: add deps page

This commit is contained in:
engigu
2025-12-23 23:14:51 +08:00
parent 4de4073ae2
commit 95242410d5
3 changed files with 11 additions and 2 deletions
+8 -1
View File
@@ -20,6 +20,7 @@ const installing = ref(false)
const showInstallDialog = ref(false)
const newPkgName = ref('')
const newPkgVersion = ref('')
const newPkgRemark = ref('')
// 删除确认
const showDeleteDialog = ref(false)
@@ -54,6 +55,7 @@ async function loadDeps() {
function openInstallDialog() {
newPkgName.value = ''
newPkgVersion.value = ''
newPkgRemark.value = ''
showInstallDialog.value = true
}
@@ -67,7 +69,8 @@ async function installPackage() {
await api.deps.install({
name: newPkgName.value.trim(),
version: newPkgVersion.value.trim() || undefined,
type: activeTab.value
type: activeTab.value,
remark: newPkgRemark.value.trim() || undefined
})
toast.success('安装成功')
showInstallDialog.value = false
@@ -203,6 +206,10 @@ onMounted(loadDeps)
<Label class="text-right">版本</Label>
<Input v-model="newPkgVersion" placeholder="可选,如 1.0.0" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label class="text-right">备注</Label>
<Input v-model="newPkgRemark" placeholder="可选" class="col-span-3" />
</div>
</div>
<DialogFooter>
<Button variant="outline" @click="showInstallDialog = false">取消</Button>