Merge pull request #74 from gruppe-adler/server-clone

add button to clone server configuration
This commit is contained in:
Björn Dahlgren 2017-10-01 03:48:31 +02:00 committed by GitHub
commit a7126bce86
4 changed files with 16 additions and 1 deletions

View File

@ -16,13 +16,21 @@ define(function (require) {
template: template,
events: {
"click .delete": "delete"
"click .clone": "clone",
"click .delete": "delete",
},
modelEvents: {
"change": "serverUpdated",
},
clone: function (e) {
var title = this.model.get('title') + ' Clone';
var clone = this.model.clone();
clone.set({id: null, title: title});
clone.save();
},
delete: function (event) {
var self = this;
sweetAlert({

View File

@ -17,6 +17,7 @@ define(function (require) {
events: {
"click button.delete": "delete",
"change input#parameter": "changed",
"click button.clone": "clone",
},
changed: function (e) {

View File

@ -5,6 +5,7 @@
<th>Port</th>
<th>Title</th>
<th></th>
<th></th>
</tr>
</thead>

View File

@ -13,6 +13,11 @@
<td style="width: 100%;">
<a href='#servers/<%-id%>'><%-title%></a>
</td>
<td>
<button type="button" class="btn btn-success btn-xs clone pull-right">
<span class="glyphicon glyphicon-plus-sign"></span> Clone
</button>
</td>
<td>
<button type="button" class="btn btn-danger btn-xs delete pull-right">
<span class="glyphicon glyphicon-trash"></span> Delete