From 97d2fffae20b4fb31cb933bcbc628b1ec7929776 Mon Sep 17 00:00:00 2001 From: flavien peyre Date: Fri, 14 Aug 2015 15:58:47 -0400 Subject: [PATCH] Add directive textArea Change-Id: Iecadb65e68bb7707f0dbd3e52254f093d63c1f88 --- app/app.js | 1 - .../config/defaultLayoutConfig.json | 19 +++++++++++++- app/components/directive/directive.js | 1 + app/components/directive/service/service.html | 5 ---- app/components/directive/service/service.js | 21 ---------------- .../directive/textArea/textArea.html | 5 ++++ app/components/directive/textArea/textArea.js | 25 +++++++++++++++++++ app/index.html | 2 +- app/templates/config/config.html | 7 ------ app/templates/config/config.js | 14 ----------- 10 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 app/components/directive/service/service.html delete mode 100644 app/components/directive/service/service.js create mode 100644 app/components/directive/textArea/textArea.html create mode 100644 app/components/directive/textArea/textArea.js delete mode 100644 app/templates/config/config.html delete mode 100644 app/templates/config/config.js diff --git a/app/app.js b/app/app.js index fca6da4..2448887 100644 --- a/app/app.js +++ b/app/app.js @@ -16,7 +16,6 @@ angular.module('bansho', [ 'bansho.drupal.info', 'bansho.view', 'bansho.view.page', - 'bansho.view.config', 'bansho.view.drupalDashboard', 'bansho.view.drupal', 'bansho.grafana' diff --git a/app/components/config/defaultLayoutConfig.json b/app/components/config/defaultLayoutConfig.json index a04ba33..3079a17 100644 --- a/app/components/config/defaultLayoutConfig.json +++ b/app/components/config/defaultLayoutConfig.json @@ -699,7 +699,24 @@ } }, "config": { - "template": "config" + "template": "page", + "components": [ + { + "type": "panel", + "components": [ + { + "type": "title", + "attributes": { + "title": "Edit Config" + } + }, + { + "type": "text-area", + "attributes": {} + } + ] + } + ] }, "configHosts": { "template": "page", diff --git a/app/components/directive/directive.js b/app/components/directive/directive.js index 5909519..3c24b02 100644 --- a/app/components/directive/directive.js +++ b/app/components/directive/directive.js @@ -2,6 +2,7 @@ angular.module('bansho.directive', [ 'bansho.actionbar', + 'bansho.textArea', 'bansho.container', 'bansho.hostTree', 'bansho.table', diff --git a/app/components/directive/service/service.html b/app/components/directive/service/service.html deleted file mode 100644 index ece8d6e..0000000 --- a/app/components/directive/service/service.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
- -
-
diff --git a/app/components/directive/service/service.js b/app/components/directive/service/service.js deleted file mode 100644 index 803019b..0000000 --- a/app/components/directive/service/service.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -angular.module('bansho.service', ['bansho.datasource']) - - .directive('banshoService', function () { - return { - restrict: 'E', - scope: { - options: '=' - }, - templateUrl: 'components/directive/service/service.html', - controller: ['$scope', 'templateManager', 'surveilStatus', 'iframeUrl', - function ($scope, templateManager, surveilStatus, iframeUrl) { - var hostname = templateManager.getPageParam('host_name'), - serviceDescription = templateManager.getPageParam('service_description'); - - $scope.param = {}; - $scope.components = $scope.options.components; - }] - }; - }); diff --git a/app/components/directive/textArea/textArea.html b/app/components/directive/textArea/textArea.html new file mode 100644 index 0000000..821bd81 --- /dev/null +++ b/app/components/directive/textArea/textArea.html @@ -0,0 +1,5 @@ +
+ +
+ + diff --git a/app/components/directive/textArea/textArea.js b/app/components/directive/textArea/textArea.js new file mode 100644 index 0000000..01485b0 --- /dev/null +++ b/app/components/directive/textArea/textArea.js @@ -0,0 +1,25 @@ +/*global jQuery */ + +'use strict'; + +angular.module('bansho.textArea', []) + .directive('banshoTextArea', [ + function () { + return { + restrict: 'E', + scope: { + options: '=' + }, + templateUrl: 'components/directive/textArea/textArea.html', + controller:['$scope', '$window', 'configManager', + function ($scope, $window, configManager) { + $scope.configuration = JSON.stringify(configManager.readLayoutConfig(), null, 4); + $scope.saveConfiguration = function () { + configManager.saveLayoutConfig(JSON.parse($scope.configuration)); + $window.location.reload(); + }; + } + ] + }; + } + ]); \ No newline at end of file diff --git a/app/index.html b/app/index.html index c593bfd..8afe175 100644 --- a/app/index.html +++ b/app/index.html @@ -81,6 +81,7 @@ + @@ -123,7 +124,6 @@ - diff --git a/app/templates/config/config.html b/app/templates/config/config.html deleted file mode 100644 index b15216a..0000000 --- a/app/templates/config/config.html +++ /dev/null @@ -1,7 +0,0 @@ -
-

Edit Configuration

-
- -
- -
diff --git a/app/templates/config/config.js b/app/templates/config/config.js deleted file mode 100644 index fdc8b1b..0000000 --- a/app/templates/config/config.js +++ /dev/null @@ -1,14 +0,0 @@ -/*global jQuery */ - -'use strict'; - -angular.module('bansho.view.config', []) - .controller('ConfigCtrl', ['$scope', '$window', 'configManager', - function ($scope, $window, configManager) { - $scope.configuration = JSON.stringify(configManager.readLayoutConfig(), null, 4); - - $scope.saveConfiguration = function () { - configManager.saveLayoutConfig(JSON.parse($scope.configuration)); - $window.location.reload(); - }; - }]);