diff --git a/public/app/host/admin/database.js b/public/app/host/admin/database.js
index 6a19b39..a9f83c7 100644
--- a/public/app/host/admin/database.js
+++ b/public/app/host/admin/database.js
@@ -8,11 +8,7 @@ angular.module('warehost')
count: config.table.count
}, { dataset: [] });
alert.set({});
- $scope.obj = {};
- function resetObj(){
- $scope.obj = {};
- }
function load(){
$http.get(config.api+'/host/database?filter=all').then(function(res){
session.set(res);
@@ -23,12 +19,9 @@ angular.module('warehost')
session.set(res);
alert.set(res);
if(res.data.data){
- resetObj();
- $scope.isAdding = false;
load();
}
}
- resetObj();
load();
$rootScope.$on('warehost.session',load);
diff --git a/public/app/host/admin/domain.js b/public/app/host/admin/domain.js
index a98ac91..d261c37 100644
--- a/public/app/host/admin/domain.js
+++ b/public/app/host/admin/domain.js
@@ -8,11 +8,7 @@ angular.module('warehost')
count: config.table.count
}, { dataset: [] });
alert.set({});
- $scope.obj = {};
- function resetObj(){
- $scope.obj = {};
- }
function load(){
$http.get(config.api+'/host/domain?filter=all').then(function(res){
session.set(res);
@@ -23,12 +19,9 @@ angular.module('warehost')
session.set(res);
alert.set(res);
if(res.data.data){
- resetObj();
- $scope.isAdding = false;
load();
}
}
- resetObj();
load();
$rootScope.$on('warehost.session',load);
diff --git a/public/app/host/admin/profil.jade b/public/app/host/admin/profil.jade
new file mode 100644
index 0000000..e5d936b
--- /dev/null
+++ b/public/app/host/admin/profil.jade
@@ -0,0 +1,10 @@
+.container
+ h1 Profiles
+ table.table.table-bordered(ng-table="tableParams")
+ tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
+ td(data-title="'UserID'", filter="{'login.ID': 'text'}") {{item.login.ID}}
+ td(data-title="'User'", filter="{'login.username': 'text'}") {{item.login.username}}
+ td(data-title="'ProfilID'", filter="{'ID': 'text'}") {{item.ID}}
+ td(data-title="'Reseller'", filter="{'reseller': 'components/ngfilter-boolean.html'}")
+ span.glyphicon.glyphicon-ok(aria-hidden="true",ng-if="item.reseller",ng-click="toggle(item)")
+ span.glyphicon.glyphicon-lock(aria-hidden="true",ng-if="!item.reseller",ng-click="toggle(item)")
diff --git a/public/app/host/admin/profil.js b/public/app/host/admin/profil.js
new file mode 100644
index 0000000..6aa276d
--- /dev/null
+++ b/public/app/host/admin/profil.js
@@ -0,0 +1,32 @@
+'use strict';
+
+angular.module('warehost')
+ .controller('ProfilAdminHostCtrl',function(session,config,alert,NgTableParams,$rootScope,$scope,$http){
+ $scope.tableParams = new NgTableParams({
+ sorting: { 'fqdn': 'asc' },
+ total: 0,
+ count: config.table.count
+ }, { dataset: [] });
+ alert.set({});
+
+ function load(){
+ $http.get(config.api+'/host/profils').then(function(res){
+ session.set(res);
+ $scope.tableParams.settings({dataset: angular.copy(res.data.data),total: (res.data.data).length});
+ });
+ }
+ function submitresult(res){
+ session.set(res);
+ alert.set(res);
+ if(res.data.data){
+ load();
+ }
+ }
+ load();
+ $rootScope.$on('warehost.session',load);
+
+ $scope.toggle = function(a){
+ $http.patch(config.api+'/host/profil/'+a.ID,a).then(submitresult);
+ };
+
+ });
diff --git a/public/app/host/index.js b/public/app/host/index.js
index 5fcb33d..391042a 100644
--- a/public/app/host/index.js
+++ b/public/app/host/index.js
@@ -60,8 +60,8 @@ angular.module('warehost')
url:'/profil',
views:{
'@app':{
- templateUrl: 'app/host/admin/domain.html',
- controller:'DomainAdminHostCtrl'
+ templateUrl: 'app/host/admin/profil.html',
+ controller:'ProfilAdminHostCtrl'
}
}
})
diff --git a/public/index.html b/public/index.html
index 01b036e..d484568 100644
--- a/public/index.html
+++ b/public/index.html
@@ -60,6 +60,7 @@
+