This closes #157
diff --git a/pom.xml b/pom.xml
index fd202a4..525199c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,8 +25,7 @@
<groupId>org.apache.brooklyn</groupId>
<artifactId>brooklyn-parent</artifactId>
<version>1.0.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
- <!-- do not link to sibling directory as that breaks builds where this code is embedded, e.g. for branding;
- we require that brooklyn-server is built first (this is needed anyway for the modularity java code) -->
+ <relativePath>${brooklyn.ui.relativePath.to.brooklyn.server.parent}</relativePath>
</parent>
<groupId>org.apache.brooklyn.ui</groupId>
@@ -85,6 +84,8 @@
<brooklyn.version>1.0.0-SNAPSHOT</brooklyn.version><!-- BROOKLYN_VERSION -->
<build.version>${revision}</build.version>
<build.name>Apache Brooklyn</build.name>
+ <brooklyn.ui.relativePath.to.brooklyn.server.parent>../brooklyn-server/parent/</brooklyn.ui.relativePath.to.brooklyn.server.parent>
+
<buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
<!-- versions from brooklyn server which have a different var name here -->
@@ -98,7 +99,7 @@
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
<maven-war-plugin.version>3.0.0</maven-war-plugin.version>
- <frontend-maven-plugin.version>1.3</frontend-maven-plugin.version>
+ <frontend-maven-plugin.version>1.8.0</frontend-maven-plugin.version>
<pax-web.version>7.2.3</pax-web.version>
<pax-web-extender-whiteboard.version>${pax-web.version}</pax-web-extender-whiteboard.version>
diff --git a/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js b/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js
index 76183e7..f6d3426 100644
--- a/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js
+++ b/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js
@@ -43,11 +43,14 @@
return {
restrict: 'E',
template: entityTreeTemplate,
- controller: ['$scope', '$state', 'applicationApi', 'iconService', 'brWebNotifications', controller],
+ scope: {
+ sortReverse: '=',
+ },
+ controller: ['$scope', '$state', 'applicationApi', 'entityApi', 'iconService', 'brWebNotifications', controller],
controllerAs: 'vm'
};
- function controller($scope, $state, applicationApi, iconService, brWebNotifications) {
+ function controller($scope, $state, applicationApi, entityApi, iconService, brWebNotifications) {
$scope.$emit(HIDE_INTERSTITIAL_SPINNER_EVENT);
let vm = this;
diff --git a/ui-modules/app-inspector/app/components/entity-tree/entity-tree.html b/ui-modules/app-inspector/app/components/entity-tree/entity-tree.html
index a6c1a01..67c0ce1 100644
--- a/ui-modules/app-inspector/app/components/entity-tree/entity-tree.html
+++ b/ui-modules/app-inspector/app/components/entity-tree/entity-tree.html
@@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
-->
-<entity-node ng-repeat="application in vm.applications track by application.id" entity="application" application-id="application.id"></entity-node>
+<entity-node ng-repeat="application in vm.applications | orderBy: sortReverse? '-creationTimeUtc': 'creationTimeUtc' track by application.id" entity="application" application-id="application.id"></entity-node>
<p class="expand-tree-message text-center" ng-if="vm.applications.length > 0"><small><kbd>shift</kbd> + <kbd>{{navigator.appVersion.indexOf("Mac") !== -1 ? '⌘' : '⊞'}}</kbd> + click to expand all children</small></p>
<div class="empty-tree text-muted text-center" ng-if="vm.applications.length === 0">
<hr />
diff --git a/ui-modules/app-inspector/app/views/main/main.controller.js b/ui-modules/app-inspector/app/views/main/main.controller.js
index 07280f8..c691a10 100644
--- a/ui-modules/app-inspector/app/views/main/main.controller.js
+++ b/ui-modules/app-inspector/app/views/main/main.controller.js
@@ -27,11 +27,16 @@
controllerAs: 'ctrl'
};
+const savedSortReverse = 'app-inspector-sort-reverse';
+
export function mainController($scope, $q, brWebNotifications) {
$scope.$emit(HIDE_INTERSTITIAL_SPINNER_EVENT);
let ctrl = this;
+ ctrl.sortReverse = localStorage && localStorage.getItem(savedSortReverse) !== null ?
+ JSON.parse(localStorage.getItem(savedSortReverse)) :
+ true;
brWebNotifications.supported.then(() => {
ctrl.isNotificationsSupported = true;
}).catch(() => {
@@ -48,6 +53,17 @@
ctrl.isNotificationsBlocked = permission === 'denied';
});
+ ctrl.toggleSortOrder = () => {
+ ctrl.sortReverse = !ctrl.sortReverse;
+ if (localStorage) {
+ try {
+ localStorage.setItem(savedSortReverse, JSON.stringify(ctrl.sortReverse));
+ } catch (ex) {
+ $log.error('Cannot save app sort preferences: ' + ex.message);
+ }
+ }
+ }
+
ctrl.toggleNotifications = () => {
brWebNotifications.isEnabled().then(() => {
return brWebNotifications.setEnable(false);
diff --git a/ui-modules/app-inspector/app/views/main/main.less b/ui-modules/app-inspector/app/views/main/main.less
index d14fed7..527554f 100644
--- a/ui-modules/app-inspector/app/views/main/main.less
+++ b/ui-modules/app-inspector/app/views/main/main.less
@@ -20,11 +20,9 @@
.entity-tree-header {
display: flex;
+ justify-content: space-between;
- .entity-tree-title {
- flex-grow: 1;
- }
- .entity-tree-action {
+ .entity-tree-title, .entity-tree-sort-action, .entity-tree-action {
flex-shrink: 1;
vertical-align: middle;
margin-left: 0.5em;
diff --git a/ui-modules/app-inspector/app/views/main/main.template.html b/ui-modules/app-inspector/app/views/main/main.template.html
index 0911647..c7a90cd 100644
--- a/ui-modules/app-inspector/app/views/main/main.template.html
+++ b/ui-modules/app-inspector/app/views/main/main.template.html
@@ -22,29 +22,36 @@
<br-card>
<br-card-content class="entity-tree">
<div class="entity-tree-header">
- <h2 class="entity-tree-title">Applications</h2>
-
- <button class="btn btn-link entity-tree-action"
+ <div class="entity-tree-header-section">
+ <h2 class="entity-tree-title">Applications</h2>
+ <button class="btn btn-sm btn-default entity-tree-sort-action" ng-click="ctrl.toggleSortOrder($event)">
+ <div>
+ <span class="glyphicon" ng-class="ctrl.sortReverse ? 'fa fa-sort-amount-desc' : 'fa fa-sort-amount-asc'"></span>
+ </div>
+ </button>
+ </div>
+ <div class="entity-tree-header-section">
+ <button class="btn btn-link entity-tree-action"
ng-class="{'btn-sm': !ctrl.isNotificationsBlocked, 'btn-xs': ctrl.isNotificationsBlocked}"
ng-if="ctrl.isNotificationsSupported"
ng-disabled="ctrl.isNotificationsBlocked"
ng-click="ctrl.toggleNotifications()">
- <i class="fa fa-bell notifications" ng-if="!ctrl.isNotificationsBlocked"
- ng-class="{'active': ctrl.isNotificationsEnabled}"></i>
- <span class="fa-stack" ng-if="ctrl.isNotificationsBlocked"
- uib-tooltip="Notifications are currently blocked. You can allow them in your browser settings"
- tooltip-placement="left">
- <i class="fa fa-bell fa-stack-1x"></i>
- <i class="fa fa-ban fa-stack-2x text-danger"></i>
- </span>
- </button>
-
- <a href="/brooklyn-ui-blueprint-composer" class="btn btn-sm btn-default entity-tree-action">
- <i class="fa fa-plus"></i>
- </a>
+ <i class="fa fa-bell notifications" ng-if="!ctrl.isNotificationsBlocked"
+ ng-class="{'active': ctrl.isNotificationsEnabled}"></i>
+ <span class="fa-stack" ng-if="ctrl.isNotificationsBlocked"
+ uib-tooltip="Notifications are currently blocked. You can allow them in your browser settings"
+ tooltip-placement="left">
+ <i class="fa fa-bell fa-stack-1x"></i>
+ <i class="fa fa-ban fa-stack-2x text-danger"></i>
+ </span>
+ </button>
+ <a href="/brooklyn-ui-blueprint-composer" class="btn btn-sm btn-default entity-tree-action">
+ <i class="fa fa-plus"></i>
+ </a>
+ </div>
</div>
- <entity-tree></entity-tree>
+ <entity-tree sort-reverse="ctrl.sortReverse"></entity-tree>
</br-card-content>
</br-card>
diff --git a/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js b/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js
index 996a156..9309e50 100644
--- a/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js
+++ b/ui-modules/location-manager/app/views/wizard/cloud/cloud.controller.js
@@ -71,6 +71,11 @@
return disabled.indexOf(vm.provider) > -1;
};
+ vm.isEndpointRequired = function () {
+ let required = ['jclouds:azurecompute-arm'];
+ return required.indexOf(vm.provider) > -1;
+ }
+
vm.save = function () {
let config = angular.copy(vm.config);
if (vm.region) {
diff --git a/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html b/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html
index 418e2fb..7d22072 100644
--- a/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html
+++ b/ui-modules/location-manager/app/views/wizard/cloud/cloud.template.html
@@ -67,7 +67,10 @@
<div class="form-group" ng-class="{'has-error': form.endpoint.$invalid && form.endpoint.$touched}">
<label class="control-label" for="endpoint">Cloud endpoint</label>
- <input ng-model="vm.endpoint" type="text" class="form-control" id="endpoint" name="endpoint" ng-disabled="vm.isEndpointDisabled()" placeholder="If using a private cloud, the URL to connect to it is required">
+ <input ng-model="vm.endpoint" type="text" class="form-control" id="endpoint" name="endpoint" ng-required="vm.isEndpointRequired()" ng-disabled="vm.isEndpointDisabled()" placeholder="If using a private cloud, the URL to connect to it is required">
+ <p class="help-block" ng-show="form.$submitted || form.endpoint.$touched">
+ <span ng-show="form.endpoint.$error.required">You must specify an endpoint with this provider</span>
+ </p>
</div>
<div class="form-group" ng-class="{'has-error': form.identity.$invalid && form.identity.$touched}">