[host] make domain and database admin accessable
This commit is contained in:
parent
bd2f5b6698
commit
e1139d0fc0
|
@ -0,0 +1,29 @@
|
||||||
|
.container
|
||||||
|
h1 Database
|
||||||
|
table.table.table-bordered(ng-table="tableParams")
|
||||||
|
tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
|
||||||
|
td(data-title="'User'", filter="{'profil.login.username': 'text'}") {{item.profil.login.username}}
|
||||||
|
td(data-title="'Database/User'")
|
||||||
|
span(ng-if="!item.isEditing") warehost_user{{item.profil.ID}}_db{{item.ID}}
|
||||||
|
h4(ng-if="item.isEditing") Database: warehost_user{{item.profil.ID}}_db{{item.ID}}
|
||||||
|
form(name="myform",ng-if="item.isEditing")
|
||||||
|
.form-group
|
||||||
|
label(for="password") Password
|
||||||
|
input.form-control(id="password",name="password",ng-model="item.password",ng-minlength="3")
|
||||||
|
.form-group
|
||||||
|
label(for="comment") Comment
|
||||||
|
input.form-control(id="comment",name="comment",ng-model="item.comment")
|
||||||
|
button.btn.btn-primary(type="submit",ng-click="edit(item)")
|
||||||
|
span.glyphicon.glyphicon-floppy-disk
|
||||||
|
| Save
|
||||||
|
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="item.isEditing = true",ng-if="!item.isEditing")
|
||||||
|
span.glyphicon.glyphicon-pencil
|
||||||
|
span.btn.btn-default(ng-click="edit(item)",ng-if="item.isEditing")
|
||||||
|
span.glyphicon.glyphicon-remove-circle
|
||||||
|
span.btn.btn-default(ng-click="delete(item)")
|
||||||
|
span.glyphicon.glyphicon-trash
|
|
@ -0,0 +1,41 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('warehost')
|
||||||
|
.controller('DatabaseAdminHostCtrl',function(session,config,alert,NgTableParams,$scope,$rootScope,$http){
|
||||||
|
$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?filter=all').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();
|
||||||
|
$rootScope.$on('warehost.session',load);
|
||||||
|
|
||||||
|
$scope.edit = function(obj){
|
||||||
|
$http.patch(config.api+'/host/database/'+obj.ID,obj).then(submitresult);
|
||||||
|
};
|
||||||
|
$scope.delete = function(obj){
|
||||||
|
$http.delete(config.api+'/host/database/'+obj.ID).then(submitresult);
|
||||||
|
};
|
||||||
|
});
|
|
@ -0,0 +1,46 @@
|
||||||
|
.container
|
||||||
|
h1 Domains
|
||||||
|
table.table.table-bordered(ng-table="tableParams")
|
||||||
|
tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
|
||||||
|
td(data-title="'User'", filter="{'profil.login.username': 'text'}") {{item.profil.login.username}}
|
||||||
|
td(data-title="'Domain'", filter="{'fqdn': 'text'}")
|
||||||
|
span(ng-if="!item.isEditing") {{item.fqdn}}
|
||||||
|
h4(ng-if="item.isEditing") Domain: {{item.fqdn}}
|
||||||
|
form(name="myform",ng-if="item.isEditing")
|
||||||
|
.form-group
|
||||||
|
label(for="domain") Domain
|
||||||
|
input.form-control(id="domain",name="domain",ng-model="item.fqdn",ng-minlength="3")
|
||||||
|
.form-group
|
||||||
|
label
|
||||||
|
input(type="checkbox",ng-model="item.active")
|
||||||
|
| Active
|
||||||
|
.form-group
|
||||||
|
label
|
||||||
|
input(type="checkbox",ng-model="item.web")
|
||||||
|
| Web
|
||||||
|
.form-group
|
||||||
|
label
|
||||||
|
input(type="checkbox",ng-model="item.mail")
|
||||||
|
| Mail
|
||||||
|
button.btn.btn-primary(type="submit",ng-click="edit(item)")
|
||||||
|
span.glyphicon.glyphicon-floppy-disk
|
||||||
|
| Save
|
||||||
|
td(data-title="'Active'", filter="{'active': 'components/ngfilter-boolean.html'}")
|
||||||
|
span.glyphicon.glyphicon-ok(aria-hidden="true",ng-if="item.active")
|
||||||
|
span.glyphicon.glyphicon-lock(aria-hidden="true",ng-if="!item.active")
|
||||||
|
td(data-title="'Funktions'")
|
||||||
|
a(ng-if="item.mail && !item.isEditing && item.active")
|
||||||
|
span.glyphicon.glyphicon-envelope(aria-hidden="true")
|
||||||
|
| Mail
|
||||||
|
|
|
||||||
|
a(ng-if="item.web && !item.isEditing && item.active")
|
||||||
|
span.glyphicon.glyphicon-globe(aria-hidden="true")
|
||||||
|
| Web
|
||||||
|
td(data-title="'Option'")
|
||||||
|
.btn-group.btn-group-xs
|
||||||
|
span.btn.btn-default(ng-click="item.isEditing = true",ng-if="!item.isEditing")
|
||||||
|
span.glyphicon.glyphicon-pencil
|
||||||
|
span.btn.btn-default(ng-click="edit(item)",ng-if="item.isEditing")
|
||||||
|
span.glyphicon.glyphicon-remove-circle
|
||||||
|
span.btn.btn-default(ng-click="delete(item)")
|
||||||
|
span.glyphicon.glyphicon-trash
|
|
@ -0,0 +1,42 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('warehost')
|
||||||
|
.controller('DomainAdminHostCtrl',function(session,config,alert,NgTableParams,$rootScope,$scope,$http){
|
||||||
|
$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?filter=all').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();
|
||||||
|
$rootScope.$on('warehost.session',load);
|
||||||
|
|
||||||
|
$scope.edit = function(a){
|
||||||
|
$http.patch(config.api+'/host/domain/'+a.ID,a).then(submitresult);
|
||||||
|
};
|
||||||
|
$scope.delete = function(a){
|
||||||
|
$http.delete(config.api+'/host/domain/'+a.ID).then(submitresult);
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
|
@ -15,8 +15,8 @@
|
||||||
table.table.table-bordered(ng-table="tableParams")
|
table.table.table-bordered(ng-table="tableParams")
|
||||||
tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
|
tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
|
||||||
td(data-title="'Database/User'")
|
td(data-title="'Database/User'")
|
||||||
span(ng-if="!item.isEditing") warehost_user{{item.profil}}_db{{item.ID}}
|
span(ng-if="!item.isEditing") warehost_user{{item.profil.ID}}_db{{item.ID}}
|
||||||
h4(ng-if="item.isEditing") Database: warehost_user{{item.profil}}_db{{item.ID}}
|
h4(ng-if="item.isEditing") Database: warehost_user{{item.profil.ID}}_db{{item.ID}}
|
||||||
form(name="myform",ng-if="item.isEditing")
|
form(name="myform",ng-if="item.isEditing")
|
||||||
.form-group
|
.form-group
|
||||||
label(for="password") Password
|
label(for="password") Password
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
.form-group
|
.form-group
|
||||||
label(for="domain") Domain
|
label(for="domain") Domain
|
||||||
input.form-control(id="domain",name="domain",ng-model="obj.fqdn",ng-minlength="3")
|
input.form-control(id="domain",name="domain",ng-model="obj.fqdn",ng-minlength="3")
|
||||||
|
.form-group(ng-if="session.login.superadmin")
|
||||||
|
label
|
||||||
|
input(type="checkbox",ng-model="obj.active")
|
||||||
|
| Active
|
||||||
.form-group
|
.form-group
|
||||||
label
|
label
|
||||||
input(type="checkbox",ng-model="obj.web")
|
input(type="checkbox",ng-model="obj.web")
|
||||||
|
@ -19,13 +23,17 @@
|
||||||
| Save
|
| Save
|
||||||
table.table.table-bordered(ng-table="tableParams")
|
table.table.table-bordered(ng-table="tableParams")
|
||||||
tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
|
tr(ng-hide='group.$hideRows',ng-repeat="item in $data")
|
||||||
td(data-title="'Domain'")
|
td(data-title="'Domain'", filter="{'fqdn': 'text'}")
|
||||||
span(ng-if="!item.isEditing") {{item.fqdn}}
|
span(ng-if="!item.isEditing") {{item.fqdn}}
|
||||||
h4(ng-if="item.isEditing") Domain: {{item.fqdn}}
|
h4(ng-if="item.isEditing") Domain: {{item.fqdn}}
|
||||||
form(name="myform",ng-if="item.isEditing")
|
form(name="myform",ng-if="item.isEditing")
|
||||||
.form-group
|
.form-group
|
||||||
label(for="domain") Domain
|
label(for="domain") Domain
|
||||||
input.form-control(id="domain",name="domain",ng-model="item.fqdn",ng-minlength="3")
|
input.form-control(id="domain",name="domain",ng-model="item.fqdn",ng-minlength="3")
|
||||||
|
.form-group(ng-if="session.login.superadmin")
|
||||||
|
label
|
||||||
|
input(type="checkbox",ng-model="item.active")
|
||||||
|
| Active
|
||||||
.form-group
|
.form-group
|
||||||
label
|
label
|
||||||
input(type="checkbox",ng-model="item.web")
|
input(type="checkbox",ng-model="item.web")
|
||||||
|
@ -37,12 +45,15 @@
|
||||||
button.btn.btn-primary(type="submit",ng-click="edit(item)")
|
button.btn.btn-primary(type="submit",ng-click="edit(item)")
|
||||||
span.glyphicon.glyphicon-floppy-disk
|
span.glyphicon.glyphicon-floppy-disk
|
||||||
| Save
|
| Save
|
||||||
|
td(data-title="'Active'", filter="{'active': 'components/ngfilter-boolean.html'}")
|
||||||
|
span.glyphicon.glyphicon-ok(aria-hidden="true",ng-if="item.active")
|
||||||
|
span.glyphicon.glyphicon-lock(aria-hidden="true",ng-if="!item.active")
|
||||||
td(data-title="'Funktions'")
|
td(data-title="'Funktions'")
|
||||||
a(ng-if="item.mail && !item.isEditing")
|
a(ng-if="item.mail && !item.isEditing && item.active")
|
||||||
span.glyphicon.glyphicon-envelope(aria-hidden="true")
|
span.glyphicon.glyphicon-envelope(aria-hidden="true")
|
||||||
| Mail
|
| Mail
|
||||||
|
|
|
|
||||||
a(ng-if="item.web && !item.isEditing")
|
a(ng-if="item.web && !item.isEditing && item.active")
|
||||||
span.glyphicon.glyphicon-globe(aria-hidden="true")
|
span.glyphicon.glyphicon-globe(aria-hidden="true")
|
||||||
| Web
|
| Web
|
||||||
td(data-title="'Option'")
|
td(data-title="'Option'")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('warehost')
|
angular.module('warehost')
|
||||||
.config(['$stateProvider',function ($stateProvider) {
|
.config(['$stateProvider',function ($stateProvider) {
|
||||||
$stateProvider
|
$stateProvider
|
||||||
|
@ -47,5 +47,40 @@ angular.module('warehost')
|
||||||
controller:'DatabaseHostCtrl'
|
controller:'DatabaseHostCtrl'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.state('app.host.A', {
|
||||||
|
url:'/admin',
|
||||||
|
views:{
|
||||||
|
'@app':{
|
||||||
|
templateUrl: 'app/admin.html',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('app.host.A.profil', {
|
||||||
|
url:'/profil',
|
||||||
|
views:{
|
||||||
|
'@app':{
|
||||||
|
templateUrl: 'app/host/admin/domain.html',
|
||||||
|
controller:'DomainAdminHostCtrl'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('app.host.A.domain', {
|
||||||
|
url:'/domain',
|
||||||
|
views:{
|
||||||
|
'@app':{
|
||||||
|
templateUrl: 'app/host/admin/domain.html',
|
||||||
|
controller:'DomainAdminHostCtrl'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('app.host.A.database', {
|
||||||
|
url:'/database',
|
||||||
|
views:{
|
||||||
|
'@app':{
|
||||||
|
templateUrl: 'app/host/admin/database.html',
|
||||||
|
controller:'DatabaseAdminHostCtrl'
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,9 +1,24 @@
|
||||||
.navbar-text Hosting
|
ui.nav.navbar-nav
|
||||||
li
|
.navbar-text Hosting
|
||||||
a(ui-sref="app.host.index",ui-sref-active="active") Home
|
li
|
||||||
li(ng-if='!profil.ID')
|
a(ui-sref="app.host.index",ui-sref-active="active") Home
|
||||||
a(ui-sref="app.host.signup",ui-sref-active="active") Signup
|
li(ng-if='!profil.ID')
|
||||||
li(ng-if='profil.ID')
|
a(ui-sref="app.host.signup",ui-sref-active="active") Signup
|
||||||
a(ui-sref="app.host.domain",ui-sref-active="active") Domains
|
li(ng-if='profil.ID')
|
||||||
li(ng-if='profil.ID')
|
a(ui-sref="app.host.domain",ui-sref-active="active") Domains
|
||||||
a(ui-sref="app.host.database",ui-sref-active="active") Databases
|
li(ng-if='profil.ID')
|
||||||
|
a(ui-sref="app.host.database",ui-sref-active="active") Databases
|
||||||
|
|
||||||
|
ui.nav.navbar-nav.navbar-right
|
||||||
|
li.dropdown(ng-if="session.login.superadmin")
|
||||||
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
||||||
|
span.glyphicon.glyphicon-console
|
||||||
|
| Admin
|
||||||
|
span.caret
|
||||||
|
ul.dropdown-menu
|
||||||
|
li
|
||||||
|
a(ui-sref="app.host.A.profil") Profiles
|
||||||
|
li
|
||||||
|
a(ui-sref="app.host.A.domain") Domains
|
||||||
|
li
|
||||||
|
a(ui-sref="app.host.A.database") Databases
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
span.icon-bar
|
span.icon-bar
|
||||||
span.icon-bar
|
span.icon-bar
|
||||||
.navbar-collapse.collapse(uib-collapse="!isOpen")
|
.navbar-collapse.collapse(uib-collapse="!isOpen")
|
||||||
ui.nav.navbar-nav(ui-view="menu")
|
|
||||||
ui.nav.navbar-nav.navbar-right(ng-if="session.login.active")
|
ui.nav.navbar-nav.navbar-right(ng-if="session.login.active")
|
||||||
li.dropdown(ng-if="modules.length>0")
|
li.dropdown(ng-if="modules.length>0")
|
||||||
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
||||||
|
@ -55,6 +54,7 @@
|
||||||
.input-group-btn
|
.input-group-btn
|
||||||
button.btn.btn-default(type="submit")
|
button.btn.btn-default(type="submit")
|
||||||
span.glyphicon.glyphicon-log-in
|
span.glyphicon.glyphicon-log-in
|
||||||
|
div(ui-view="menu")
|
||||||
div(style="margin-top:53px;")
|
div(style="margin-top:53px;")
|
||||||
.container(ng-if="error.msg")
|
.container(ng-if="error.msg")
|
||||||
.alert.alert-danger(style="margin-top:20px;") {{error.msg}}
|
.alert.alert-danger(style="margin-top:20px;") {{error.msg}}
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
.navbar-text Website
|
ui.nav.navbar-nav
|
||||||
li.dropdown
|
.navbar-text Website
|
||||||
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false") {{website.name||'Websites'}}
|
li.dropdown
|
||||||
span.caret
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false") {{website.name||'Websites'}}
|
||||||
ul.dropdown-menu
|
span.caret
|
||||||
li
|
ul.dropdown-menu
|
||||||
a(ui-sref="app.web.index",ui-sref-active="active") Alle
|
li
|
||||||
li
|
a(ui-sref="app.web.index",ui-sref-active="active") Alle
|
||||||
a(href="",ng-click="add()") Add
|
li
|
||||||
li.dropdown-header Websites:
|
a(href="",ng-click="add()") Add
|
||||||
li(ng-repeat="item in list")
|
li.dropdown-header Websites:
|
||||||
a(ui-sref="app.webS.page({websiteid:item.website.ID})") {{item.website.name}}
|
li(ng-repeat="item in list")
|
||||||
li(ng-if="website.name")
|
a(ui-sref="app.webS.page({websiteid:item.website.ID})") {{item.website.name}}
|
||||||
a(ui-sref="app.webS.menu({websiteid:website.ID})") Menu
|
li(ng-if="website.name")
|
||||||
li(ng-if="website.name")
|
a(ui-sref="app.webS.menu({websiteid:website.ID})") Menu
|
||||||
a(ui-sref="app.webS.page({websiteid:website.ID})") Pages
|
li(ng-if="website.name")
|
||||||
li(ng-if="website.name")
|
a(ui-sref="app.webS.page({websiteid:website.ID})") Pages
|
||||||
a(ui-sref="app.webS.domain({websiteid:website.ID})") Domains
|
li(ng-if="website.name")
|
||||||
li(ng-if="website.name")
|
a(ui-sref="app.webS.domain({websiteid:website.ID})") Domains
|
||||||
a(ui-sref="app.webS.permission({websiteid:website.ID})") Permissions
|
li(ng-if="website.name")
|
||||||
|
a(ui-sref="app.webS.permission({websiteid:website.ID})") Permissions
|
||||||
|
|
|
@ -58,6 +58,8 @@
|
||||||
<!-- 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/admin/database.js"></script>
|
||||||
|
<script src="app/host/admin/domain.js"></script>
|
||||||
<script src="app/host/database.js"></script>
|
<script src="app/host/database.js"></script>
|
||||||
<script src="app/host/domain.js"></script>
|
<script src="app/host/domain.js"></script>
|
||||||
<script src="app/host/index.js"></script>
|
<script src="app/host/index.js"></script>
|
||||||
|
|
Reference in New Issue