admin_machines.html.ep 12.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html ng-app="ravada.app">
%= include 'bootstrap/header'
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top" role="document">
    <div id="wrapper">
    <div ng-controller="machinesPage">
    %= include 'bootstrap/navigation'
    <div id="page-wrapper">
      <div id="admin-content">
10
11
<div class="panel-body">
    <div class="col-lg-12">
joansp's avatar
joansp committed
12
      <div ng-show="pingbe_fail" class="alert alert-danger" ng-cloak>
joansp's avatar
joansp committed
13
14
        <strong>Error!</strong> Backend no available!
      </div>
15
16
        <div class="row">
            <div class="col-md-8"><h2>Virtual Machines</h2></div>
17
            <div class="col-md-4" align="right">
18
19
20
21
22
23
24
25
26
27
28
                <h2>
                    <a type="button" class="btn btn-success" href="/new_machine.html">
                        <b><%=l 'New Machine' %></b>
                    <i ng-show="download_working"
                        class="fa fa-angle-double-down" aria-hidden="true"></i>
                    <i ng-show="download_done && !download_working"
                        class="fa fa-check" aria-hidden="true"></i>
                    </a>
                </h2>
            </div>
        </div>
29
%=      include 'bootstrap/requests'
30

31
        <table class="table table-striped admin-cont-body" border="0">
32
33
            <thead>
                <tr>
amesones's avatar
amesones committed
34
35
36
                    <th class="lgMachName machine-button"
                     ng-click="orderMachineList('name','')">
                      <i class="fa fa-exchange fa-rotate-90"
37
                       ng-hide="orderParam[0] === 'name' || orderParam[0] === '-name'"></i>
amesones's avatar
amesones committed
38
                      <i class="fa fa-arrow-down" ng-cloak
39
                       ng-hide="orderParam[0] !== 'name'"></i>
amesones's avatar
amesones committed
40
                      <i class="fa fa-arrow-up" ng-cloak
41
                       ng-hide="orderParam[0] !== '-name'"></i>
42
                      <%=l 'Machine Name' %></th>
43
44
45
                    <th class="lgMachToggle">
                      <i class="fa machine-button"
                       ng-class="{ 'fa-eye':!hide_clones, 'fa-eye-slash':hide_clones }"
amesones's avatar
amesones committed
46
47
                       ng-click="hideClones()"
                       title="<%=l 'Show/Hide clones' %>"></i>
48
                      <%=l 'Base' %></th>
fv3rdugo's avatar
fv3rdugo committed
49
                    <th class="lgMachToggle"><%=l 'Public'%></th>
amesones's avatar
amesones committed
50
51
52
                    <th class="lgMachToggle machine-button"
                     ng-click="orderMachineList('is_active','is_paused')">
                      <i class="fa fa-exchange fa-rotate-90"
53
                       ng-hide="orderParam[0] === 'is_active' || orderParam[0] === '-is_active'"></i>
amesones's avatar
amesones committed
54
                      <i class="fa fa-arrow-down" ng-cloak
55
                       ng-hide="orderParam[0] !== 'is_active'"></i>
amesones's avatar
amesones committed
56
                      <i class="fa fa-arrow-up" ng-cloak
57
                       ng-hide="orderParam[0] !== '-is_active'"></i>
58
                      <%=l 'Status' %></th>
fv3rdugo's avatar
fv3rdugo committed
59
                    <th class="lgMachActions"><%=l 'Actions' %></th>
60
61
62
                </tr>
            </thead>
            <tbody>
63
                <tr ng-repeat-start="machine in list_machines | orderBy : orderParam">
64
                    <td class="lgMachName">
65
                        <a align="right" href="/machine/settings/{{machine.id}}.html"
fv3rdugo's avatar
fv3rdugo committed
66
                        title ="<%=l 'Machine settings' %>"><i class="fa fa-fw fa-cog"></i></a>
amesones's avatar
amesones committed
67
                        <b ng-cloak>{{machine.name}}</b>
68
                    </td>
69
                    <td class="lgMachToggle">
70
                        <i ng-show="{{machine.has_clones}}" class="fa fa-check" aria-hidden="true"
fv3rdugo's avatar
fv3rdugo committed
71
                        title ="<%=l 'Cannot remove base, machine has clones' %>" ng-cloak></i>
72
                        <input type="checkbox" checked 
73
                               ng-show="can_remove_base(machine)"
74
                            ng-click="action('machine','remove_base',machine.id)"
fv3rdugo's avatar
fv3rdugo committed
75
                            title ="<%=l 'Remove base' %>" ng-cloak>
76
                        <input type="checkbox" 
77
                               ng-show="can_prepare_base(machine)"
78
                            ng-click="action('machine','prepare',machine.id)"
fv3rdugo's avatar
fv3rdugo committed
79
                            title ="<%=l 'Prepare base' %>" ng-cloak>
joansp's avatar
joansp committed
80
                    </td>
81
                    <td class="lgMachToggle">
fv3rdugo's avatar
fv3rdugo committed
82
                        <input type="checkbox" checked ng-show="{{machine.is_public}}" ng-click="set_public(machine.id,0)" title="<%=l 'Make private'%>">
83

fv3rdugo's avatar
fv3rdugo committed
84
                         <input type="checkbox" ng-hide="{{machine.is_public}}" ng-click="set_public(machine.id,1)" title="<%=l 'Make public' %>"></td>
85
                    <td class="lgMachActions">
amesones's avatar
amesones committed
86
                        <span style="float:right;" ng-show="{{machine.is_paused && machine.is_active}}" class="label label-warning" ng-cloak><%=l 'Paused' %></span>
87
                        <span style="float:right;" ng-show="{{!machine.is_paused && machine.is_active}}" class="label label-success" ng-cloak><%=l 'Running' %></span>
88
                        <span style="float:right;" ng-show="{{!machine.is_active && !machine.is_hibernated}}" class="label label-danger" ng-cloak><%=l 'Down' %></span>
89
90
                        <span style="float:right;" ng-show="{{machine.is_hibernated}}" class="label label-warning" ng-cloak><%=l 'Hibernated' %></span>
                        <br><span style="float:right;" ng-show="{{machine.is_active}}" class="label label-default">{{machine.remote_ip}}</span>
91
                    </td>
92
                    <td class="lgMachToggle">
93

94
                      <div ng-hide="{{machine.is_locked}}">
95
96
97
98
99
100
                        <a type="button" class="btn btn-success btn-sm"
                         ng-click="action('machine','start',machine.id)"
                         ng-disabled="machine.is_active"
                         title="<%=l 'Start' %>">
                          <i class="fa fa-play"></i>
                        </a>
101
102
103
104
105
106
                        <a type="button" class="btn btn-warning btn-sm"
                         ng-click="action('machine','hybernate',machine.id)"
                         ng-disabled="!machine.is_active"
                         title="<%=l 'Hybernate' %>">
                          <i class="fa fa-pause"></i>
                       </a>
107
108
109
                        <a type="button" class="btn btn-danger btn-sm"
                         ng-click="action('machine','shutdown',machine.id)"
                         ng-disabled="!machine.is_active"
110
                         title="<%=l 'ShutDown' %>">    
111
112
113
114
115
116
117
118
119
120
121
122
123
                          <i class="fa fa-power-off"></i>
                       </a>
                        <a type="button" class="btn btn-primary btn-sm"
                         ng-href="/machine/view/{{machine.id}}.html"
                         title="<%=l 'View' %>">
                          <i class="fa fa-desktop"></i>
                        </a>
                        <a type="button" class="btn btn-primary btn-sm"
                         ng-click="action('machine','screenshot',machine.id)"
                         ng-disabled="!machine.is_active"
                         title="<%=l 'Screenshot' %>">
                         <i class="fa fa-camera" aria-hidden="true"></i>
                       </a>
124
                      </div>
125
                      <div ng-show="{{machine.is_locked}}" ng-cloak>Machine locked by <a href="/request/{{machine.is_locked}}.html">process</a></div>
126
127
                    </td>
                </tr>
128
129
                    <tr ng-hide="hide_clones" ng-repeat="child in machine.childs | orderBy : orderParam">
                      <td class="lgMachName">
130
131
                          &nbsp;<i title="[cloned]" class="fa fa-fw fa-long-arrow-right"
                              style="color:white"></i>
132
133
                          <a align="right" href="/machine/settings/{{child.id}}.html"
                          title ="Machine settings"><i class="fa fa-fw fa-cog"></i></a>
134
135
                          <i ng-cloak>&nbsp;{{child.name}}</i>
                          <span style="color:gray">[ Cloned ]</span>
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
                      </td>
                      <td class="lgMachToggle">
                          <i ng-show="{{child.has_clones}}" class="fa fa-check" aria-hidden="true"
                          title ="Cannot remove base, machine has clones" ng-cloak></i>
                          <input type="checkbox" checked
                                 ng-show="{{child.is_base}} && !{{child.has_clones}} && !{{child.is_locked}}"
                              ng-click="action('machine','remove_base',child.id)"
                              title ="Remove base" ng-cloak>
                          <input type="checkbox"
                                 ng-show="!{{child.is_base}} && !{{child.is_locked}}"
                              ng-click="action('machine','prepare',child.id)"
                              title ="Prepare base" ng-cloak>
                      </td>
                      <td class="lgMachToggle">
                          <input type="checkbox" checked ng-show="{{child.is_public}}" ng-click="set_public(child.id,0)" title="Make private">

                           <input type="checkbox" ng-hide="{{child.is_public}}" ng-click="set_public(child.id,1)" title="Make public"></td>
                      <td class="lgMachActions">
                          <span style="float:right;" ng-show="{{child.is_paused && child.is_active}}" class="label label-warning" ng-cloak><%=l 'Paused' %></span>
155
                          <span style="float:right;" ng-show="{{!child.is_paused && child.is_active}}" class="label label-success" ng-cloak><%=l 'Running' %></span>
156
157
                          <span style="float:right;" ng-show="{{!child.is_active && !child.is_hibernated}}" class="label label-danger" ng-cloak><%=l 'Down' %></span>
                          <span style="float:right;" ng-show="{{child.is_hibernated}}" class="label label-warning" ng-cloak><%=l 'Hibernated' %></span>
158
                          <br><span style="float:right;" ng-show="{{child.is_active}}" class="label label-default">{{machine.remote_ip}}</span>
159
160
161
162
163
164
165
166
167
168
                      </td>
                      <td class="lgMachToggle">

                        <div ng-hide="{{child.is_locked}}">
                          <a type="button" class="btn btn-success btn-sm"
                           ng-click="action('machine','start',child.id)"
                           ng-disabled="child.is_active"
                           title="<%=l 'Start' %>">
                            <i class="fa fa-play"></i>
                          </a>
169
170
171
172
173
174
                          <a type="button" class="btn btn-warning btn-sm"
                            ng-click="action('machine','hybernate',child.id)"
                            ng-disabled="!child.is_active"
                            title="<%=l 'Hybernate' %>">
                            <i class="fa fa-pause"></i>
                          </a>
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
                          <a type="button" class="btn btn-danger btn-sm"
                           ng-click="action('machine','shutdown',child.id)"
                           ng-disabled="!child.is_active"
                           title="<%=l 'ShutDown' %>">
                            <i class="fa fa-power-off"></i>
                         </a>
                          <a type="button" class="btn btn-primary btn-sm"
                           ng-href="/machine/view/{{child.id}}.html"
                           title="<%=l 'View' %>">
                            <i class="fa fa-desktop"></i>
                          </a>
                          <a type="button" class="btn btn-primary btn-sm"
                           ng-click="action('machine','screenshot',child.id)"
                           ng-disabled="!child.is_active"
                           title="<%=l 'Screenshot' %>">
                           <i class="fa fa-camera" aria-hidden="true"></i>
                         </a>
                        </div>
193
                        <div ng-show="{{child.is_locked}}" ng-cloak>Machine locked by <a href="/request/{{child.is_locked}}.html">process</a></div>
194
195
                      </td>
                    </tr>
amesones's avatar
amesones committed
196
                    <tr ng-repeat-end ng-hide="true"></tr>
197
            </tbody>
joansp's avatar
joansp committed
198
        </table>
joansp's avatar
joansp committed
199
    </div>
200
</div>
201
202
203
204
205
206
</div>
</div>
</div>
</div>
%= include 'bootstrap/scripts'
%= include 'bootstrap/footer'
207
208
%= include 'bootstrap/messages'

209
210
</body>
</html>