From 494aa507812f122412c86811428d40d3e3c511c4 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Mon, 26 Jul 2021 19:03:12 +0200 Subject: [PATCH] F OpenNebula/one#5422: Add sched actions tab (#1379) --- src/fireedge/etc/sunstone/admin/vm-tab.yaml | 1 + src/fireedge/etc/sunstone/user/vm-tab.yaml | 1 + .../components/Tabs/Vm/Network/index.js | 2 +- .../components/Tabs/Vm/SchedActions/Item.js | 118 ++++++++++++++++++ .../{SchedActions.js => SchedActions/List.js} | 30 +++-- .../components/Tabs/Vm/SchedActions/index.js | 92 ++++++++++++++ .../components/Tabs/Vm/Storage/index.js | 2 +- .../src/client/constants/translates.js | 23 ++++ src/fireedge/src/client/constants/vm.js | 1 + .../src/client/features/One/vm/services.js | 5 +- .../src/client/models/VirtualMachine.js | 55 ++++++-- 11 files changed, 311 insertions(+), 19 deletions(-) create mode 100644 src/fireedge/src/client/components/Tabs/Vm/SchedActions/Item.js rename src/fireedge/src/client/components/Tabs/Vm/{SchedActions.js => SchedActions/List.js} (65%) create mode 100644 src/fireedge/src/client/components/Tabs/Vm/SchedActions/index.js diff --git a/src/fireedge/etc/sunstone/admin/vm-tab.yaml b/src/fireedge/etc/sunstone/admin/vm-tab.yaml index af0a2382e2..fec2b227cc 100644 --- a/src/fireedge/etc/sunstone/admin/vm-tab.yaml +++ b/src/fireedge/etc/sunstone/admin/vm-tab.yaml @@ -151,6 +151,7 @@ info-tabs: enabled: true actions: sched_action_create: true + sched_action_update: true sched_action_delete: true charter_create: true diff --git a/src/fireedge/etc/sunstone/user/vm-tab.yaml b/src/fireedge/etc/sunstone/user/vm-tab.yaml index 5e894ed0f3..1c07d11f70 100644 --- a/src/fireedge/etc/sunstone/user/vm-tab.yaml +++ b/src/fireedge/etc/sunstone/user/vm-tab.yaml @@ -151,6 +151,7 @@ info-tabs: enabled: true actions: sched_action_create: true + sched_action_update: true sched_action_delete: true charter_create: true diff --git a/src/fireedge/src/client/components/Tabs/Vm/Network/index.js b/src/fireedge/src/client/components/Tabs/Vm/Network/index.js index e3870df03a..5aca050c6c 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/Network/index.js +++ b/src/fireedge/src/client/components/Tabs/Vm/Network/index.js @@ -45,7 +45,7 @@ const VmNetworkTab = ({ tabProps = {} }) => { <> {actionsAvailable?.includes?.(VM_ACTIONS.ATTACH_NIC) && ( + )} + {actionsAvailable?.includes?.(VM_ACTIONS.CHARTER_CREATE) && ( + } + onClick={show} + /> + )} + + + + {display && ( + +

TODO: should define in view yaml ??

+
+ )} + + ) +} + +VmSchedulingTab.propTypes = { + tabProps: PropTypes.object +} + +VmSchedulingTab.displayName = 'VmSchedulingTab' + +export default VmSchedulingTab diff --git a/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js b/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js index 74500e0909..b1eab1bd7e 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js +++ b/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js @@ -42,7 +42,7 @@ const VmStorageTab = ({ tabProps = {} }) => { <> {actionsAvailable?.includes?.(VM_ACTIONS.ATTACH_DISK) && (