Commit b0271f5c authored by fv3rdugo's avatar fv3rdugo
Browse files

wip(frontend): dropdown actions

Issue #1407
parent 0bd884c4
......@@ -41,6 +41,21 @@
<div class="row">
<a type="button" class="btn btn-success mr-2" ng-hide="machine.action"
href="/machine/clone/{{machine.id}}.html"><strong><i class="fa fa-play" aria-hidden="true"></i>&nbsp;<%=l 'Start' %></strong></a>
<div class="dropdown">
<button ng-show="machine.is_active && !machine.action" class="btn btn-secondary dropdown-toggle"
ng-click="$parent.refresh=20" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><%=l 'action'%>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a ng-show="machine.can_remove" class="dropdown-item"
ng-click="host_restore=machine.id_clone"><%=l 'Restore' %></a>
<a ng-show="machine.is_active" class="dropdown-item"
ng-click="machine.action=false;action(machine,'shutdown')"><%=l 'Shutdown'%></a>
<a ng-show="machine.is_active && machine.can_hibernate" class="dropdown-item"
ng-click="machine.action=false;action(machine,'hibernate')"><%=l 'Hibernate' %></a>
<a class="dropdown-item" href="#"><%=l 'Poweroff' %></a>
</div>
</div>
<a type="button" class="btn btn-danger text-white"
ng-show="machine.id_clone && !machine.is_active && machine.can_remove && !host_restore"
ng-click="host_restore=machine.id_clone;machine.action=true "
......@@ -56,32 +71,6 @@
ng-click="restore(machine.id_clone);host_restore=0;machine.action=false"
><%=l 'Yes' %></a>
</div>
<a ng-show="machine.is_active && !machine.action"
class="btn btn-outline-secondary"
ng-click="machine.action=true;$parent.refresh=20"
type="button"><%=l 'action'%></a>
<div class="btn-group"
ng-show="machine.action && !host_restore"
>
<button type="button" class="btn btn-outline-dark btn-sm"
ng-show="machine.can_remove"
ng-click="host_restore=machine.id_clone"
><%=l 'Restore' %></button>
<button ng-show="machine.is_active" type="button"
class="btn btn-outline-dark btn-sm"
ng-click="machine.action=false;action(machine,'shutdown')"
><%=l 'Shutdown'%></button>
<button ng-show="machine.is_active && machine.can_hibernate" type="button"
class="btn btn-outline-dark"
ng-click="machine.action=false;action(machine,'hibernate')"
><%=l 'Hibernate' %></button>
<a
ng-click="machine.action=false"
><i class="align-bottom fas fa-chevron-circle-left"></i></a>
</div>
% if ($user
% && ( $user->can_change_settings || $user->can_change_settings_all)){
<a ng-show="machine.id_clone && !machine.action && host_restore != machine.id_clone"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment