This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.18 by this push:
     new 231a9eae2eb ui: add action to declare/cancel host as degraded (#8327)
231a9eae2eb is described below

commit 231a9eae2eb606def265af54c4eaa8fb8c7fc526
Author: Abhishek Kumar <[email protected]>
AuthorDate: Fri Dec 8 21:38:35 2023 +0530

    ui: add action to declare/cancel host as degraded (#8327)
---
 ui/public/locales/en.json            |  2 ++
 ui/src/config/section/infra/hosts.js | 20 ++++++++++++++++++++
 ui/src/core/lazy_lib/icons_use.js    |  4 ++++
 3 files changed, 26 insertions(+)

diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index 69a794079b5..67351fd21b7 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -404,6 +404,7 @@
 "label.cachemode": "Write-cache type",
 "label.cancel": "Cancel",
 "label.cancelmaintenance": "Cancel maintenance",
+"label.cancel.host.as.degraded": "Cancel host as degraded",
 "label.capacity": "Capacity",
 "label.capacitybytes": "Capacity bytes",
 "label.capacityiops": "IOPS total",
@@ -570,6 +571,7 @@
 "label.db.usage.metrics": "DB/Usage server",
 "label.dbislocal": "The db runs locally",
 "label.dc.name": "DC name",
+"label.declare.host.as.degraded": "Declare host as degraded",
 "label.decline.invitation": "Decline invitation",
 "label.dedicate": "Dedicate",
 "label.dedicate.cluster": "Dedicate cluster",
diff --git a/ui/src/config/section/infra/hosts.js 
b/ui/src/config/section/infra/hosts.js
index 9f2c6292052..cb0de90b26c 100644
--- a/ui/src/config/section/infra/hosts.js
+++ b/ui/src/config/section/infra/hosts.js
@@ -290,6 +290,26 @@ export default {
         }
       }
     },
+    {
+      api: 'declareHostAsDegraded',
+      icon: 'exception-outlined',
+      label: 'label.declare.host.as.degraded',
+      message: 'label.declare.host.as.degraded',
+      dataView: true,
+      show: (record) => {
+        return record.resourcestate !== 'Degraded' && (record.state === 
'Alert' || record.state === 'Disconnected')
+      }
+    },
+    {
+      api: 'cancelHostAsDegraded',
+      icon: 'file-done-outlined',
+      label: 'label.cancel.host.as.degraded',
+      message: 'label.cancel.host.as.degraded',
+      dataView: true,
+      show: (record) => {
+        return record.resourcestate === 'Degraded'
+      }
+    },
     {
       api: 'deleteHost',
       icon: 'delete-outlined',
diff --git a/ui/src/core/lazy_lib/icons_use.js 
b/ui/src/core/lazy_lib/icons_use.js
index ec2d67deaf9..bbda90e3bef 100644
--- a/ui/src/core/lazy_lib/icons_use.js
+++ b/ui/src/core/lazy_lib/icons_use.js
@@ -72,10 +72,12 @@ import {
   DragOutlined,
   EditOutlined,
   EnvironmentOutlined,
+  ExceptionOutlined,
   ExclamationCircleOutlined,
   EyeInvisibleOutlined,
   EyeOutlined,
   FieldTimeOutlined,
+  FileDoneOutlined,
   FileProtectOutlined,
   FilterOutlined,
   FilterTwoTone,
@@ -226,10 +228,12 @@ export default {
     app.component('DragOutlined', DragOutlined)
     app.component('EditOutlined', EditOutlined)
     app.component('EnvironmentOutlined', EnvironmentOutlined)
+    app.component('ExceptionOutlined', ExceptionOutlined)
     app.component('ExclamationCircleOutlined', ExclamationCircleOutlined)
     app.component('EyeInvisibleOutlined', EyeInvisibleOutlined)
     app.component('EyeOutlined', EyeOutlined)
     app.component('FieldTimeOutlined', FieldTimeOutlined)
+    app.component('FileDoneOutlined', FileDoneOutlined)
     app.component('FileProtectOutlined', FileProtectOutlined)
     app.component('FilterOutlined', FilterOutlined)
     app.component('FilterTwoTone', FilterTwoTone)

Reply via email to