Merge "Instance table minor fixes."
This commit is contained in:
commit
8d9633d522
@ -59,6 +59,11 @@ class TerminateInstance(tables.BatchAction):
|
||||
data_type_plural = _("Instances")
|
||||
classes = ('btn-danger', 'btn-terminate')
|
||||
|
||||
def allowed(self, request, instance=None):
|
||||
if instance:
|
||||
return instance.status != "PAUSED"
|
||||
return True
|
||||
|
||||
def action(self, request, obj_id):
|
||||
api.server_delete(request, obj_id)
|
||||
|
||||
|
@ -48,6 +48,8 @@ class SyspanelInstancesTable(tables.DataTable):
|
||||
)
|
||||
STATUS_CHOICES = (
|
||||
("active", True),
|
||||
("suspended", True),
|
||||
("paused", True),
|
||||
("error", False),
|
||||
)
|
||||
TASK_DISPLAY_CHOICES = (
|
||||
|
Loading…
Reference in New Issue
Block a user