Skip to content

Commit

Permalink
Support a title parameter when creating a widget, have container deta…
Browse files Browse the repository at this point in the history
…il widget set the title of it's widget
  • Loading branch information
gashcrumb committed Sep 20, 2013
1 parent becbb8f commit e0e544d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions hawtio-web/src/main/webapp/app/dashboard/js/editDashboards.ts
Expand Up @@ -195,6 +195,10 @@ module Dashboard {
hash: ""
};

if ($scope.widgetTitle) {
widget.title = $scope.widgetTitle;
}

// figure out the width of the dash
var gridWidth = 0;

Expand Down Expand Up @@ -337,6 +341,11 @@ module Dashboard {
var size = decodeURIComponent(size);
$scope.preferredSize = angular.fromJson(size);
}
var title = $routeParams["title"];
if (title) {
var title = decodeURIComponent(title);
$scope.widgetTitle = title;
}
// TODO can we avoid reloading these on startup from the navbar.ts as well?
dashboardRepository.getDashboards(dashboardLoaded);

Expand Down
2 changes: 2 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/html/container.html
Expand Up @@ -204,7 +204,9 @@ <h2><i ng-class="statusIcon()"></i>Container: {{row.id}}</h2>
<div class="controller-section-widget">
<div class="row-fluid container-dashboard-controls">
<div class="pull-left">
<!--
<a ng-href="#/fabric/container/{{containerId}}">{{row.id}}</a>
-->
</div>
<div class="pull-right">
<button class="btn" ng-show="row.jolokiaUrl" title="Connect" ng-click="doConnect(container)"><i class="icon-signin"></i></button>
Expand Down
3 changes: 2 additions & 1 deletion hawtio-web/src/main/webapp/app/fabric/js/container.ts
Expand Up @@ -22,7 +22,8 @@ module Fabric {
$scope.addToDashboardLink = () => {
var href = "#/fabric/container/:containerId";
var routeParams = angular.toJson($routeParams);
return "#/dashboard/add?tab=dashboard&href=" + encodeURIComponent(href) + "&routeParams=" + encodeURIComponent(routeParams);
var title = $scope.containerId;
return "#/dashboard/add?tab=dashboard&href=" + encodeURIComponent(href) + "&routeParams=" + encodeURIComponent(routeParams) + "&title=" + encodeURIComponent(title);
};

$scope.selectedProfiles = [];
Expand Down

0 comments on commit e0e544d

Please sign in to comment.