From: alfonsomthd Date: Thu, 12 Jul 2018 07:47:47 +0000 (+0200) Subject: mgr/dashboard: created common Card component for info shown in landing page: X-Git-Tag: v14.0.1~852^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22902%2Fhead;p=ceph.git mgr/dashboard: created common Card component for info shown in landing page: Info encapsulated in cd-info-card selector: - Overall health status, MON/OSD/MDS/MGR status Fixes: https://tracker.ceph.com/issues/24778 Signed-off-by: Alfonso Martínez --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts index 34744fc09ada..8e4cc903938c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts @@ -9,6 +9,7 @@ import { SharedModule } from '../../shared/shared.module'; import { DashboardComponent } from './dashboard/dashboard.component'; import { HealthPieComponent } from './health-pie/health-pie.component'; import { HealthComponent } from './health/health.component'; +import { InfoCardComponent } from './info-card/info-card.component'; import { LogColorPipe } from './log-color.pipe'; import { MdsSummaryPipe } from './mds-summary.pipe'; import { MgrSummaryPipe } from './mgr-summary.pipe'; @@ -29,7 +30,8 @@ import { PgStatusPipe } from './pg-status.pipe'; PgStatusPipe, MdsSummaryPipe, PgStatusStylePipe, - HealthPieComponent + HealthPieComponent, + InfoCardComponent ] }) export class DashboardModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.html index 4ce0feae1be3..bc68e2037ffc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.html @@ -1,178 +1,124 @@
- -
-
-
- Health - Overall status: - {{ contentData.health.status }} -
    -
  • - {{ check.type }}: {{ check.summary.message }} -
  • -
-
-
-
+ + Overall status: + {{ contentData.health.status }} +
    +
  • + {{ check.type }}: {{ check.summary.message }} +
  • +
+
-
-
-
-
- -
-
- - Monitors - - {{ contentData.mon_status | monSummary }} -
-
-
-
-
-
-
-
- -
-
- - OSDs - - {{ contentData.osd_map | osdSummary }} -
-
-
-
+ + {{ contentData.mon_status | monSummary }} + + + + {{ contentData.osd_map | osdSummary }} +
-
-
-
-
- -
-
- Metadata servers - {{ contentData.fs_map | mdsSummary }} -
-
-
-
-
-
-
-
- -
-
- Manager daemons - {{ contentData.mgr_map | mgrSummary }} -
-
-
-
+ + {{ contentData.fs_map | mdsSummary }} + + + + {{ contentData.mgr_map | mgrSummary }} +
- -
-
-
- Usage - - - - - - - - - - - - -
- {{ contentData.df.stats.total_objects | dimless }} - -
- -
-
-
- -
-
Objects - Raw capacity -
- ({{ contentData.df.stats.total_used_bytes | dimlessBinary }} used) -
Usage by pool
-
-
-
+ + + + + + + + + + + + +
+ {{ contentData.df.stats.total_objects | dimless }} + +
+ +
+
+
+ +
+
Objects + Raw capacity +
+ ({{ contentData.df.stats.total_used_bytes | dimlessBinary }} used) +
Usage by pool
+
-
-
-
- Pools - - - - - - - - - - - - - - - - - - - - - -
NamePG statusUsageReadWrite
{{ pool.pool_name }} - {{ pool.pg_status | pgStatus }} - - - - {{ pool.stats.rd_bytes.rate | dimless }} - - {{ pool.stats.rd.rate | dimless }} ops - - {{ pool.stats.wr_bytes.rate | dimless }} - - {{ pool.stats.wr.rate | dimless }} ops -
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + +
NamePG statusUsageReadWrite
{{ pool.pool_name }} + {{ pool.pg_status | pgStatus }} + + + + {{ pool.stats.rd_bytes.rate | dimless }} + + {{ pool.stats.rd.rate | dimless }} ops + + {{ pool.stats.wr_bytes.rate | dimless }} + + {{ pool.stats.wr.rate | dimless }} ops +
+
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.scss index 919b41d10fc6..e7728ce57624 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.scss +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.scss @@ -15,48 +15,3 @@ table.ceph-chartbox { height: 120px; width: 120px; } - -.media { - display: block; - min-height: 60px; - width: 100%; - - .media-left { - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; - display: block; - float: left; - height: 60px; - width: 60px; - text-align: center; - font-size: 40px; - line-height: 60px; - padding-right: 0; - - .fa { - font-size: 45px; - } - } - - .media-body { - padding: 5px 10px; - margin-left: 60px; - - .media-heading { - text-transform: uppercase; - display: block; - font-size: 14px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .media-text { - display: block; - font-weight: bold; - font-size: 18px; - } - } -} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.html new file mode 100644 index 000000000000..0941eaad7cee --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.html @@ -0,0 +1,21 @@ +
+
+
+
+ +
+
+ + {{ title }} + + {{ title }} +
+
+
+ + + +
+
+
+
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.scss new file mode 100644 index 000000000000..728f16d6e990 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.scss @@ -0,0 +1,50 @@ +.media { + display: block; + min-height: 60px; + width: 100%; + + .media-left { + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; + display: block; + float: left; + height: 60px; + width: 60px; + text-align: center; + font-size: 40px; + line-height: 60px; + padding-right: 0; + + .fa { + font-size: 45px; + } + } + + .media-body { + padding: 5px 10px; + margin-left: 60px; + + .media-heading { + display: block; + font-size: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + .underline { + border-bottom: 1px solid #e5e5e5; + margin-top: 0px; + margin-bottom: 18px; + padding: 0px; + } + } + + .media-text { + display: block; + font-weight: bold; + font-size: 18px; + } + } +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.ts new file mode 100644 index 000000000000..c01b5ca4d0ca --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-card/info-card.component.ts @@ -0,0 +1,14 @@ +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'cd-info-card', + templateUrl: './info-card.component.html', + styleUrls: ['./info-card.component.scss'] +}) +export class InfoCardComponent { + @Input() title: string; + @Input() link: string; + @Input() cardClass = 'col-md-6'; + @Input() imageClass: string; + @Input() contentClass: string; +}