You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2018/07/27 10:03:49 UTC
[24/53] [partial] brooklyn-ui git commit: Update Brooklyn codebase to
build the newly donated UI
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/on-enter/index.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/on-enter/index.js b/new/ui-modules/utils/on-enter/index.js
deleted file mode 100644
index d146af9..0000000
--- a/new/ui-modules/utils/on-enter/index.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import angular from 'angular';
-
-const MODULE_NAME = 'br.utils.on-enter';
-
-angular.module(MODULE_NAME, [])
- .directive('onEnter', ['$timeout', onEnterDirective]);
-
-export default MODULE_NAME;
-
-export function onEnterDirective() {
- return {
- restrict: 'A',
- scope: {
- onEnter: '=',
- },
- link: link
- };
-
- function link(scope, element, attrs) {
- element.bind("keydown keypress", event => {
- if (event.which === 13 && !event.ctrlKey && !event.metaKey) {
- scope.onEnter(element, event);
- }
- });
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/package.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/package.json b/new/ui-modules/utils/package.json
deleted file mode 100644
index a6c65ec..0000000
--- a/new/ui-modules/utils/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "__license__": [
- "Licensed to the Apache Software Foundation (ASF) under one",
- "or more contributor license agreements. See the NOTICE file",
- "distributed with this work for additional information",
- "regarding copyright ownership. The ASF licenses this file",
- "to you under the Apache License, Version 2.0 (the",
- "\"License\"); you may not use this file except in compliance",
- "with the License. You may obtain a copy of the License at",
- " http://www.apache.org/licenses/LICENSE-2.0",
- "Unless required by applicable law or agreed to in writing,",
- "software distributed under the License is distributed on an",
- "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
- "KIND, either express or implied. See the License for the",
- "specific language governing permissions and limitations",
- "under the License."
- ],
- "name": "brooklyn-ui-utils",
- "versionBuildNote": "BROOKLYN_VERSION_BELOW this exists so scripts update this automatically",
- "version": "1.0.0-SNAPSHOT",
- "description": "Brooklyn UI :: Modules - UI Utils",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/apache/brooklyn-ui.git"
- },
- "author": "Apache Software Foundation",
- "license": "Apache-2.0",
- "scripts": {
- "test": "karma start ./karma.config.js"
- },
- "engines": {
- "node": ">=8.0.0",
- "npm": ">=5.0.0"
- },
- "dependencies": {
- "angular": "^1.6.1",
- "angular-animate": "^1.6.1",
- "angular-multiple-transclusion": "^1.0.0",
- "angular-ui-bootstrap": "^2.5.0",
- "bootstrap": "^3.3.7",
- "codemirror": "^5.27.2",
- "identicon.js": "^1.2.1",
- "js-yaml": "^3.6.1",
- "jsonschema": "^1.1.1",
- "jssha": "^2.2.0",
- "lodash": "^4.15.0",
- "rxjs": "^5.0.0-beta.11"
- },
- "devDependencies": {
- "angular-mocks": "^1.6.1",
- "babel-core": "^6.13.2",
- "babel-loader": "^6.2.4",
- "babel-polyfill": "^6.20.0",
- "babel-preset-env": "^1.6.0",
- "babel-preset-stage-0": "^6.16.0",
- "html-loader": "^0.4.3",
- "jasmine-ajax": "^3.3.1",
- "jasmine-core": "^2.4.1",
- "karma": "^1.1.2",
- "karma-jasmine": "^1.0.2",
- "karma-phantomjs-launcher": "^1.0.1",
- "karma-sourcemap-loader": "^0.3.7",
- "karma-webpack": "^1.8.0",
- "phantomjs-prebuilt": "^2.1.11",
- "webpack": "^1.13.1"
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/pom.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/pom.xml b/new/ui-modules/utils/pom.xml
deleted file mode 100644
index bf5fa6d..0000000
--- a/new/ui-modules/utils/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>brooklyn-ui-modules-parent</artifactId>
- <groupId>org.apache.brooklyn.ui.modules</groupId>
- <version>${revision}</version>
- </parent>
-
- <artifactId>brooklyn-ui-utils</artifactId>
- <packaging>pom</packaging>
- <name>Brooklyn UI :: Modules - UI Utils</name>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>dist</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.github.eirslett</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>npm build</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/api-observer-interceptor.provider.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/api-observer-interceptor.provider.js b/new/ui-modules/utils/providers/api-observer-interceptor.provider.js
deleted file mode 100644
index 2720b66..0000000
--- a/new/ui-modules/utils/providers/api-observer-interceptor.provider.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {Observable} from "rxjs/Observable";
-import "rxjs/add/observable/interval";
-import "rxjs/add/operator/exhaust";
-import "rxjs/add/operator/mapTo";
-import "rxjs/add/operator/share";
-
-const OBSERVER_CACHE = new Map();
-const OBSERVABLE = 'observable';
-
-export function apiObserverInterceptorProvider() {
- let interval = 10000;
- let clock = Observable.interval(10000);
-
- return {
- interval: (value)=> {
- interval = value;
- clock = Observable.interval(interval);
- },
- $get: ['$injector', '$q', ($injector, $q)=> {
- return {
- response: (response)=> {
- doDriveBy(response);
- return response;
- },
- responseError: (rejection)=> {
- doDriveBy(rejection, true);
- return $q.reject(rejection);
- }
- };
-
- function doDriveBy(response, error = false) {
- if (response.config.hasOwnProperty(OBSERVABLE) && response.config[OBSERVABLE]) {
- response.subscribe = (next, error, complete)=> {
- if (!OBSERVER_CACHE.has(response.config.url)) {
- OBSERVER_CACHE.set(response.config.url, clock.mapTo(coldObservableFactory(response.config)).exhaust().share());
- }
- return OBSERVER_CACHE.get(response.config.url).subscribe(next, error, complete);
- }
- }
- }
-
- function coldObservableFactory(httpConfig) {
- return Observable.create((observer)=> {
- let $http = $injector.get('$http');
- $http(Object.assign(httpConfig, {observable: false, cache: null}))
- .then((response)=> {
- observer.next(response);
- observer.complete();
- }, (error)=> {
- observer.error(error);
- observer.complete();
- });
- });
- }
- }]
- };
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/api-observer-interceptor.provider.spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/api-observer-interceptor.provider.spec.js b/new/ui-modules/utils/providers/api-observer-interceptor.provider.spec.js
deleted file mode 100644
index 6a0efe0..0000000
--- a/new/ui-modules/utils/providers/api-observer-interceptor.provider.spec.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {apiObserverInterceptorProvider} from "./api-observer-interceptor.provider";
-
-describe('API Observer', ()=> {
- var $httpBackend, $rootScope, $http, apihandler;
- beforeEach(()=> {
- angular.module('app', [])
- .provider('apiObserverInterceptor', apiObserverInterceptorProvider)
- .config(['$httpProvider', 'apiObserverInterceptorProvider', ($httpProvider, apiObserverInterceptorProvider)=> {
- $httpProvider.interceptors.push('apiObserverInterceptor');
- apiObserverInterceptorProvider.interval(200);
- }]);
- angular.mock.module('app');
- });
- beforeEach(angular.mock.inject((_$httpBackend_, _$rootScope_, _$http_)=> {
- $rootScope = _$rootScope_;
- $httpBackend = _$httpBackend_;
- $http = _$http_;
- }));
-
- it('should attach observable to API response that has the observable flag set', (done)=> {
- var expectedResponse = {value: Math.random().toString(36).slice(2)};
- $httpBackend.expect('GET', '/test').respond(expectedResponse);
- $http({
- method: 'GET',
- observable: true,
- url: '/test'
- }).then((response)=> {
- expect(response.data).not.toBeNull();
- expect(response.data.value).toBe(expectedResponse.value);
- expect(response.subscribe).toBeDefined();
- expect(typeof response.subscribe).toEqual('function');
- response.subscribe((x)=> {
- expect(x.data).toBeDefined();
- expect(x.data.value).toBe(expectedResponse.value);
- expect(x.data.subscribe).not.toBeDefined();
- done();
- });
- });
- $httpBackend.flush();
- $httpBackend.expect('GET', '/test').respond(expectedResponse);
- setTimeout(()=> {
- $httpBackend.flush();
- $httpBackend.verifyNoOutstandingRequest();
- }, 250)
- });
-
- it('should NOT attach observable to API response that doesn\'t have observable flag set', (done)=> {
- var expectedResponse = {value: Math.random().toString(36).slice(2)};
- $httpBackend.expect('GET', '/test').respond(expectedResponse);
- $http({
- method: 'GET',
- url: '/test'
- }).then((response)=> {
- expect(response.data).not.toBeNull();
- expect(response.data.value).toBe(expectedResponse.value);
- expect(response.hasOwnProperty('subscribe')).toBeFalsy();
- done();
- });
- $httpBackend.flush();
- $httpBackend.verifyNoOutstandingRequest();
- });
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/api.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/api.js b/new/ui-modules/utils/providers/api.js
deleted file mode 100644
index 00d8463..0000000
--- a/new/ui-modules/utils/providers/api.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export class Api {
- constructor(cache, host) {
- this.cache = cache;
- this.host = host;
- }
-
- invalidateCache() {
- if (this.cache !== null) {
- cache.removeAll();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/application-api.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/application-api.js b/new/ui-modules/utils/providers/application-api.js
deleted file mode 100644
index 5f45881..0000000
--- a/new/ui-modules/utils/providers/application-api.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {Api} from './api';
-
-export class ApplicationApi extends Api {
- constructor(cache, host) {
- super(cache, host);
- }
-
- createApplication(applicationSpec) {
- // no-op
- return Promise.resolve();
- }
-
- getApplication(id, clearCache) {
- // no-op
- return Promise.resolve();
- }
-
- getEntity(applicationId, entityId, clearCache) {
- // no-op
- return Promise.resolve();
- }
-
- getApplicationTree(id, clearCache) {
- // no-op
- return Promise.resolve();
- }
-
- getChildEntities(applicationId, entityId, clearCache) {
- // no-op
- return Promise.resolve();
- }
-
- getLink(link, clearCache) {
- // no-op
- return Promise.resolve();
- }
-}
-
-window.ApplicationApi = ApplicationApi;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/application-api.provider.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/application-api.provider.js b/new/ui-modules/utils/providers/application-api.provider.js
deleted file mode 100644
index 01b46bf..0000000
--- a/new/ui-modules/utils/providers/application-api.provider.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {ErrorHandler, SuccessHandler} from './handlers'
-import {ApplicationApi} from './application-api';
-
-export function applicationApiProvider() {
- let cacheName = '$http';
- let host = '';
- let implementation = ApplicationApiProvider;
-
- return {
- cacheName: function (value) {
- cacheName = value;
- },
- host: function (value) {
- host = value;
- },
- implementation: function (impl) {
- if (!(impl.prototype === ApplicationApi.prototype)) {
- throw new Error(`Expected an implementation extending ${ApplicationApi} but got ${impl}`);
- }
- implementation = impl;
- },
- $get: ['$http', '$q', '$cacheFactory', function ($http, $q, $cacheFactory) {
- let cache = $cacheFactory.get(cacheName) || $cacheFactory(cacheName);
- return new implementation($http, $q, cache, host);
- }]
- };
-}
-
-class ApplicationApiProvider extends ApplicationApi {
- constructor($http, $q, cache, host) {
- super(cache, host);
- this.$http = $http;
- this.$q = $q;
- }
-
- createApplication(applicationSpec) {
- let deferred = this.$q.defer();
- this.$http({
- method: 'POST',
- url: `${this.host}/v1/applications`,
- data: applicationSpec,
- headers: {
- 'Content-Type': 'application/yaml'
- }
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
-
- getApplication(id, clearCache) {
- let url = `${this.host}/v1/applications/${id}`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getEntity(applicationId, entityId, clearCache) {
- let url = `${this.host}/v1/applications/${applicationId}/entities/${entityId}`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getApplicationTree(id, clearCache) {
- if (clearCache) {
- this.cache.remove('/v1/applications/fetch?items=' + id);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: `${this.host}/v1/applications/fetch`,
- params: {
- items: id
- }
- }).then(function (response) {
- deferred.resolve(response.data[0]);
- }).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getChildEntities(applicationId, entityId, clearCache) {
- let url = `${this.host}/v1/applications/${applicationId}/entities/${entityId}/children`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getLink(link, clearCache) {
- if (clearCache) {
- this.cache.remove(link);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: link
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/catalog-api.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/catalog-api.js b/new/ui-modules/utils/providers/catalog-api.js
deleted file mode 100644
index 7647228..0000000
--- a/new/ui-modules/utils/providers/catalog-api.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {Api} from './api';
-
-export class CatalogApi extends Api {
- constructor(cache, host) {
- super(cache, host);
- }
-
- create(data, params, opts) {
- // no-op
- return Promise.resolve();
- }
-
- getLocations(params, config) {
- // no-op
- return Promise.resolve();
- }
-
- getLocation(symbolicName, version, config) {
- // no-op
- return Promise.resolve();
- }
-
- deleteLocation(symbolicName, version, config) {
- // no-op
- return Promise.resolve();
- }
-
- getBundles(config) {
- // no-op
- return Promise.resolve();
- }
-
- getBundleVersions(symbolicName, config) {
- // no-op
- return Promise.resolve();
- }
-
- getBundle(symbolicName, version, config) {
- // no-op
- return Promise.resolve();
- }
-
- deleteBundle(symbolicName, version, config) {
- // no-op
- return Promise.resolve();
- }
-
- getTypes(config) {
- // no-op
- return Promise.resolve();
- }
-
- getType(typeSymbolicName, typeVersion, config) {
- // no-op
- return Promise.resolve();
- }
-
- getTypeVersions(typeSymbolicName, config) {
- // no-op
- return Promise.resolve();
- }
-
- getBundleTypes(bundleSymbolicName, bundleVersion, config) {
- // no-op
- return Promise.resolve();
- }
-
- getBundleType(bundleSymbolicName, bundleVersion, typeSymbolicName, typeVersion, config) {
- // no-op
- return Promise.resolve();
- }
-}
-
-window.CatalogApi = CatalogApi;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/catalog-api.provider.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/catalog-api.provider.js b/new/ui-modules/utils/providers/catalog-api.provider.js
deleted file mode 100644
index f223123..0000000
--- a/new/ui-modules/utils/providers/catalog-api.provider.js
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import angular from 'angular';
-import {ErrorHandler, SuccessHandler} from './handlers';
-import {CatalogApi} from './catalog-api';
-
-const MODULE_NAME = 'brooklyn.utils.api.catalog';
-
-angular.module(MODULE_NAME, [])
- .provider('catalogApi', catalogApiProvider);
-
-export default MODULE_NAME;
-
-export function catalogApiProvider() {
- let cacheName = '$http';
- let host = '';
- let implementation = CatalogApiProvider;
-
- return {
- cacheName: function (value) {
- cacheName = value;
- },
- host: function (value) {
- host = value;
- },
- implementation: function (impl) {
- if (!(impl.prototype === CatalogApi.prototype)) {
- throw new Error(`Expected an implementation extending ${CatalogApi} but got ${impl}`);
- }
- implementation = impl;
- },
- $get: ['$http', '$q', '$cacheFactory', function ($http, $q, $cacheFactory) {
- let cache = $cacheFactory.get(cacheName) || $cacheFactory(cacheName);
- return new implementation($http, $q, cache, host);
- }]
- };
-}
-
-class CatalogApiProvider extends CatalogApi {
- constructor($http, $q, cache, host) {
- super(cache, host);
- this.$http = $http;
- this.$q = $q;
- }
-
- create(data, params, opts) {
- let deferred = this.$q.defer();
- this.$http(angular.extend({
- method: 'POST',
- url: `${this.host}/v1/catalog`,
- data: data,
- params: Object.assign({}, params)
- }, opts || {})).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getApplications(term, opts) {
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- url: `${this.host}/v1/catalog/applications`,
- params: Object.assign({
- fragment: term
- }, opts || {}),
- cache: this.cache
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getApplication(applicationId, version) {
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- url: `${this.host}/v1/catalog/applications/${applicationId}/${version ? version : 'latest'}`,
- cache: this.cache
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getLocations(params, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/locations`, angular.extend({cache: this.cache, params: params}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getLocation(symbolicName, version, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/locations/${symbolicName}/${version ? version : 'latest'}`, angular.extend({cache: this.cache}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- deleteLocation(symbolicName, version, config) {
- let deferred = this.$q.defer();
- this.$http.delete(`${this.host}/v1/catalog/locations/${symbolicName}/${version ? version : 'latest'}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getBundles(config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/bundles`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getBundleVersions(symbolicName, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/bundles/${symbolicName}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getBundle(symbolicName, version, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/bundles/${symbolicName}/${version}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- deleteBundle(symbolicName, version, config) {
- let deferred = this.$q.defer();
- this.$http.delete(`${this.host}/v1/catalog/bundles/${symbolicName}/${version}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getTypes(config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/types`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getType(typeSymbolicName, typeVersion, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/types/${typeSymbolicName}/${typeVersion ? typeVersion : 'latest'}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getTypeVersions(typeSymbolicName, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/types/${typeSymbolicName}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getBundleTypes(bundleSymbolicName, bundleVersion, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/bundles/${bundleSymbolicName}/${bundleVersion}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getBundleType(bundleSymbolicName, bundleVersion, typeSymbolicName, typeVersion, config) {
- let deferred = this.$q.defer();
- this.$http.get(`${this.host}/v1/catalog/bundles/${bundleSymbolicName}/${bundleVersion}/types/${typeSymbolicName}/${typeVersion ? typeVersion : 'latest'}`, angular.extend({}, config))
- .then(new SuccessHandler(deferred))
- .catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/handlers.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/handlers.js b/new/ui-modules/utils/providers/handlers.js
deleted file mode 100644
index b70ed7e..0000000
--- a/new/ui-modules/utils/providers/handlers.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-export function SuccessHandler(deferred) {
- return function (response) {
- deferred.resolve(response.data);
- };
-}
-
-export function ErrorHandler(deferred) {
- return function (response) {
- deferred.reject({
- status: response.status,
- error: response.data
- });
- };
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/location-api.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/location-api.js b/new/ui-modules/utils/providers/location-api.js
deleted file mode 100644
index 2430d61..0000000
--- a/new/ui-modules/utils/providers/location-api.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {Api} from './api';
-
-export class LocationApi extends Api {
- constructor(cache, host) {
- super(cache, host);
- }
-
- getLocations() {
- // no-op
- return Promise.resolve();
- }
-
- getLocation(locationId) {
- // no-op
- return Promise.resolve();
- }
-}
-
-window.LocationApi = LocationApi;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/location-api.provider.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/location-api.provider.js b/new/ui-modules/utils/providers/location-api.provider.js
deleted file mode 100644
index a9591af..0000000
--- a/new/ui-modules/utils/providers/location-api.provider.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {ErrorHandler, SuccessHandler} from './handlers'
-import {LocationApi} from './location-api';
-
-export function locationApiProvider() {
- let cacheName = '$http';
- let host = '';
- let implementation = LocationApiProvider;
-
- return {
- cacheName: function (value) {
- cacheName = value;
- },
- host: function (value) {
- host = value;
- },
- implementation: function (impl) {
- if (!(impl.prototype === LocationApi.prototype)) {
- throw new Error(`Expected an implementation extending ${LocationApi} but got ${impl}`);
- }
- implementation = impl;
- },
- $get: ['$http', '$q', '$cacheFactory', function ($http, $q, $cacheFactory) {
- let cache = $cacheFactory.get(cacheName) || $cacheFactory(cacheName);
- return new implementation($http, $q, cache, host);
- }]
- };
-}
-
-class LocationApiProvider extends LocationApi {
- constructor($http, $q, cache, host) {
- super(cache, host);
- this.$http = $http;
- this.$q = $q;
- };
-
- getLocations(clearCache) {
- let url = `${this.host}/v1/locations`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getLocation(locationId, clearCache) {
- let url = `${this.host}/v1/locations/${locationId}?full=true`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/sensor-api.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/sensor-api.js b/new/ui-modules/utils/providers/sensor-api.js
deleted file mode 100644
index 0acb582..0000000
--- a/new/ui-modules/utils/providers/sensor-api.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {Api} from './api';
-
-export class SensorApi extends Api {
- constructor(cache, host) {
- super(cache, host);
- }
-
- getAllSensorsState(appId, entityId, clearCache) {
- // no-op
- return Promise.resolve();
- }
-
- getSensorSpecs(appId, entityId, clearCache) {
- // no-op
- return Promise.resolve();
- }
-}
-
-window.SensorApi = SensorApi;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/providers/sensor-api.provider.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/providers/sensor-api.provider.js b/new/ui-modules/utils/providers/sensor-api.provider.js
deleted file mode 100644
index 4c26b17..0000000
--- a/new/ui-modules/utils/providers/sensor-api.provider.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {ErrorHandler, SuccessHandler} from './handlers'
-import {SensorApi} from './sensor-api';
-
-export function sensorApiProvider() {
- let cacheName = '$http';
- let host = '';
- let implementation = SensorApiProvider;
-
- return {
- cacheName: function (value) {
- cacheName = value;
- },
- host: function (value) {
- host = value;
- },
- implementation: function (impl) {
- if (!(impl.prototype === SensorApi.prototype)) {
- throw new Error(`Expected an implementation extending ${SensorApi} but got ${impl}`);
- }
- implementation = impl;
- },
- $get: ['$http', '$q', '$cacheFactory', function ($http, $q, $cacheFactory) {
- let cache = $cacheFactory.get(cacheName) || $cacheFactory(cacheName);
- return new implementation($http, $q, cache, host);
- }]
- };
-}
-
-class SensorApiProvider extends SensorApi {
- constructor($http, $q, cache, host) {
- super(cache, host);
- this.$http = $http;
- this.$q = $q;
- }
-
- getAllSensorsState(appId, entityId, clearCache) {
- let url = `${this.host}/v1/applications/${appId}/entities/${entityId}/sensors/current-state`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-
- getSensorSpecs(appId, entityId, clearCache) {
- let url = `${this.host}/v1/applications/${appId}/entities/${entityId}/sensors`;
- if (clearCache) {
- this.cache.remove(url);
- }
- let deferred = this.$q.defer();
- this.$http({
- method: 'GET',
- cache: this.cache,
- url: url
- }).then(new SuccessHandler(deferred)).catch(new ErrorHandler(deferred));
- return deferred.promise;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/quick-launch/quick-launch.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/quick-launch/quick-launch.html b/new/ui-modules/utils/quick-launch/quick-launch.html
deleted file mode 100644
index 52b0b13..0000000
--- a/new/ui-modules/utils/quick-launch/quick-launch.html
+++ /dev/null
@@ -1,163 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<h3 class="quick-launch-title">Deploy</h3>
-
-<div uib-alert ng-if="model.deployError" class="alert-danger" close="clearError()">
- <h4>Failed to deploy {{app.name}}</h4>
- <p>{{model.deployError}}</p>
-</div>
-
-<div class="quick-launch-type media">
- <div class="media-left">
- <img ng-src="{{app | iconGeneratorPipe:'symbolicName'}}" class="media-object" alt="{{app.symbolicName}}'s icon" />
- </div>
- <div class="media-body">
- <h4 class="media-heading">{{app.name || app.symbolicName}}</h4>
- <p class="media-subheading">{{app.version || "Latest"}}</p>
- </div>
-</div>
-
-<div ng-show="!yamlViewDisplayed">
- <form name="deploy" novalidate>
- <section class="quick-launch-section quick-launch-name">
- <h3 class="quick-launch-section-title">Name</h3>
- <div class="quick-launch-section-content">
- <div class="form-group">
- <input class="form-control" type="text" ng-model="model.name" ng-disabled="deploying" name="name" placeholder="Choose a name for this application (Optional)" autofocus />
- </div>
- </div>
- </section>
-
- <section class="quick-launch-section quick-launch-location">
- <h3 class="quick-launch-section-title">Location</h3>
- <div class="quick-launch-section-content">
- <div class="form-group" ng-class="{'has-error': deploy.location.$invalid && deploy.location.$touched}">
- <input class="form-control" type="text" ng-model="model.location" ng-disabled="deploying" name="location" placeholder="Select a location where to deploy this application" autocomplete="off"
- uib-typeahead="location.name for location in locations | filter:$viewValue"
- typeahead-popup-template-url="DropdownTemplate.html"
- typeahead-template-url="LocationTemplate.html" typeahead-min-length="0"
- required />
- <small class="help-block">
- <span ng-if="deploy.location.$error.required && (deploy.$submitted || deploy.location.$touched)">You must select a location.</span>
- <span>Alternatively, you can <a href="/brooklyn-ui-location-manager/#!/wizard">create a new location</a></span>
- </small>
- </div>
- </div>
- </section>
-
- <section class="quick-launch-section quick-launch-configuration">
- <h3 class="quick-launch-section-title">Configuration</h3>
- <div class="quick-launch-section-content">
- <div ng-repeat="(key,value) in entityToDeploy['brooklyn.config'] track by key" ng-switch="configMap[key].type">
- <div class="checkbox" ng-class="{'has-error': deploy[key].$invalid && deploy[key].$touched}" ng-switch-when="java.lang.Boolean">
- <label>
- <input type="checkbox" ng-model="entityToDeploy['brooklyn.config'][key]" ng-disabled="deploying" auto-focus="focus === key" />
- {{key}} <i ng-click="deleteConfigField(key)" class="fa fa-trash form-delete"></i>
- </label>
- <small class="help-block" ng-show="deploy.$submitted || deploy[key].$touched">
- <span ng-if="deploy[key].$error.required">You must enter a value</span>
- </small>
- </div>
- <div class="form-group" ng-class="{'has-error': deploy[key].$invalid && deploy[key].$touched}" ng-switch-when="java.lang.Enum">
- <label for="{{key}}">{{key}} <i ng-click="deleteConfigField(key)" class="fa fa-trash form-delete"></i></label>
- <select class="form-control" id="{{key}}" name="{{key}}"
- ng-options="s.value as s.description for s in configMap[key].possibleValues"
- ng-model="entityToDeploy['brooklyn.config'][key]"
- ng-required="configMap[key].priority > 0"
- ng-disabled="deploying"
- auto-focus="focus === key"></select>
- <small class="help-block" ng-show="deploy.$submitted || deploy[key].$touched">
- <span ng-if="deploy[key].$error.required">You must enter a value</span>
- </small>
- </div>
- <div class="form-group" ng-class="{'has-error': deploy[key].$invalid && deploy[key].$touched}" ng-switch-when="java.lang.Integer">
- <label for="{{key}}">{{key}} <i ng-click="deleteConfigField(key)" class="fa fa-trash form-delete"></i></label>
- <input type="number" id="{{key}}" name="{{key}}" class="form-control" ng-model="entityToDeploy['brooklyn.config'][key]" ng-required="configMap[key].priority > 0" ng-disabled="deploying" auto-focus="focus === key" />
- <small class="help-block" ng-show="deploy.$submitted || deploy[key].$touched">
- <span ng-if="deploy[key].$error.required">You must enter a value</span>
- </small>
- </div>
- <div class="form-group" ng-class="{'has-error': deploy[key].$invalid && deploy[key].$touched}" ng-switch-default>
- <label for="{{key}}">{{key}} <i ng-click="deleteConfigField(key)" class="fa fa-trash form-delete"></i></label>
- <input type="text" id="{{key}}" name="{{key}}" class="form-control" ng-model="entityToDeploy['brooklyn.config'][key]" ng-required="configMap[key].priority > 0" ng-disabled="deploying" auto-focus="focus === key" />
- <small class="help-block" ng-show="deploy.$submitted || deploy[key].$touched">
- <span ng-if="deploy[key].$error.required">You must enter a value</span>
- </small>
- </div>
- </div>
- </div>
- </section>
- </form>
-
- <section class="quick-launch-section quick-launch-add-configuration">
- <div class="quick-launch-section-content">
- <button ng-click="toggleNewConfigForm()" class="spec-add-link">Add Config</button>
-
- <form ng-submit="addNewConfigKey()" ng-if="model.newConfigFormOpen" name="newKeyForm" novalidate>
- <div class="form-group">
- <label for="newKey">Enter new config key</label>
- <input class="form-control" id="newKey" name="newKey" ng-model="model.newKey"
- autocomplete="off"
- uib-typeahead="config.name for config in app.config | filter:$viewValue"
- typeahead-popup-template-url="DropdownTemplate.html"
- typeahead-template-url="ConfigTemplate.html"
- typeahead-show-hint="true"
- typeahead-min-length="0"
- typeahead-focus-on-select="false"
- typeahead-on-select="addNewConfigKey($item, $model, $label, $event)"
- auto-focus="model.newConfigFormOpen"
- required />
- </div>
- <input type="submit" value="submit" class="hidden"/>
- </form>
- </div>
- </section>
-</div>
-
-<div ng-show="yamlViewDisplayed">
- <br-yaml-editor value="editorYaml" enable-auto-complete></br-yaml-editor>
-</div>
-
-<div class="quick-launch-actions">
- <button class="btn btn-lg btn-default" ng-if="yamlViewDisplayed && appHasWizard" ng-disabled="deploying" ng-click="hideEditor()">Back</button>
- <button class="btn btn-lg btn-default" ng-if="!yamlViewDisplayed" ng-disabled="deploying" ng-click="showEditor()">Open in Editor</button>
- <button class="btn btn-lg btn-success pull-right" ng-disabled="(deploy.$invalid || deploying) && !yamlViewDisplayed" ng-click="deployApp()">{{deploying ? 'Deploying…' : 'Deploy'}}</button>
-</div>
-
-<!--TYPEAHEAD TEMPLATES :: START-->
-<script type="text/ng-template" id="DropdownTemplate.html">
- <ul class="dropdown-menu" ng-show="isOpen() && !moveInProgress" ng-style="{top: position().top+'px', left: position().left+'px', width: position().width+'px'}" role="listbox" aria-hidden="{{!isOpen()}}">
- <li class="uib-typeahead-match" ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index, $event)" role="option" id="{{::match.id}}">
- <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>
- </li>
- </ul>
-</script>
-<script type="text/ng-template" id="ConfigTemplate.html">
- <div class="dropdown-item">
- <h4 class="dropdown-item-heading" ng-bind-html="match.model.name | uibTypeaheadHighlight:query"></h4>
- <p class="dropdown-item-subheading">{{match.model.description}}</p>
- </div>
-</script>
-<script type="text/ng-template" id="LocationTemplate.html">
- <div class="dropdown-item">
- <h4 class="dropdown-item-heading" ng-bind-html="match.model.config.name ? match.model.config.name : match.model.name | uibTypeaheadHighlight:query"></h4>
- <p class="dropdown-item-subheading">{{match.model.spec}}</p>
- </div>
-</script>
-<!--TYPEAHEAD TEMPLATES :: END-->
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/quick-launch/quick-launch.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/quick-launch/quick-launch.js b/new/ui-modules/utils/quick-launch/quick-launch.js
deleted file mode 100644
index 645caf4..0000000
--- a/new/ui-modules/utils/quick-launch/quick-launch.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import angular from 'angular';
-import yaml from 'js-yaml';
-import brAutofocus from '../autofocus/autofocus';
-import brYamlEditor from '../yaml-editor/yaml-editor';
-import template from './quick-launch.html';
-
-const MODULE_NAME = 'brooklyn.components.quick-launch';
-
-angular.module(MODULE_NAME, [brAutofocus, brYamlEditor])
- .directive('brooklynQuickLaunch', quickLaunchDirective);
-
-export default MODULE_NAME;
-
-const BROOKLYN_CONFIG = 'brooklyn.config';
-
-export function quickLaunchDirective() {
- return {
- restrict: 'E',
- template: template,
- scope: {
- app: '=',
- locations: '=',
- args: '=?',
- callback: '=?'
- },
- controller: ['$scope', '$http', 'brSnackbar', controller]
- };
-
- function controller($scope, $http, brSnackbar) {
- $scope.deploying = false;
- $scope.model = {
- newConfigFormOpen: false
- };
- if ($scope.args && $scope.args.location) {
- $scope.model.location = $scope.args.location;
- }
- $scope.toggleNewConfigForm = toggleNewConfigForm;
- $scope.addNewConfigKey = addNewConfigKey;
- $scope.deleteConfigField = deleteConfigField;
- $scope.deployApp = deployApp;
- $scope.showEditor = showEditor;
- $scope.hideEditor = hideEditor;
- $scope.clearError = clearError;
-
- $scope.$watch('app', () => {
- $scope.clearError();
- $scope.appHasWizard = !checkForLocationTags($scope.app.plan.data);
- $scope.yamlViewDisplayed = !$scope.appHasWizard;
- $scope.editorYaml = $scope.app.plan.data;
- $scope.entityToDeploy = {
- type: $scope.app.symbolicName
- };
- if ($scope.app.config) {
- $scope.configMap = $scope.app.config.reduce((result, config) => {
- result[config.name] = config;
- if (config.pinned || (angular.isArray(config.contraints) && config.constraints.indexOf('required') > -1 && (!config.defaultValue === undefined || config.defaultValue === ''))) {
- if (!$scope.entityToDeploy.hasOwnProperty(BROOKLYN_CONFIG)) {
- $scope.entityToDeploy[BROOKLYN_CONFIG] = {};
- }
-
- $scope.entityToDeploy[BROOKLYN_CONFIG][config.name] = config.defaultValue || null;
- }
- return result;
- }, {});
- } else {
- $scope.configMap = {};
- }
- });
- $scope.$watch('editorYaml', () => {
- $scope.clearError();
- });
- $scope.$watch('entityToDeploy', () => {
- $scope.clearError();
- }, true);
- $scope.$watch('model.name', () => {
- $scope.clearError();
- });
- $scope.$watch('model.location', () => {
- $scope.clearError();
- });
-
- function deployApp() {
- $scope.deploying = true;
- let appYaml;
- if ($scope.yamlViewDisplayed) {
- appYaml = angular.copy($scope.editorYaml);
- } else {
- appYaml = buildYaml();
- }
- $http({
- method: 'POST',
- url: '/v1/applications',
- data: appYaml
- }).then((response) => {
- if ($scope.callback) {
- $scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]);
- } else {
- brSnackbar.create('Application Deployed');
- }
- $scope.deploying = false;
- }, (response) => {
- $scope.model.deployError = response.data.message;
- $scope.deploying = false;
- });
- }
-
- function toggleNewConfigForm() {
- $scope.model.newConfigFormOpen = !$scope.model.newConfigFormOpen;
- if ($scope.model.newConfigFormOpen) {
- delete $scope.model.newKey;
- }
- }
-
- function deleteConfigField(key) {
- delete $scope.entityToDeploy[BROOKLYN_CONFIG][key];
- if (Object.keys($scope.entityToDeploy[BROOKLYN_CONFIG]).length === 0) {
- delete $scope.entityToDeploy[BROOKLYN_CONFIG];
- }
- }
-
- function addNewConfigKey() {
- if ($scope.model.newKey && $scope.model.newKey.length > 0) {
- let newConfigValue = null;
- if ($scope.configMap.hasOwnProperty($scope.model.newKey) &&
- $scope.configMap[$scope.model.newKey].hasOwnProperty('defaultValue')) {
- newConfigValue = $scope.configMap[$scope.model.newKey].defaultValue;
- }
- if ($scope.configMap.hasOwnProperty($scope.model.newKey) &&
- $scope.configMap[$scope.model.newKey].type === 'java.lang.Boolean' &&
- newConfigValue === null) {
- newConfigValue = false;
- }
-
- if (!$scope.entityToDeploy.hasOwnProperty(BROOKLYN_CONFIG)) {
- $scope.entityToDeploy[BROOKLYN_CONFIG] = {};
- }
- $scope.entityToDeploy[BROOKLYN_CONFIG][$scope.model.newKey] = newConfigValue;
- $scope.focus = $scope.model.newKey;
- }
- $scope.model.newConfigFormOpen = false;
- }
-
- function buildYaml() {
- let newApp = {
- name: $scope.model.name || $scope.app.displayName,
- location: $scope.model.location || '<REPLACE>',
- services: [
- angular.copy($scope.entityToDeploy)
- ]
- };
- return yaml.safeDump(newApp);
- }
-
- function showEditor() {
- $scope.editorYaml = buildYaml();
- $scope.yamlViewDisplayed = true;
- }
-
- function hideEditor() {
- $scope.yamlViewDisplayed = false;
- }
-
- function clearError() {
- delete $scope.model.deployError;
- }
- }
-
- function checkForLocationTags(planYaml) {
- return reduceFunction(false, yaml.safeLoad(planYaml));
-
- function reduceFunction(locationFound, entity) {
- if (entity.hasOwnProperty('location') || entity.hasOwnProperty('location')) {
- return true;
- }
- if (!locationFound && entity.hasOwnProperty('brooklyn.children')) {
- entity['brooklyn.children'].reduce(reduceFunction, locationFound);
- } else if (!locationFound && entity.hasOwnProperty('services')) {
- entity['services'].reduce(reduceFunction, locationFound);
- }
- return locationFound;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/quick-launch/quick-launch.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/quick-launch/quick-launch.less b/new/ui-modules/utils/quick-launch/quick-launch.less
deleted file mode 100644
index 22f3bbe..0000000
--- a/new/ui-modules/utils/quick-launch/quick-launch.less
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.delete-interaction() {
- cursor: pointer;
- transition: 0.3s ease all;
- color: @gray-lighter;
- &:hover {
- color: @brand-danger;
- };
-}
-
-brooklyn-quick-launch {
- display: block;
-
- .quick-launch-type {
- margin-top: @modal-inner-padding;
- .media-object {
- .make-icon(60px);
- }
- .media-heading {
- color: @primary-500;
- }
- .media-subheading {
- font-size: 10px;
- color: @gray-light;
- }
- }
-
- .quick-launch-section {
- margin-top: @modal-inner-padding;
- &:not(:first-of-type) {
- // switch margin to padding at sides and draw a full-width line at top
- border-top: 1px solid @gray-lighter;
- }
-
- .quick-launch-section-title {
- color: @gray-lighter;
- font-size: 15px;
- text-transform: uppercase;
- margin-top: 10px;
- }
- }
-
- .form-group {
- .help-block {
- font-style: italic;
- }
- }
-
- .form-delete {
- padding-left: 10px;
- padding-right: 10px;
- .delete-interaction();
- }
-
- .spec-add-link {
- display: block;
- color: @gray-light;
- text-transform: uppercase;
- border: none;
- background: transparent;
- padding: 0;
-
- &:before {
- content: "\f067";
- font-family: FontAwesome;
- color: @brand-success;
- padding-right: 10px;
- }
- }
-
- .quick-launch-add-configuration {
- margin-bottom: @modal-inner-padding;
- }
-
- br-yaml-editor {
- margin-top: @modal-inner-padding;
- padding: 0;
- border-top: 1px solid @gray-lighter;
- }
-
- .quick-launch-actions {
- border-top: 1px solid @gray-lighter;
- }
-}
-
-// When use the quick-launch inside a modal
-.quick-launch-modal {
- .modal-content {
- padding: 0;
- }
-
- .quick-launch-title {
- &:extend(.modal-dialog .modal-header);
- &:extend(.modal-dialog .modal-header h3);
- margin: 0;
- padding: @modal-inner-padding;
- }
-
- .quick-launch-type {
- padding: 0 @modal-inner-padding 0 @modal-inner-padding;
- }
-
- .quick-launch-section {
- .quick-launch-section-title,
- .quick-launch-section-content {
- padding: 0 @modal-inner-padding 0 @modal-inner-padding;
- }
- }
-
- .dropdown-menu {
- overflow-x: auto;
- }
-
- .quick-launch-actions {
- padding: @modal-inner-padding;
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/sensitive-field/sensitive-field.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/sensitive-field/sensitive-field.js b/new/ui-modules/utils/sensitive-field/sensitive-field.js
deleted file mode 100644
index d964bc2..0000000
--- a/new/ui-modules/utils/sensitive-field/sensitive-field.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import angular from 'angular';
-
-const MODULE_NAME = 'brooklyn.component.sensitive-field';
-export const SENSITIVE_FIELD_REGEX = /^.*(passw(or)?d|credentials?|secret|private|access\.certs?|access\.keys?).*$/i;
-const CLASS_NAME = 'sensitive-field';
-const CLASS_NAME_SHOW = 'sensitive-field-show';
-
-angular.module(MODULE_NAME, [])
- .directive('sensitiveField', SensitiveFieldDirective);
-
-export default MODULE_NAME;
-
-export function SensitiveFieldDirective() {
- return {
- restrict: 'A',
- scope: {fieldName: '@', hideValue: '@'},
- link: link
- };
- function link($scope, $element) {
- if (SENSITIVE_FIELD_REGEX.test($scope.fieldName.trim()) || $scope.hideValue) {
- $element.addClass(CLASS_NAME);
- $element.bind('click', clickEventHandler);
- } else {
- $element.removeClass(CLASS_NAME);
- $element.unbind('click', clickEventHandler);
- }
- function clickEventHandler() {
- if ($element.hasClass(CLASS_NAME)) {
- $element.toggleClass(CLASS_NAME_SHOW);
- } else {
- $element.removeClass(CLASS_NAME_SHOW);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/sensitive-field/sensitive-field.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/sensitive-field/sensitive-field.less b/new/ui-modules/utils/sensitive-field/sensitive-field.less
deleted file mode 100644
index ce16eed..0000000
--- a/new/ui-modules/utils/sensitive-field/sensitive-field.less
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.sensitive-field {
- transition: text-shadow 1s linear;
- cursor: help;
- color: transparent;
- text-shadow: rgba(0, 0, 0, 0.95) 0px 0px 20px;
-
- &.sensitive-field-show {
- text-shadow: rgba(0, 0, 0, 0.95) 0px 0px 0px;
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/server-status/server-status.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/server-status/server-status.js b/new/ui-modules/utils/server-status/server-status.js
deleted file mode 100644
index 9d25c1a..0000000
--- a/new/ui-modules/utils/server-status/server-status.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import './server-status.less';
-
-import angular from 'angular';
-import uibModal from 'angular-ui-bootstrap/src/modal/index-nocss';
-import modalTemplate from './server-status.template.html';
-
-const MODULE_NAME = 'br.utils.server-status';
-const COOKIE_KEY = "br-server-status";
-const COOKIE_EXPIRY = 15 * 60000;
-const REFRESH_INTERVAL = 15000;
-const DEFAULT_COOKIE = {dismissed: false};
-
-angular.module(MODULE_NAME, [uibModal])
- .directive('brServerStatus', BrServerStatusDirective);
-
-export default MODULE_NAME;
-
-export function BrServerStatusDirective() {
- return {
- restrict: 'A',
- controller: ['$rootScope', '$scope', '$http', '$cookies', '$interval', '$uibModal', controller]
- };
-
- function controller($rootScope, $scope, $http, $cookies, $interval, $uibModal) {
- let cookie = DEFAULT_COOKIE;
- let intervalId = $interval(checkStatus, REFRESH_INTERVAL);
- $scope.$on('$destroy', () => ($interval.cancel(intervalId)));
- let modalInstance = null;
-
- function checkStatus() {
- cookie = $cookies.getObject(COOKIE_KEY) || DEFAULT_COOKIE;
- $http({method: 'GET', url: '/v1/server/up/extended'})
- .then(updateState, (error) => (updateState(error, true)));
- }
-
- function updateState(response, error = false) {
- let state = BrServerStatusModalController.STATES.OK;
- let stateData = null;
- if (error) {
- state = BrServerStatusModalController.STATES.NO_CONNECTION;
- stateData = response;
- } else {
- stateData = response.data;
- if (stateData.shuttingDown) {
- state = BrServerStatusModalController.STATES.STOPPING;
- } else if (!stateData.up) {
- state = BrServerStatusModalController.STATES.STARTING;
- } else if (stateData.healthy && stateData.ha.planeId && stateData.ha.masterId !== stateData.ha.ownId) {
- state = BrServerStatusModalController.STATES.NOT_HA_MASTER;
- } else if (!stateData.healthy) {
- state = BrServerStatusModalController.STATES.UNHEALTHY;
- }
- }
- $rootScope.$broadcast('br-server-state-update', {state: state, stateData: stateData});
- if (state !== BrServerStatusModalController.STATES.OK && !cookie.dismissed && cookie.dismissedSate !== state) {
- openModal(state, stateData);
- }
- }
-
- function openModal(state, stateData) {
- if (!modalInstance) {
- modalInstance = $uibModal.open({
- animation: true,
- template: modalTemplate,
- backdropClass: 'server-status-index',
- windowClass: 'server-status-index',
- controller: BrServerStatusModalController,
- controllerAs: 'vm',
- size: 'md',
- resolve: {
- state: () => (state),
- stateData: () => (stateData)
- }
- });
- modalInstance.result.then((reason) => {
- if (reason === 'understood') {
- cookie.dismissed = true;
- cookie.dismissedSate = state;
- $cookies.putObject(COOKIE_KEY, cookie, {expires: getCookieExpiryDate()});
- }
- }, () => (modalInstance = null));
- }
- }
-
- function getCookieExpiryDate() {
- return new Date(Date.now() + COOKIE_EXPIRY);
- }
-
- checkStatus();
-
-
- class BrServerStatusModalController {
- static STATES = {
- OK: 'OK',
- STARTING: 'STARTING',
- STOPPING: 'STOPPING',
- NOT_HA_MASTER: 'NOT-HA-MASTER',
- NO_CONNECTION: 'NO-CONNECTION',
- UNHEALTHY: 'UNHEALTHY'
- };
- static $inject = ['$scope', '$uibModalInstance', 'state', 'stateData'];
-
- constructor($scope, $uibModalInstance, state, stateData) {
- this.$uibModalInstance = $uibModalInstance;
- this.state = state;
- this.stateData = stateData;
- $scope.$on('br-server-state-update', (event, value) => {
- this.state = value.state;
- this.stateData = value.stateData;
- });
- }
-
- close(reason = 'understood') {
- this.$uibModalInstance.close(reason);
- }
-
- get masterUri() {
- if (this.stateData.ha.nodes.hasOwnProperty(this.stateData.ha.masterId)) {
- return this.stateData.ha.nodes[this.stateData.ha.masterId].nodeUri;
- } else {
- return null;
- }
- }
-
- get nodes() {
- let currentNodeId = this.stateData.ha.ownId;
- let masterNode = null;
- let result = [];
- for (let nodeId in this.stateData.ha.nodes) {
- let currentNode = this.stateData.ha.nodes[nodeId];
- if (currentNode.nodeId === this.stateData.ha.masterId) {
- masterNode = currentNode;
- }
- result.push(currentNode);
- }
- return result.reduce((pre, node) => {
- node.state = ((node.localTimestamp + 30 * 1000) < masterNode.localTimestamp) ? 'offline' : 'online';
- node.isMasterNode = node.nodeId === masterNode.nodeId;
- node.isCurrentNode = node.nodeId === currentNodeId;
- pre.push(node);
- return pre;
- }, []);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/server-status/server-status.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/server-status/server-status.less b/new/ui-modules/utils/server-status/server-status.less
deleted file mode 100644
index 1242688..0000000
--- a/new/ui-modules/utils/server-status/server-status.less
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.server-status-index {
- z-index: 2000;
-}
-
-.server-status-body {
- table {
- th.server-status-node-id {
- width: 25%;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/server-status/server-status.template.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/server-status/server-status.template.html b/new/ui-modules/utils/server-status/server-status.template.html
deleted file mode 100644
index cca0627..0000000
--- a/new/ui-modules/utils/server-status/server-status.template.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<div class="modal-header" ng-switch="vm.state">
- <br-svg type="close" class="pull-right" ng-click="$dismiss('Close modal')"></br-svg>
- <h3 class="modal-title" ng-switch-when="STARTING">Server starting up…</h3>
- <h3 class="modal-title" ng-switch-when="STOPPING">Server shutting down…</h3>
- <h3 class="modal-title" ng-switch-when="NOT-HA-MASTER">This server is not the high availability master</h3>
- <h3 class="modal-title" ng-switch-when="NO-CONNECTION">Connecting to server…</h3>
- <h3 class="modal-title" ng-switch-when="OK">Server up and running</h3>
- <h3 class="modal-title" ng-switch-default>This server has errors</h3>
-</div>
-<div class="modal-body server-status-body" ng-switch="vm.state">
- <div ng-switch-when="STARTING">
- <p>
- The server is starting.
- It is recommended to wait before proceeding.
- This dialog will disappear when the server is ready.
- </p>
- </div>
- <div ng-switch-when="STOPPING">
- <p>
- The server is shutting down.
- This dialog will disappear if and when the server is restarted at this address.
- If in doubt, contact your system administrator.
- </p>
- </div>
- <div ng-switch-when="NOT-HA-MASTER">
- <p>It is recommended not to use this server directly.</p>
- <p ng-if="vm.masterUri">Master server located at <a ng-href="vm.masterUri">{{vm.masterUri}}</a></p>
- <p ng-if="!vm.masterUri">The address of the master API server is not currently known.</p>
-
- <table class="table">
- <thead>
- <tr>
- <th class="server-status-node-id">Node ID</th>
- <th>Status</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="node in vm.nodes | orderBy:'isMasterNode' | orderBy:'state':true track by node.nodeId"
- ng-class="{success: node.state === 'online', danger: node.state === 'offline'}">
- <td>
- {{node.nodeId}}
- <span ng-if="node.isCurrentNode" class="label label-info">current</span>
- <span ng-if="node.isMasterNode" class="label label-success">master</span>
- </td>
- <td>{{node.status | lowercase}}</td>
- <td>
- <a ng-if="node.state === 'online'" class="btn btn-xs btn-success pull-right" ng-class="{disabled: node.nodeUri === null}">Open</a>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div ng-switch-when="NO-CONNECTION">
- <p>Cannot connect to API server. Please check your network connection. If the problem persists, please contact your administrator.</p>
- </div>
- <div ng-switch-when="UNHEALTHY">
- <p>Your server has errors and is not healthy.</p>
- <p>Please check with your system administrator.</p>
- </div>
- <div ng-switch-when="OK">
- <p>The server is now ready to use.</p>
- </div>
- <div ng-switch-default>
- <p>Please check with your system administrator.</p>
- </div>
-</div>
-<div class="modal-footer" ng-switch="vm.state">
- <div ng-switch-when="OK">
- <button class="btn btn-success" type="button" ng-click="vm.close('OK')">Continue</button>
- </div>
- <div style="display: flex; flex-wrap: nowrap;" ng-switch-default>
- <span class="text-muted" style="flex-grow: 2; font-size: 12px; font-style: italic; margin-right: 15px;">
- Click below if you understand the risks, that information may be unavailable and operations may fail, and
- wish to proceed regardless.
- </span>
- <button class="btn btn-danger" type="button" ng-click="vm.close()" style="flew-shrink: 0;">I understand the risk</button>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/47b46402/new/ui-modules/utils/status/states/created.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/utils/status/states/created.less b/new/ui-modules/utils/status/states/created.less
deleted file mode 100644
index 3c68eee..0000000
--- a/new/ui-modules/utils/status/states/created.less
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-brooklyn-status-icon {
- .status-created {
- circle {
- fill: transparent;
- stroke: lighten(@gray-light, 30%);
- stroke-width: @status-stroke-width;
- }
- }
-}
-
-brooklyn-status.status-sm,
-brooklyn-status-icon.status-sm {
- .status-created {
- circle {
- stroke-width: @status-stroke-width-sm;
- }
- }
-}
-
-brooklyn-status-text .status-created {
- color: lighten(@gray-light, 30%);
-}