Revision f3632e8d ui/templates/standard.html
b/ui/templates/standard.html | ||
---|---|---|
13 | 13 |
<a href="#" class="action-start">{% trans "Start" %}</a> |
14 | 14 |
<a href="#" class="action-reboot">{% trans "Reboot" %}</a> |
15 | 15 |
<a href="#" class="action-shutdown">{% trans "Shutdown" %}</a> |
16 |
<a href="#" class="more">{% trans "more …" %}</a>
|
|
16 |
<a href="#" class="action-destroy">{% trans "Destroy" %}</a>
|
|
17 | 17 |
</div> |
18 | 18 |
<div class="state"> |
19 | 19 |
<div class="status">{% trans "Running" %}</div> |
... | ... | |
121 | 121 |
return false; |
122 | 122 |
}); |
123 | 123 |
|
124 |
// intercept destroy click |
|
125 |
$("div.actions a.action-destroy").live('click', function(){ |
|
126 |
var serverID = $(this).parent().parent().attr("id"); |
|
127 |
var serverName = $(this).parent().prevAll("a.name").find("span.name").text(); |
|
128 |
var found = false; |
|
129 |
$(this).parent().children('a').removeClass('selected'); |
|
130 |
$(this).addClass('selected'); |
|
131 |
$(this).parent().addClass('display') |
|
132 |
$(this).parent().parent().find('.action_error').hide(); |
|
133 |
|
|
134 |
for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it |
|
135 |
if (pending_actions[i][1]==serverID){ |
|
136 |
pending_actions[i][0] = start; |
|
137 |
found = true |
|
138 |
} |
|
139 |
} |
|
140 |
if (!found) // no pending action for this server was found, so let's just add it to the list |
|
141 |
pending_actions.push([destroy, serverID, serverName]) |
|
142 |
update_confirmations(); |
|
143 |
return false; |
|
144 |
}); |
|
145 |
|
|
124 | 146 |
$("div.confirm_single .yes").live('click', function(){ |
125 | 147 |
var serverID = $(this).parent().parent().attr("id"); |
126 | 148 |
for (i=0;i<pending_actions.length;i++){ // if there is a pending action for this server execute it |
Also available in: Unified diff