Add edit configuration page
Change-Id: I9ec8d699a6f99b6fa10d0c7f2a83c2c6af3fc27a
This commit is contained in:
parent
8f877fdcc2
commit
a97fb551c7
@ -81,3 +81,9 @@
|
||||
padding: 0 15px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.configuration {
|
||||
color:black !important;
|
||||
margin-left:30px;
|
||||
font-family: Courier New;
|
||||
}
|
||||
|
@ -75,6 +75,11 @@ angular.module('bansho.config', [])
|
||||
return config.data;
|
||||
};
|
||||
|
||||
this.saveConfig = function(configuration) {
|
||||
config.data = configuration;
|
||||
saveConfig();
|
||||
};
|
||||
|
||||
this.setThemeAndSave = function (theme) {
|
||||
config.data.banshoConfig.theme = theme;
|
||||
saveConfig();
|
||||
|
@ -393,5 +393,8 @@
|
||||
"hostsMap": {
|
||||
"drupal": "Wonderful Drupal Website"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"template": "config"
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@
|
||||
<ul class="topbar__settings__sublist">
|
||||
<li class="topbar__settings__subitem"><a href="#">Missing Plugins</a></li>
|
||||
<li class="topbar__settings__subitem"><a href="#">Object History</a></li>
|
||||
<li class="topbar__settings__subitem"><a href="#">Configure</a></li>
|
||||
<li class="topbar__settings__subitem"><a href="#/view?view=config">Configure</a></li>
|
||||
<li class="topbar__settings__subitem" ng-click="switchTheme()"><a>Change theme</a></li>
|
||||
<li class="topbar__settings__subitem" ng-click="logout()"><a>Logout</a></li>
|
||||
</ul>
|
||||
|
@ -110,6 +110,7 @@
|
||||
<script src="templates/dashboard/dashboard.js"></script>
|
||||
<script src="templates/tables/tables.js"></script>
|
||||
<script src="templates/host/host.js"></script>
|
||||
<script src="templates/config/config.js"></script>
|
||||
<script src="templates/service/service.js"></script>
|
||||
<script src="templates/drupal_dashboard/drupal_dashboard.js"></script>
|
||||
<script src="templates/drupal/drupal.js"></script>
|
||||
|
7
app/templates/config/config.html
Normal file
7
app/templates/config/config.html
Normal file
@ -0,0 +1,7 @@
|
||||
<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>
|
14
app/templates/config/config.js
Normal file
14
app/templates/config/config.js
Normal file
@ -0,0 +1,14 @@
|
||||
/*global jQuery */
|
||||
|
||||
'use strict';
|
||||
|
||||
angular.module('bansho.view.singleTable')
|
||||
.controller('ConfigCtrl', ['$scope', '$window', 'configManager',
|
||||
function ($scope, $window, configManager) {
|
||||
$scope.configuration = JSON.stringify(configManager.readConfig(),null,4);
|
||||
|
||||
$scope.saveConfiguration = function () {
|
||||
configManager.saveConfig(JSON.parse($scope.configuration));
|
||||
$window.location.reload();
|
||||
};
|
||||
}]);
|
Loading…
Reference in New Issue
Block a user