From fc3b508b07f0c1ded44114a36edb6587a6840dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 11 Jan 2026 01:47:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/project/IndexView.vue | 7 ++++- web/src/views/project/ListView.vue | 46 ++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/web/src/views/project/IndexView.vue b/web/src/views/project/IndexView.vue index e07a4fad..ebd79ce1 100644 --- a/web/src/views/project/IndexView.vue +++ b/web/src/views/project/IndexView.vue @@ -27,7 +27,12 @@ const editId = ref(0) - + diff --git a/web/src/views/project/ListView.vue b/web/src/views/project/ListView.vue index a7a56472..d2a2056c 100644 --- a/web/src/views/project/ListView.vue +++ b/web/src/views/project/ListView.vue @@ -4,11 +4,14 @@ import { useGettext } from 'vue3-gettext' import project from '@/api/panel/project' import systemctl from '@/api/panel/systemctl' +import RealtimeLog from '@/components/common/RealtimeLog.vue' const type = defineModel('type', { type: String, required: true }) const createModal = defineModel('createModal', { type: Boolean, required: true }) const editModal = defineModel('editModal', { type: Boolean, required: true }) const editId = defineModel('editId', { type: Number, required: true }) +const logModal = ref(false) +const logService = ref('') const { $gettext } = useGettext() const selectedRowKeys = ref([]) @@ -25,9 +28,16 @@ const typeMap: Record = { const columns: any = [ { type: 'selection', fixed: 'left' }, { - title: $gettext('Project Name'), + title: $gettext('Name'), key: 'name', - width: 200, + width: 160, + resizable: true, + ellipsis: { tooltip: true } + }, + { + title: $gettext('Description'), + key: 'description', + width: 300, resizable: true, ellipsis: { tooltip: true } }, @@ -61,7 +71,7 @@ const columns: any = [ { title: $gettext('Actions'), key: 'actions', - width: 280, + width: 300, hideInExcel: true, render(row: any) { return [ @@ -74,6 +84,16 @@ const columns: any = [ }, { default: () => (row.status === 'running' ? $gettext('Stop') : $gettext('Start')) } ), + h( + NButton, + { + size: 'small', + type: 'info', + style: 'margin-left: 10px;', + onClick: () => handleShowLog(row) + }, + { default: () => $gettext('Logs') } + ), h( NButton, { @@ -134,6 +154,11 @@ const handleToggleStatus = (row: any) => { } } +const handleShowLog = (row: any) => { + logService.value = row.name + logModal.value = true +} + const handleEdit = (row: any) => { editId.value = row.id editModal.value = true @@ -189,7 +214,7 @@ watch(type, () => { striped remote :loading="loading" - :scroll-x="900" + :scroll-x="1200" :columns="columns" :data="data" :row-key="(row: any) => row.id" @@ -207,4 +232,17 @@ watch(type, () => { }" /> + + +