Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
First cut of fabric:create UI for #329
- Loading branch information
Showing
7 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
hawtio-web/src/main/webapp/app/fabric/html/createFabric.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div ng-controller="Fabric.CreateFabricController"> | ||
|
||
|
||
<div class="row-fluid"> | ||
|
||
<div class="span5"> | ||
<div simple-form name='create_fabric' data='schema' entity='entity'></div> | ||
</div> | ||
|
||
<div class="span5"> | ||
<h2>No Fabric Detected!</h2> | ||
<p>It appears that fabric has not yet been initialized. Please configure your fabric and click the "Create" button to continue</p> | ||
<p class="centered"><button class="btn btn-success" hawtio-submit="create_fabric"><i class="icon-ok" ng-disabled="!forms.create_fabric.$valid"></i> Create Fabric</button></p> | ||
</div> | ||
|
||
</div> | ||
|
||
|
||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module Fabric { | ||
|
||
export function CreateFabricController($scope, jolokia, $location) { | ||
|
||
Fabric.schemaConfigure(); | ||
|
||
$scope.schema = (<any>window).org_fusesource_fabric_api_CreateEnsembleOptions; | ||
|
||
$scope.entity = { | ||
zooKeeperServerPort: 2181, | ||
globalResolver: 'localhostname', | ||
resolver: 'localhostname', | ||
agentEnabled: true, | ||
autoImportEnabled: true, | ||
minimumPort: 0, | ||
maximumPort: 65535, | ||
profiles: ['fabric', 'hawtio'] | ||
}; | ||
|
||
$scope.forms = {}; | ||
|
||
$scope.onSubmit = (json, form) => { | ||
|
||
jolokia.execute(Fabric.clusterManagerMBean, 'createCluster(java.util.List, java.util.Map)', null, angular.toJson(json), { | ||
method: 'post', | ||
success: (response) => { | ||
notification('success', "Created fabric!"); | ||
$location.url("/fabric/overview"); | ||
Core.$apply($scope); | ||
}, | ||
error: (response) => { | ||
notification('error', "Error creating fabric: " + response.error); | ||
Core.$apply($scope); | ||
} | ||
}); | ||
} | ||
|
||
|
||
console.log("window: ", (<any>window).org_fusesource_fabric_api_CreateEnsembleOptions); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters