mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Merge pull request #74 from gruppe-adler/server-clone
add button to clone server configuration
This commit is contained in:
commit
a7126bce86
@ -16,13 +16,21 @@ define(function (require) {
|
|||||||
template: template,
|
template: template,
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
"click .delete": "delete"
|
"click .clone": "clone",
|
||||||
|
"click .delete": "delete",
|
||||||
},
|
},
|
||||||
|
|
||||||
modelEvents: {
|
modelEvents: {
|
||||||
"change": "serverUpdated",
|
"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) {
|
delete: function (event) {
|
||||||
var self = this;
|
var self = this;
|
||||||
sweetAlert({
|
sweetAlert({
|
||||||
|
@ -17,6 +17,7 @@ define(function (require) {
|
|||||||
events: {
|
events: {
|
||||||
"click button.delete": "delete",
|
"click button.delete": "delete",
|
||||||
"change input#parameter": "changed",
|
"change input#parameter": "changed",
|
||||||
|
"click button.clone": "clone",
|
||||||
},
|
},
|
||||||
|
|
||||||
changed: function (e) {
|
changed: function (e) {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<th>Port</th>
|
<th>Port</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
<td style="width: 100%;">
|
<td style="width: 100%;">
|
||||||
<a href='#servers/<%-id%>'><%-title%></a>
|
<a href='#servers/<%-id%>'><%-title%></a>
|
||||||
</td>
|
</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>
|
<td>
|
||||||
<button type="button" class="btn btn-danger btn-xs delete pull-right">
|
<button type="button" class="btn btn-danger btn-xs delete pull-right">
|
||||||
<span class="glyphicon glyphicon-trash"></span> Delete
|
<span class="glyphicon glyphicon-trash"></span> Delete
|
||||||
|
Loading…
Reference in New Issue
Block a user