diff --git a/public/app/host/database.jade b/public/app/host/database.jade
new file mode 100644
index 0000000..bbfedbc
--- /dev/null
+++ b/public/app/host/database.jade
@@ -0,0 +1,22 @@
+.container
+ h1 Database
+ a.btn.btn-default(ng-click="isAdding=true")
+ span.glyphicon.glyphicon-plus
+ form.well(ng-submit="add()",name="addform",ng-if="isAdding")
+ .form-group
+ label(for="domain") Domain
+ input.form-control(id="domain",name="domain",ng-model="obj.domain",ng-minlength="3")
+ button.btn.btn-primary(type="submit")
+ span.glyphicon.glyphicon-floppy-disk
+ | Save
+ table.table.table-bordered(ng-table="tableParams")
+ tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
+ td(data-title="'Database/User'")
+ span(ng-if="!item.isEditing") warehost_user{{item.profil}}_db{{item.ID}}
+ td(data-title="'Kommentar'")
+ span.glyphicon.glyphicon-lock(ng-if="item.password")
+ span(ng-if="!item.isEditing") {{item.comment}}
+ td(data-title="'Option'")
+ .btn-group.btn-group-xs
+ span.btn.btn-default(ng-click="delete(item)")
+ span.glyphicon.glyphicon-trash
diff --git a/public/app/host/database.js b/public/app/host/database.js
new file mode 100644
index 0000000..2559453
--- /dev/null
+++ b/public/app/host/database.js
@@ -0,0 +1,34 @@
+'use strict';
+
+angular.module('warehost')
+ .controller('DatabaseHostCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
+ $scope.tableParams = new NgTableParams({
+ sorting: { 'ID': 'asc' },
+ total: 0,
+ count: config.table.count
+ }, { dataset: [] });
+ alert.set({});
+ $scope.obj = {};
+
+ function resetObj(){
+ $scope.obj = {};
+ }
+ function load(){
+ $http.get(config.api+'/host/database').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){
+ resetObj();
+ $scope.isAdding = false;
+ load();
+ }
+ }
+ resetObj();
+ load();
+
+ });
diff --git a/public/app/host/domain.jade b/public/app/host/domain.jade
new file mode 100644
index 0000000..fecf50b
--- /dev/null
+++ b/public/app/host/domain.jade
@@ -0,0 +1,27 @@
+.container
+ h1 Domains
+ a.btn.btn-default(ng-click="isAdding=true")
+ span.glyphicon.glyphicon-plus
+ form.well(ng-submit="add()",name="addform",ng-if="isAdding")
+ .form-group
+ label(for="domain") Domain
+ input.form-control(id="domain",name="domain",ng-model="obj.fqdn",ng-minlength="3")
+ button.btn.btn-primary(type="submit")
+ span.glyphicon.glyphicon-floppy-disk
+ | Save
+ table.table.table-bordered(ng-table="tableParams")
+ tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
+ td(data-title="'Domain'")
+ span(ng-if="!item.isEditing") {{item.fqdn}}
+ td(data-title="'Funktions'")
+ a(ng-if="item.mail")
+ span.glyphicon.glyphicon-envelope(aria-hidden="true")
+ | Mail
+ |
+ a(ng-if="item.web")
+ span.glyphicon.glyphicon-globe(aria-hidden="true")
+ | Web
+ td(data-title="'Option'")
+ .btn-group.btn-group-xs
+ span.btn.btn-default(ng-click="delete(item)")
+ span.glyphicon.glyphicon-trash
diff --git a/public/app/host/domain.js b/public/app/host/domain.js
new file mode 100644
index 0000000..9bac7ad
--- /dev/null
+++ b/public/app/host/domain.js
@@ -0,0 +1,34 @@
+'use strict';
+
+angular.module('warehost')
+ .controller('DomainHostCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
+ $scope.tableParams = new NgTableParams({
+ sorting: { 'fqdn': 'asc' },
+ total: 0,
+ count: config.table.count
+ }, { dataset: [] });
+ alert.set({});
+ $scope.obj = {};
+
+ function resetObj(){
+ $scope.obj = {};
+ }
+ function load(){
+ $http.get(config.api+'/host/domain').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){
+ resetObj();
+ $scope.isAdding = false;
+ load();
+ }
+ }
+ resetObj();
+ load();
+
+ });
diff --git a/public/app/host/index.js b/public/app/host/index.js
index 5deb3ff..8fcef75 100644
--- a/public/app/host/index.js
+++ b/public/app/host/index.js
@@ -5,7 +5,7 @@ angular.module('warehost')
.state('app.host', {
url:'/host',
views:{
- 'menu':{templateUrl:'app/host/menu.html'}
+ 'menu':{templateUrl:'app/host/menu.html',controller:'MenuHostCtrl'}
}
})
.state('app.host.index', {
@@ -18,5 +18,34 @@ angular.module('warehost')
}
}
}
+ })
+ .state('app.host.signup', {
+ url:'/',
+ views:{
+ '@app':{
+ templateUrl: 'app/home.html',
+ controller:function(alert){
+ alert.set({});
+ }
+ }
+ }
+ })
+ .state('app.host.domain', {
+ url:'/domain',
+ views:{
+ '@app':{
+ templateUrl: 'app/host/domain.html',
+ controller:'DomainHostCtrl'
+ }
+ }
+ })
+ .state('app.host.database', {
+ url:'/database',
+ views:{
+ '@app':{
+ templateUrl: 'app/host/database.html',
+ controller:'DatabaseHostCtrl'
+ }
+ }
});
}]);
diff --git a/public/app/host/menu.jade b/public/app/host/menu.jade
index d6f94fe..ff15e1c 100644
--- a/public/app/host/menu.jade
+++ b/public/app/host/menu.jade
@@ -1,3 +1,9 @@
.navbar-text Hosting
li
a(ui-sref="app.host.index",ui-sref-active="active") Home
+li(ng-if='!profil.ID')
+ a(ui-sref="app.host.signup",ui-sref-active="active") Signup
+li(ng-if='profil.ID')
+ a(ui-sref="app.host.domain",ui-sref-active="active") Domains
+li(ng-if='profil.ID')
+ a(ui-sref="app.host.database",ui-sref-active="active") Databases
diff --git a/public/app/host/menu.js b/public/app/host/menu.js
new file mode 100644
index 0000000..54f95cf
--- /dev/null
+++ b/public/app/host/menu.js
@@ -0,0 +1,15 @@
+'use strict';
+
+angular.module('warehost')
+ .controller('MenuHostCtrl',function(session,config,alert,$scope,$http){
+ $scope.profil = {};
+ alert.set({});
+ function load(){
+ $http.get(config.api+'/host/profil').then(function(res){
+ session.set(res);
+ $scope.profil = res.data.data;
+ });
+ }
+ load();
+
+ });
diff --git a/public/app/web/domain.js b/public/app/web/domain.js
index 759418e..8fa8007 100644
--- a/public/app/web/domain.js
+++ b/public/app/web/domain.js
@@ -3,7 +3,6 @@
angular.module('warehost')
.controller('DomainWebCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
$scope.tableParams = new NgTableParams({
- sorting: { 'invited.username': 'asc' },
total: 0,
count: config.table.count
}, { dataset: [] });
diff --git a/public/app/web/list.js b/public/app/web/list.js
index 41da1d6..6cf0475 100644
--- a/public/app/web/list.js
+++ b/public/app/web/list.js
@@ -3,7 +3,7 @@
angular.module('warehost')
.controller('ListWebCtrl',function(session,config,alert,NgTableParams,$scope,$rootScope,$http){
$scope.tableParams = new NgTableParams({
- sorting: { 'invited.username': 'asc' },
+ sorting: { 'website.name': 'asc' },
total: 0,
count: config.table.count
}, { dataset: [] });
diff --git a/public/app/web/permission.js b/public/app/web/permission.js
index b8ffdbd..270c9d7 100644
--- a/public/app/web/permission.js
+++ b/public/app/web/permission.js
@@ -3,7 +3,7 @@
angular.module('warehost')
.controller('PermissionWebCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
$scope.tableParams = new NgTableParams({
- sorting: { 'invited.username': 'asc' },
+ sorting: { 'login.username': 'asc' },
total: 0,
count: config.table.count
}, { dataset: [] });
diff --git a/public/index.html b/public/index.html
index 3b75687..baeb535 100644
--- a/public/index.html
+++ b/public/index.html
@@ -58,7 +58,10 @@
+
+
+