Skip to content

Commit

Permalink
add a checkbox so we can network a broker with all of the other broke…
Browse files Browse the repository at this point in the history
…r groups easily with a single click - hawt! :)
  • Loading branch information
jstrachan committed Oct 11, 2013
1 parent 7d3dde5 commit d6bbb90
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions hawtio-web/src/main/webapp/app/fabric/js/createBroker.ts
Expand Up @@ -9,6 +9,9 @@ module Fabric {
$scope.profiles = [];
$scope.parentProfiles = [];
$scope.entity = {};
$scope.otherEntity = {
networkConnectAll: false
};
$scope.defaultGroup = "default";
$scope.defaultBrokerName = "brokerName";

Expand Down Expand Up @@ -37,6 +40,11 @@ module Fabric {
}

$scope.$watch("entity.group", updatePossibleNetworks);
$scope.$watch("otherEntity.networkConnectAll", () => {
if ($scope.otherEntity.networkConnectAll) {
$scope.entity.networks = $scope.possibleNetworks;
}
});


// default parameters from the URL
Expand Down Expand Up @@ -96,11 +104,19 @@ module Fabric {
Core.pathSet(schema.properties, ['minimumInstances', 'input-attributes', "placeholder"], "{{" + isStandalone + " ? 1 : 2}}");

Core.pathSet(schema.properties, ['networksPassword', 'type'], 'password');
Core.pathSet(schema.properties, ['networks', 'items', 'input-attributes', 'typeahead'], 'title for title in possibleNetworks | filter:$viewValue');
Core.pathSet(schema.properties, ['networks', 'items', 'input-attributes', 'typeahead-editable'], 'true');
Core.pathSet(schema.properties, ['networks', 'items', 'input-attributes', 'typeahead-editable'], 'true');
Core.pathSet(schema.properties, ['networks', 'input-attributes', "ng-hide"], "otherEntity.networkConnectAll");
Core.pathSet(schema.properties, ['networks', 'tooltip'], 'The broker groups to create a store and forward network to');

// add an extra property to make it easy to connect to all / none
Core.pathSet(schema.properties, ['networkConnectAll', 'type'], 'boolean');
Core.pathSet(schema.properties, ['networkConnectAll', 'input-attributes', 'ng-model'], "otherEntity.networkConnectAll");
Core.pathSet(schema.properties, ['networkConnectAll', 'label'], 'Network to all groups');
Core.pathSet(schema.properties, ['networkConnectAll', 'tooltip'], 'Should this broker create a store and forward network to all the known groups of brokers');

schema['tabs'] = {
'Default': ['group', 'brokerName', 'kind', 'profile', 'parentProfile', 'data', 'configUrl', 'replicas', 'minimumInstances', 'networks'],
'Default': ['group', 'brokerName', 'kind', 'profile', 'parentProfile', 'data', 'configUrl', 'replicas', 'minimumInstances', 'networkConnectAll', 'networks'],
'Advanced': ['networksUserName', 'networksPassword', '*']
};
}
Expand Down
4 changes: 2 additions & 2 deletions hawtio-web/src/main/webapp/app/forms/js/mappingRegistry.ts
Expand Up @@ -42,15 +42,15 @@ module Forms {
// Note if for whatever reason we need to go back to the old way of using hawtio directives for standard
// angularjs directives, just clear inputMarker to null here ;)
// inputMarkup = null;

id
if (inputMarkup) {
input = $(inputMarkup);

copyAttributes();

var id = safeId;

var modelName = config.model;
var modelName = config.model || Core.pathGet(property, ["input-attributes", "ng-model"]);
if (!modelName) {
modelName = config.getEntity() + "." + id;
}
Expand Down

0 comments on commit d6bbb90

Please sign in to comment.