make the table more friendly

This commit is contained in:
ziirish 2018-01-24 11:22:09 +01:00
parent 4eb7e5c79e
commit fad4cf2898
No known key found for this signature in database
GPG key ID: 72DB229A64B54E46
2 changed files with 9 additions and 3 deletions

View file

@ -98,13 +98,13 @@
* The JSON is then split-ed out into several dict/arrays to build our form.
*/
var app = angular.module('MainApp', ['ngSanitize', 'frapontillo.bootstrap-switch', 'ui.select', 'mgcrea.ngStrap', 'angular-onbeforeunload']);
var app = angular.module('MainApp', ['ngSanitize', 'frapontillo.bootstrap-switch', 'ui.select', 'mgcrea.ngStrap', 'angular-onbeforeunload', 'datatables']);
app.config(function(uiSelectConfig) {
uiSelectConfig.theme = 'bootstrap';
});
app.controller('ConfigCtrl', ['$scope', '$http', '$scrollspy', function($scope, $http, $scrollspy) {
app.controller('ConfigCtrl', ['$scope', '$http', '$scrollspy', function($scope, $http, $scrollspy, DTOptionsBuilder, DTColumnDefBuilder) {
$scope.bools = [];
$scope.strings = [];
$scope.clients = [];
@ -139,6 +139,12 @@ app.controller('ConfigCtrl', ['$scope', '$http', '$scrollspy', function($scope,
'no': "{{ _('no') }}",
'reset': "{{ _('Reset list') }}",
};
$scope.dtOptions = DTOptionsBuilder.newOptions();
$scope.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0),
DTColumnDefBuilder.newColumnDef(1),
DTColumnDefBuilder.newColumnDef(2).notSortable(),
];
{% if client -%}
$http.get('{{ url_for("api.client_settings", client=client, conf=conf, server=server) }}', { headers: { 'X-From-UI': true } })
{% else -%}

View file

@ -305,7 +305,7 @@
<div class="tab-pane fade" id="clients">
<div style="padding-top: 80px; margin-top: -45px;"></div>
<div id="table-clients" class="table-responsive row">
<table class="table table-striped table-hover nowrap" width="100%">
<table class="table table-striped table-hover nowrap" width="100%" datatable="ng" dt-options="dtOptions" dt-column-defs="dtColumnDefs">
<thead>
<tr>
<th>{{ _('Name') }}</th><th>{{ _('Path') }}</th><th></th>