Add directive textArea

Change-Id: Iecadb65e68bb7707f0dbd3e52254f093d63c1f88
This commit is contained in:
flavien peyre 2015-08-14 15:58:47 -04:00
parent 547da5b17c
commit 97d2fffae2
10 changed files with 50 additions and 50 deletions

View File

@ -16,7 +16,6 @@ angular.module('bansho', [
'bansho.drupal.info', 'bansho.drupal.info',
'bansho.view', 'bansho.view',
'bansho.view.page', 'bansho.view.page',
'bansho.view.config',
'bansho.view.drupalDashboard', 'bansho.view.drupalDashboard',
'bansho.view.drupal', 'bansho.view.drupal',
'bansho.grafana' 'bansho.grafana'

View File

@ -699,7 +699,24 @@
} }
}, },
"config": { "config": {
"template": "config" "template": "page",
"components": [
{
"type": "panel",
"components": [
{
"type": "title",
"attributes": {
"title": "Edit Config"
}
},
{
"type": "text-area",
"attributes": {}
}
]
}
]
}, },
"configHosts": { "configHosts": {
"template": "page", "template": "page",

View File

@ -2,6 +2,7 @@
angular.module('bansho.directive', [ angular.module('bansho.directive', [
'bansho.actionbar', 'bansho.actionbar',
'bansho.textArea',
'bansho.container', 'bansho.container',
'bansho.hostTree', 'bansho.hostTree',
'bansho.table', 'bansho.table',

View File

@ -1,5 +0,0 @@
<article>
<section class="main__content tabpanel">
<bansho-components components="components"></bansho-components>
</section>
</article>

View File

@ -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;
}]
};
});

View File

@ -0,0 +1,5 @@
<div>
<textarea rows="50" cols="80" ng-model='configuration' class="configuration"> </textarea>
</div>
<button type="button" ng-click="saveConfiguration()">Save</button>

View File

@ -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();
};
}
]
};
}
]);

View File

@ -81,6 +81,7 @@
<script src="components/directive/actionbar/component_recheck/recheck.js"></script> <script src="components/directive/actionbar/component_recheck/recheck.js"></script>
<script src="components/directive/actionbar/component_search_filter/search_filter.js"></script> <script src="components/directive/actionbar/component_search_filter/search_filter.js"></script>
<script src="components/directive/container/info/info.js"></script> <script src="components/directive/container/info/info.js"></script>
<script src="components/directive/textArea/textArea.js"></script>
<script src="components/directive/table/table.js"></script> <script src="components/directive/table/table.js"></script>
<script src="components/directive/table/pagingbar/pagingbar.js"></script> <script src="components/directive/table/pagingbar/pagingbar.js"></script>
<script src="components/directive/table/cell_status_duration/cell_status_duration.js"></script> <script src="components/directive/table/cell_status_duration/cell_status_duration.js"></script>
@ -123,7 +124,6 @@
<script src="routing_view/routing_view.js"></script> <script src="routing_view/routing_view.js"></script>
<script src="templates/template.js"></script> <script src="templates/template.js"></script>
<script src="templates/page/page.js"></script> <script src="templates/page/page.js"></script>
<script src="templates/config/config.js"></script>
<script src="templates/drupal_dashboard/drupal_dashboard.js"></script> <script src="templates/drupal_dashboard/drupal_dashboard.js"></script>
<script src="templates/drupal/drupal.js"></script> <script src="templates/drupal/drupal.js"></script>
<!-- endbuild --> <!-- endbuild -->

View File

@ -1,7 +0,0 @@
<div ng-controller="ConfigCtrl">
<h1>Edit Configuration</h1>
<div>
<textarea rows="50" cols="80" ng-model='configuration' class="configuration"> </textarea>
</div>
<button type="button" ng-click="saveConfiguration()">Save</button>
</div>

View File

@ -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();
};
}]);