Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make containers dashboard a shareable view and fix wrong pf-utilization-trend-chart directive #7296

Merged
merged 1 commit into from
Mar 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 1 addition & 120 deletions app/views/container_dashboard/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,120 +1 @@
.container-fluid.container-tiles-pf.containers-dashboard.miq-dashboard-view{"ng-app" => "containerDashboard",
"ng-controller" => "containerDashboardController as dashboard"}
.row.row-tile-pf
.col-xs-6.col-sm-4.col-md-2
%div{:layout => "tall",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.providers"}

.col-xs-12.col-sm-12.col-md-10
.row
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.nodes",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.containers",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.registries",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.projects",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.pods",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.services",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.images",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.routes",
:url => "navigation"}

.row.row-tile-pf
.col-xs-6.col-sm-6.col-md-6
%div{"head-title" => _("Aggregated Node Utilization"),
:hidetopborder => "true",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!utilizationLoadingDone"}
.row{"ng-if" => "utilizationLoadingDone"}

.col-xs-6.col-sm-6.col-md-6
%div{"ng-if" => "cpuUsageData"}
%div{"chart-data" => "cpuUsageData",
:config => "cpuUsageConfig",
"donut-config" => "cpuUsageDonutConfig",
"pf-utilization-chart" => "",
"sparkline-config" => "cpuUsageSparklineConfig"}
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !cpuUsageData }"}
= _("Last 30 Days")

.col-xs-6.col-sm-6.col-md-6
%div{"ng-if" => "memoryUsageData"}
%div{"chart-data" => "memoryUsageData",
:config => "memoryUsageConfig",
"donut-config" => "memoryUsageDonutConfig",
"pf-utilization-chart" => "",
"sparkline-config" => "memoryUsageSparklineConfig"}
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !memoryUsageData }"}
= _("Last 30 Days")

.col-xs-6.col-sm-6.col-md-6
%div{"column-sizing-class" => "col-xs-8 col-sm-6 col-md-6",
"heat-map-usage-legend-labels" => "nodeHeatMapUsageLegendLabels",
"heatmap-chart-height" => "dashboardHeatmapChartHeight",
:heatmaps => "heatmaps",
"heatmaps-card" => "",
:hidetopborder => "true",
:title => _("Node Utilization")}

.row.row-tile-pf.row-tile-pf-last
.col-md-6
%div{"head-title" => "{{networkUtilizationHourlyConfig.headTitle}}",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!networkUtilizationLoadingDone"}
%div{"chart-data" => "hourlyNetworkUtilization",
"chart-height" => "chartHeight",
:config => "networkUtilizationHourlyConfig",
"ng-if" => "networkUtilizationLoadingDone",
"pf-trends-chart" => ""}

.col-md-6
%div{"head-title" => "{{networkUtilizationDailyConfig.headTitle}}",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!networkUtilizationLoadingDone"}
%div{"chart-data" => "dailyNetworkUtilization",
"chart-height" => "chartHeight",
:config => "networkUtilizationDailyConfig",
"ng-if" => "networkUtilizationLoadingDone",
"pf-trends-chart" => ""}
= render :partial => "shared/views/show_containers_dashboard"
120 changes: 1 addition & 119 deletions app/views/ems_container/_show_dashboard.html.haml
Original file line number Diff line number Diff line change
@@ -1,119 +1 @@
.container-fluid.container-tiles-pf.single-provider-containers-dashboard.miq-dashboard-view{"ng-app" => "containerDashboard",
"ng-controller" => "containerDashboardController as dashboard"}
.row.row-tile-pf
.col-xs-6.col-sm-4.col-md-2
.col-xs-12.provider-card{"pf-card" => "",
"show-top-border" => "true"}
%span.provider-icon-large{"ng-class" => "providerTypeIconClass"}

.col-xs-12.col-sm-12.col-md-10
.row
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.nodes",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.containers",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.registries",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.projects",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.pods",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.services",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.images",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.routes",
:url => "navigation"}

.row.row-tile-pf
.col-xs-6.col-sm-6.col-md-6
%div{"head-title" => _("Aggregated Node Utilization"),
:hidetopborder => "true",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!utilizationLoadingDone"}
.row{"ng-if" => "utilizationLoadingDone"}

.col-xs-6.col-sm-6.col-md-6
%div{"ng-if" => "cpuUsageData"}
%div{"chart-data" => "cpuUsageData",
:config => "cpuUsageConfig",
"donut-config" => "cpuUsageDonutConfig",
"pf-utilization-chart" => "",
"sparkline-config" => "cpuUsageSparklineConfig"}
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !cpuUsageData }"}
= _("Last 30 Days")

.col-xs-6.col-sm-6.col-md-6
%div{"ng-if" => "memoryUsageData"}
%div{"chart-data" => "memoryUsageData",
:config => "memoryUsageConfig",
"donut-config" => "memoryUsageDonutConfig",
"pf-utilization-chart" => "",
"sparkline-config" => "memoryUsageSparklineConfig"}
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !memoryUsageData }"}
= _("Last 30 Days")

.col-xs-6.col-sm-6.col-md-6
%div{"column-sizing-class" => "col-xs-8 col-sm-6 col-md-6",
"heat-map-usage-legend-labels" => "nodeHeatMapUsageLegendLabels",
"heatmap-chart-height" => "dashboardHeatmapChartHeight",
:heatmaps => "heatmaps",
"heatmaps-card" => "",
:hidetopborder => "true",
:title => _("Node Utilization")}

.row.row-tile-pf.row-tile-pf-last
.col-md-6
%div{"head-title" => "{{networkUtilizationHourlyConfig.headTitle}}",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!networkUtilizationLoadingDone"}
%div{"chart-data" => "hourlyNetworkUtilization",
"chart-height" => "chartHeight",
:config => "networkUtilizationHourlyConfig",
"ng-if" => "networkUtilizationLoadingDone",
"pf-trends-chart" => ""}

.col-md-6
%div{"head-title" => "{{networkUtilizationDailyConfig.headTitle}}",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!networkUtilizationLoadingDone"}
%div{"chart-data" => "dailyNetworkUtilization",
"chart-height" => "chartHeight",
:config => "networkUtilizationDailyConfig",
"ng-if" => "networkUtilizationLoadingDone",
"pf-trends-chart" => ""}
= render :partial => "shared/views/show_containers_dashboard"
125 changes: 125 additions & 0 deletions app/views/shared/views/_show_containers_dashboard.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
.container-fluid.container-tiles-pf.containers-dashboard.miq-dashboard-view{"ng-app" => "containerDashboard",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.containers-dashboard in show.html.haml but .single-provider-containers-dashboard in _show_dashboard.html.haml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.containers-dashboard in show.html.haml but .single-provider-containers-dashboard in _show_dashboard.html.haml

Right. Thats hard to fix without #6981. We will know what to do when we will have those images\icons.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's right.. can you (or @abonas ?) reply to Eric there? I'm almost sure we do want font icons but maybe I'm wrong?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way, an alternative would be to make the shared partial only from line 9 on ..but yeah, that has its own problems :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's right.. can you (or @abonas ?) reply to Eric there? I'm almost sure we do want font icons but maybe I'm wrong?

I dont think thats up to us :\

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure @epwinchell was asking about the actual practical limitations..

"ng-controller" => "containerDashboardController as dashboard"}
.row.row-tile-pf
.col-xs-6.col-sm-4.col-md-2
.col-xs-12.provider-card{"pf-card" => "",
"show-top-border" => "true",
"ng-if" => "providerTypeIconClass"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we could make the if a bit more specific? This will pretend to be the other thing whenever iconClassForProvider encounters an unknown provider type...

But maybe that's for a separate PR (or not :)) because looking at the code, iconClassForProvider seems to use a global variable, and the $location based logic in refresh() probably warrants a separate function .. I'm thinking let's make it really explicit and just make refresh call that (new) funciton and set $scope.isSingleProvider (or something like that, not quite sure about the right name now.)

%span.provider-icon-large{"ng-class" => "providerTypeIconClass"}
%div{:layout => "tall",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.providers",
"ng-if" => "!providerTypeIconClass"}

.col-xs-12.col-sm-12.col-md-10
.row
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.nodes",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.containers",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.registries",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.projects",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.pods",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.services",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.images",
:url => "navigation"}
.col-xs-6.col-sm-6.col-md-3
%div{:layout => "mini",
"pf-aggregate-status-card" => "",
"show-top-border" => "true",
:status => "objectStatus.routes",
:url => "navigation"}

.row.row-tile-pf
.col-xs-6.col-sm-6.col-md-6
%div{"head-title" => _("Aggregated Node Utilization"),
:hidetopborder => "true",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!utilizationLoadingDone"}
.row{"ng-if" => "utilizationLoadingDone"}

.col-xs-6.col-sm-6.col-md-6
%div{"ng-if" => "cpuUsageData"}
%div{"chart-data" => "cpuUsageData",
:config => "cpuUsageConfig",
"donut-config" => "cpuUsageDonutConfig",
"pf-utilization-trend-chart" => "",
"sparkline-config" => "cpuUsageSparklineConfig"}
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !cpuUsageData }"}
= _("Last 30 Days")

.col-xs-6.col-sm-6.col-md-6
%div{"ng-if" => "memoryUsageData"}
%div{"chart-data" => "memoryUsageData",
:config => "memoryUsageConfig",
"donut-config" => "memoryUsageDonutConfig",
"pf-utilization-trend-chart" => "",
"sparkline-config" => "memoryUsageSparklineConfig"}
%span.trend-footer-pf{"ng-class" => "{ 'chart-transparent-text': !memoryUsageData }"}
= _("Last 30 Days")

.col-xs-6.col-sm-6.col-md-6
%div{"column-sizing-class" => "col-xs-8 col-sm-6 col-md-6",
"heat-map-usage-legend-labels" => "nodeHeatMapUsageLegendLabels",
"heatmap-chart-height" => "dashboardHeatmapChartHeight",
:heatmaps => "heatmaps",
"heatmaps-card" => "",
:hidetopborder => "true",
:title => _("Node Utilization")}

.row.row-tile-pf.row-tile-pf-last
.col-md-6
%div{"head-title" => "{{networkUtilizationHourlyConfig.headTitle}}",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!networkUtilizationLoadingDone"}
%div{"chart-data" => "hourlyNetworkUtilization",
"chart-height" => "chartHeight",
:config => "networkUtilizationHourlyConfig",
"ng-if" => "networkUtilizationLoadingDone",
"pf-trends-chart" => ""}

.col-md-6
%div{"head-title" => "{{networkUtilizationDailyConfig.headTitle}}",
"pf-card" => ""}

.spinner.spinner-lg.loading{"ng-if" => "!networkUtilizationLoadingDone"}
%div{"chart-data" => "dailyNetworkUtilization",
"chart-height" => "chartHeight",
:config => "networkUtilizationDailyConfig",
"ng-if" => "networkUtilizationLoadingDone",
"pf-trends-chart" => ""}