diff --git a/web/src/api/index.ts b/web/src/api/index.ts index 752172f..2a56130 100644 --- a/web/src/api/index.ts +++ b/web/src/api/index.ts @@ -352,6 +352,7 @@ export interface Dependency { version: string type: string remark: string + log: string created_at: string updated_at: string } diff --git a/web/src/views/dependencies/Dependencies.vue b/web/src/views/dependencies/Dependencies.vue index d8d8e7f..2d9c668 100644 --- a/web/src/views/dependencies/Dependencies.vue +++ b/web/src/views/dependencies/Dependencies.vue @@ -7,7 +7,7 @@ import { Badge } from '@/components/ui/badge' import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' -import { Trash2, Package, Search, RefreshCw, Loader2, Download } from 'lucide-vue-next' +import { Trash2, Package, Search, RefreshCw, Loader2, Download, FileText } from 'lucide-vue-next' import { api, type Dependency } from '@/api' import { toast } from 'vue-sonner' @@ -25,6 +25,11 @@ const newPkgVersion = ref('') const showDeleteDialog = ref(false) const depToDelete = ref(null) +// 日志对话框 +const showLogDialog = ref(false) +const logContent = ref('') +const logPkgName = ref('') + // 搜索 const searchQuery = ref('') @@ -93,6 +98,12 @@ async function uninstallPackage() { } } +function showLog(dep: Dependency) { + logPkgName.value = dep.name + logContent.value = dep.log || '暂无日志' + showLogDialog.value = true +} + function getTypeLabel(type: string) { return type === 'py' ? 'Python' : 'Node.js' } @@ -163,7 +174,10 @@ onMounted(loadDeps) {{ dep.name }} {{ dep.version || '-' }} {{ dep.remark || '-' }} - + + @@ -217,5 +231,20 @@ onMounted(loadDeps) + + + + + + 安装日志 - {{ logPkgName }} + +
+
{{ logContent }}
+
+ + + +
+