mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Allow to delete domain from admin.
This commit is contained in:
parent
0dbe01e399
commit
ba9692e966
2 changed files with 22 additions and 7 deletions
13
js/app.js
13
js/app.js
|
@ -481,6 +481,19 @@ app = Sammy('#main', function (sam) {
|
|||
}, 'POST', params);
|
||||
});
|
||||
|
||||
sam.get('#/domains/:domain/delete', function (c) {
|
||||
if (confirm('Are you sure you want to delete '+ c.params['domain'] +' ?')) {
|
||||
c.api('/domains/'+ c.params['domain'], function(data) { // http://api.yunohost.org/#!/domain/domain_remove_delete_3
|
||||
store.clear('slide');
|
||||
c.redirect('#/domains');
|
||||
}, 'DELETE');
|
||||
} else {
|
||||
store.clear('slide');
|
||||
c.redirect('#/domains');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Apps
|
||||
*
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
<div class="br"></div>
|
||||
|
||||
<div class="list-group">
|
||||
{{#Domains}}
|
||||
<a href="#/domains/{{.}}" class="list-group-item slide">
|
||||
<h4 class="pull-left list-group-item-heading">{{.}}</h4>
|
||||
<span class="glyphicon glyphicon-chevron-right pull-right"></span>
|
||||
<div class="clearfix"></div>
|
||||
{{#Domains}}
|
||||
<div class="list-group-item">
|
||||
<a href="#/domains/{{.}}/delete" class="btn btn-danger slide back pull-right">
|
||||
<span class="glyphicon glyphicon-trash"></span> Delete
|
||||
</a>
|
||||
{{/Domains}}
|
||||
<h2 class="list-group-item-heading">{{.}}</h2>
|
||||
<a href="https://{{.}}" target="_blank">https://{{.}}</a>
|
||||
</div>
|
||||
{{/Domains}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue