From a512d21f210338cd9958c5648660860b9be15a08 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 23:55:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(project):=20=E6=B7=BB=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=87=AA=E5=90=AF=E5=8A=A8=E8=AE=BE=E7=BD=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20(#1251)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * feat(project): 添加项目自启动设置功能 Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> * style(project): 为自启动开关添加 rubberBand: false Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> * fix: 项目列表宽度 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> Co-authored-by: 耗子 --- internal/data/project.go | 5 +++++ pkg/types/project.go | 1 + web/src/views/project/ListView.vue | 31 ++++++++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/internal/data/project.go b/internal/data/project.go index 7b223881..2076d79a 100644 --- a/internal/data/project.go +++ b/internal/data/project.go @@ -216,6 +216,11 @@ func (r *projectRepo) parseProjectDetail(project *biz.Project) (*types.ProjectDe detail.Uptime = info.Uptime } + // 获取是否自启动 + if enabled, err := systemctl.IsEnabled(project.Name); err == nil { + detail.Enabled = enabled + } + return detail, nil } diff --git a/pkg/types/project.go b/pkg/types/project.go index 4fdcf144..73714495 100644 --- a/pkg/types/project.go +++ b/pkg/types/project.go @@ -39,6 +39,7 @@ type ProjectDetail struct { // 运行状态 Status string `json:"status"` // 运行状态 + Enabled bool `json:"enabled"` // 是否自启动 PID int `json:"pid"` // 进程ID Memory int64 `json:"memory"` // 内存使用(字节) CPU float64 `json:"cpu"` // CPU使用率 diff --git a/web/src/views/project/ListView.vue b/web/src/views/project/ListView.vue index a6e9114c..649501b3 100644 --- a/web/src/views/project/ListView.vue +++ b/web/src/views/project/ListView.vue @@ -1,5 +1,5 @@