diff --git a/Modify-the-logic-of-deleting-the-machine.patch b/Modify-the-logic-of-deleting-the-machine.patch new file mode 100644 index 0000000000000000000000000000000000000000..dba13ba9680a83646bae65fb25ac100be131c000 --- /dev/null +++ b/Modify-the-logic-of-deleting-the-machine.patch @@ -0,0 +1,42 @@ +From aba5560cb48950b52879ffbe8c0283a81d77b889 Mon Sep 17 00:00:00 2001 +From: wubijie +Date: Mon, 15 Apr 2024 14:53:12 +0800 +Subject: [PATCH] Modify the logic of deleting the machine + +--- + src/app/server/service/internal/dao/batchmanagerdao.go | 5 +++++ + src/app/server/service/machine/machinemanager.go | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/src/app/server/service/internal/dao/batchmanagerdao.go b/src/app/server/service/internal/dao/batchmanagerdao.go +index e861c509..54d9e007 100644 +--- a/src/app/server/service/internal/dao/batchmanagerdao.go ++++ b/src/app/server/service/internal/dao/batchmanagerdao.go +@@ -84,3 +84,8 @@ func GetMachineID(BatchID int) ([]uint, error) { + err := mysqlmanager.MySQL().Model(BatchMachines{}).Select("machine_node_id").Where("batch_id=?", BatchID).Find(&machineids).Error + return machineids, err + } ++ ++func DeleteMachineBatch(NodeID int) error { ++ var bm BatchMachines ++ return mysqlmanager.MySQL().Where("machine_node_id=?", NodeID).Delete(&bm).Error ++} +diff --git a/src/app/server/service/machine/machinemanager.go b/src/app/server/service/machine/machinemanager.go +index 8a87ba36..2bf2ca35 100644 +--- a/src/app/server/service/machine/machinemanager.go ++++ b/src/app/server/service/machine/machinemanager.go +@@ -76,6 +76,11 @@ func DeleteMachine(Deluuid []string) map[string]string { + machinelist[machinedeluuid] = err.Error() + } + if node.ID != 0 { ++ //删除机器批次关系表数据 ++ if err := dao.DeleteMachineBatch(node.ID); err != nil { ++ machinelist[machinedeluuid] = err.Error() ++ continue ++ } + if err := dao.DeleteMachine(machinedeluuid); err != nil { + machinelist[machinedeluuid] = err.Error() + } +-- +Gitee + diff --git a/Open-extension_btns-permission.patch b/Open-extension_btns-permission.patch new file mode 100644 index 0000000000000000000000000000000000000000..af841c0715faf8da57e991bc1d914feedd8c14c0 --- /dev/null +++ b/Open-extension_btns-permission.patch @@ -0,0 +1,29 @@ +From d0a943fe0636e7a910b4e83c1688d4a30fa686fa Mon Sep 17 00:00:00 2001 +From: zhaozhenfang +Date: Wed, 15 May 2024 17:39:25 +0800 +Subject: [PATCH] open extension_btns permission + +--- + frontend/src/views/Cluster/Cluster.vue | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/frontend/src/views/Cluster/Cluster.vue b/frontend/src/views/Cluster/Cluster.vue +index 4684889e..50c766c4 100644 +--- a/frontend/src/views/Cluster/Cluster.vue ++++ b/frontend/src/views/Cluster/Cluster.vue +@@ -30,9 +30,10 @@ + + + +- ++ ++ {{ item.name }} + + + +-- +Gitee + diff --git a/PilotGo-web.tar.gz b/PilotGo-web.tar.gz index b3124bfec00e0f3cd7a1ca8c8db40aadd166dc1c..94daa04ea1d00d3c866e6d3ce5a2fc4fe2dc8af8 100644 Binary files a/PilotGo-web.tar.gz and b/PilotGo-web.tar.gz differ diff --git a/PilotGo.spec b/PilotGo.spec old mode 100755 new mode 100644 index c0a5ab6240663384305a4e327ca6071ca753167c..3acf8833af492062e4f35b8a6f98553cdb940691 --- a/PilotGo.spec +++ b/PilotGo.spec @@ -1,14 +1,20 @@ %define debug_package %{nil} Name: PilotGo -Version: 2.0.1 +Version: 2.1.0 Release: 2 Summary: PilotGo is a plugable operation platform written in go License: MulanPSL-2.0 URL: https://gitee.com/openeuler/PilotGo -Source0: https://gitee.com/openeuler/PilotGo/%{name}-%{version}.tar.gz -# Web packaged from ace055a5584482443e9fcfcca906cff2949f6c9b +Source0: https://gitee.com/openeuler/PilotGo/repository/archive/v%{version}.tar.gz +# tar -xvf Source0 +# cd %{name}-v%{version}/frontend/ +# run 'yarn install and yarn build' in it +# tar -czvf PilotGo-web.tar.gz ../frontend/dist/ Source1: PilotGo-web.tar.gz +Patch0: Modify-the-logic-of-deleting-the-machine.patch +Patch1: Open-extension_btns-permission.patch + BuildRequires: systemd BuildRequires: golang @@ -30,25 +36,32 @@ Provides: pilotgo-agent = %{version}-%{release} PilotGo agent. %prep -%autosetup -p1 -n %{name}-%{version} +%setup -n %{name}-v%{version} +%patch 0 -p1 +%patch 1 -p1 tar -xzvf %{SOURCE1} %build +cp -rf frontend/dist/* src/app/server/resource # server -GO111MODULE=on go build -mod=vendor -o PilotGo-server pkg/app/server/main.go +pushd src/app/server +GOWORK=off GO111MODULE=on go build -mod=vendor -o PilotGo-server -tags="production" main.go +popd # agent -GO111MODULE=on go build -mod=vendor -o PilotGo-agent pkg/app/agent/main.go +pushd src/app/agent +GOWORK=off GO111MODULE=on go build -mod=vendor -o PilotGo-agent main.go +popd %install -mkdir -p %{buildroot}/opt/PilotGo/{server/{frontend,log},agent/log} +mkdir -p %{buildroot}/opt/PilotGo/{server/log,agent/log} # server -install -D -m 0755 PilotGo-server %{buildroot}/opt/PilotGo/server -install -D -m 0644 config_server.yaml.templete %{buildroot}/opt/PilotGo/server/config_server.yaml +install -D -m 0755 src/app/server/PilotGo-server %{buildroot}/opt/PilotGo/server +install -D -m 0644 src/config_server.yaml.templete %{buildroot}/opt/PilotGo/server/config_server.yaml +install -D -m 0644 src/user.xlsx.templete %{buildroot}/opt/PilotGo/server/user.xlsx install -D -m 0644 scripts/service/PilotGo-server.service %{buildroot}%{_unitdir}/PilotGo-server.service -cp -rf frontend/dist %{buildroot}/opt/PilotGo/server/frontend # agent -install -D -m 0755 PilotGo-agent %{buildroot}/opt/PilotGo/agent -install -D -m 0644 config_agent.yaml.templete %{buildroot}/opt/PilotGo/agent/config_agent.yaml +install -D -m 0755 src/app/agent/PilotGo-agent %{buildroot}/opt/PilotGo/agent +install -D -m 0644 src/config_agent.yaml.templete %{buildroot}/opt/PilotGo/agent/config_agent.yaml install -D -m 0644 scripts/service/PilotGo-agent.service %{buildroot}%{_unitdir}/PilotGo-agent.service %post server @@ -70,25 +83,26 @@ install -D -m 0644 scripts/service/PilotGo-agent.service %{buildroot}%{_unitdir} %systemd_postun PilotGo-agent.service %files server -%dir /opt/PilotGo -%dir /opt/PilotGo/server -%dir /opt/PilotGo/server/log /opt/PilotGo/server/PilotGo-server /opt/PilotGo/server/config_server.yaml -%dir /opt/PilotGo/server/frontend -/opt/PilotGo/server/frontend/dist +/opt/PilotGo/server/user.xlsx +/opt/PilotGo/server/log %{_unitdir}/PilotGo-server.service %files agent -%dir /opt/PilotGo -%dir /opt/PilotGo/agent -%dir /opt/PilotGo/agent/log /opt/PilotGo/agent/PilotGo-agent /opt/PilotGo/agent/config_agent.yaml +/opt/PilotGo/agent/log %{_unitdir}/PilotGo-agent.service - %changelog +* Thu May 16 2024 jianxinyu - 2.1.0-2 +- Modify the logic of deleting the machine +- Open extension_btns permission + +* Wed Apr 03 2024 jianxinyu - 2.1.0-1 +- Update package to version 2.1.0 + * Wed Sep 13 2023 wubijie - 2.0.1-2 - Modify the README.md file diff --git a/PilotGo-2.0.1.tar.gz b/v2.1.0.tar.gz similarity index 77% rename from PilotGo-2.0.1.tar.gz rename to v2.1.0.tar.gz index d9826271efadd4e894dafa868744a6c1e9a2b402..5bd1e92c8c902a3ee2d1bb59050a4404ca221270 100644 Binary files a/PilotGo-2.0.1.tar.gz and b/v2.1.0.tar.gz differ