[host] starting developing
This commit is contained in:
parent
ca4272c561
commit
538d209f91
|
@ -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
|
|
@ -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();
|
||||||
|
|
||||||
|
});
|
|
@ -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
|
|
@ -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();
|
||||||
|
|
||||||
|
});
|
|
@ -5,7 +5,7 @@ angular.module('warehost')
|
||||||
.state('app.host', {
|
.state('app.host', {
|
||||||
url:'/host',
|
url:'/host',
|
||||||
views:{
|
views:{
|
||||||
'menu':{templateUrl:'app/host/menu.html'}
|
'menu':{templateUrl:'app/host/menu.html',controller:'MenuHostCtrl'}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('app.host.index', {
|
.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'
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
.navbar-text Hosting
|
.navbar-text Hosting
|
||||||
li
|
li
|
||||||
a(ui-sref="app.host.index",ui-sref-active="active") Home
|
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
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
});
|
|
@ -3,7 +3,6 @@
|
||||||
angular.module('warehost')
|
angular.module('warehost')
|
||||||
.controller('DomainWebCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
|
.controller('DomainWebCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
|
||||||
$scope.tableParams = new NgTableParams({
|
$scope.tableParams = new NgTableParams({
|
||||||
sorting: { 'invited.username': 'asc' },
|
|
||||||
total: 0,
|
total: 0,
|
||||||
count: config.table.count
|
count: config.table.count
|
||||||
}, { dataset: [] });
|
}, { dataset: [] });
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
angular.module('warehost')
|
angular.module('warehost')
|
||||||
.controller('ListWebCtrl',function(session,config,alert,NgTableParams,$scope,$rootScope,$http){
|
.controller('ListWebCtrl',function(session,config,alert,NgTableParams,$scope,$rootScope,$http){
|
||||||
$scope.tableParams = new NgTableParams({
|
$scope.tableParams = new NgTableParams({
|
||||||
sorting: { 'invited.username': 'asc' },
|
sorting: { 'website.name': 'asc' },
|
||||||
total: 0,
|
total: 0,
|
||||||
count: config.table.count
|
count: config.table.count
|
||||||
}, { dataset: [] });
|
}, { dataset: [] });
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
angular.module('warehost')
|
angular.module('warehost')
|
||||||
.controller('PermissionWebCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
|
.controller('PermissionWebCtrl',function(session,config,alert,NgTableParams,$scope,$http,$stateParams){
|
||||||
$scope.tableParams = new NgTableParams({
|
$scope.tableParams = new NgTableParams({
|
||||||
sorting: { 'invited.username': 'asc' },
|
sorting: { 'login.username': 'asc' },
|
||||||
total: 0,
|
total: 0,
|
||||||
count: config.table.count
|
count: config.table.count
|
||||||
}, { dataset: [] });
|
}, { dataset: [] });
|
||||||
|
|
|
@ -58,7 +58,10 @@
|
||||||
<!-- build:js({.tmp,public}) app/app.js -->
|
<!-- build:js({.tmp,public}) app/app.js -->
|
||||||
<script src="app/app.js"></script>
|
<script src="app/app.js"></script>
|
||||||
<!-- injector:js -->
|
<!-- injector:js -->
|
||||||
|
<script src="app/host/database.js"></script>
|
||||||
|
<script src="app/host/domain.js"></script>
|
||||||
<script src="app/host/index.js"></script>
|
<script src="app/host/index.js"></script>
|
||||||
|
<script src="app/host/menu.js"></script>
|
||||||
<script src="app/index.js"></script>
|
<script src="app/index.js"></script>
|
||||||
<script src="app/invite.js"></script>
|
<script src="app/invite.js"></script>
|
||||||
<script src="app/main.js"></script>
|
<script src="app/main.js"></script>
|
||||||
|
|
Reference in New Issue