This is an automated email from the ASF dual-hosted git repository.
nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 74c42ee3b1 ui: Fix live patch of routers (#6353)
74c42ee3b1 is described below
commit 74c42ee3b1935add606e7dcca7c3f8331934d2ea
Author: Pearl Dsilva <[email protected]>
AuthorDate: Wed May 4 02:51:10 2022 +0530
ui: Fix live patch of routers (#6353)
---
ui/public/locales/en.json | 1 +
ui/src/config/section/infra/routers.js | 28 +++++++++++++++++++++++++++-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index c812586997..be0a42f20c 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -233,6 +233,7 @@
"label.action.migrate.systemvm.processing": "Migrating system VM...",
"label.action.migrate.systemvm.to.ps": "Migrate system VM to another primary
storage",
"label.action.patch.systemvm": "Patch system VM",
+"label.action.patch.systemvm.vpc": "Patch system VM - VPC Router",
"label.action.patch.systemvm.processing": "Patching system VM....",
"label.action.project.add.account": "Add account to project",
"label.action.project.add.user": "Add user to project",
diff --git a/ui/src/config/section/infra/routers.js
b/ui/src/config/section/infra/routers.js
index 3b595be9b3..576caef80a 100644
--- a/ui/src/config/section/infra/routers.js
+++ b/ui/src/config/section/infra/routers.js
@@ -100,7 +100,7 @@ export default {
label: 'label.action.patch.systemvm',
message: 'message.action.patch.router',
dataView: true,
- hidden: (record) => { return record.state === 'Running' },
+ show: (record) => { return record.state === 'Running' && !('vpcid' in
record) },
mapping: {
id: {
value: (record) => { return record.guestnetworkid }
@@ -120,6 +120,32 @@ export default {
})
}
},
+ {
+ api: 'restartVPC',
+ icon: 'diff-outlined',
+ label: 'label.action.patch.systemvm.vpc',
+ message: 'message.action.patch.router',
+ dataView: true,
+ show: (record) => { return record.state === 'Running' && ('vpcid' in
record) },
+ mapping: {
+ id: {
+ value: (record) => { return record.vpcid }
+ },
+ livepatch: {
+ value: (record) => { return true }
+ }
+ },
+ groupAction: true,
+ popup: true,
+ groupMap: (selection, values, record) => {
+ return selection.map(x => {
+ const data = record.filter(y => { return y.id === x })
+ return {
+ id: data[0].vpcid, livepatch: true
+ }
+ })
+ }
+ },
{
api: 'scaleSystemVm',
icon: 'arrows-alt-outlined',