list_bases_ng.html.ep 6.82 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
<!DOCTYPE html>
<html ng-app="ravada.app">
%= include 'bootstrap/header'
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
<div id="wrapper">
%= include 'bootstrap/navigation'
<script>
    $_anonymous=<%= ($_anonymous or 0) %>;
</script>

11
<div id="page-wrapper" ng-controller="bases" ng-init="is_admin=<%= $user->is_admin %>;anonymous=<%= $_anonymous or 0 %>;subscribe_list_machines_user('<%= url_for('ws_subscribe')->to_abs %>', $scope)">
12
13
%= include 'main/list_bases_ng_head'
    <!--MACHINES SELECTION-->
14
    <div class="card-body">
15
    <div ng-repeat="machine in machines | orderBy: 'id_clone'"
16
         class="col-sm-4  d-inline-block mb-2"
17
                ng-show="machine.is_public || (!machine.is_public && !only_public)">
Fernando Verdugo's avatar
Fernando Verdugo committed
18
19
20
        <div class="card card-success">
            <div class="card-header" id="step1" >
                <h3 class="card-title">
21
22
23
                    <a class="btn btn-link"
                        href="/machine/clone/{{machine.id}}.html"
                        role="button">{{machine.name}}</a>
Fernando Verdugo's avatar
Fernando Verdugo committed
24
                    <i ng-show="!machine.is_public"><i class="far fa-eye-slash fa-xs" title="<%=l 'not public' %>"></i></i>
25
                </h3>
26
                <div class="container">
27
                 <a ng-show="machine.screenshot" href="/machine/clone/{{machine.id}}.html"><img
28
                    ng-src="data:image/png;base64,{{machine.screenshot}}" alt="{{machine.name}}" class="img-thumbnail" width="260"
29
                    ></a>
30
31
                <a ng-show="!machine.screenshot" href="/machine/clone/{{machine.id}}.html"><img
                    src="/img/default_screenshot.png" class="screenshot-default img-thumbnail"
32
33
34
35
36
37
38
                    alt="{{machine.name}}" width="260"
                    ></a>
                <div ng-show="machine.description || (!machine.description && is_admin)" class="overlay">
                    <div ng-show="machine.description" class="text" ng-bind-html="machine.description"></div>
                    <div ng-show="!machine.description" class="text"><a style="background-color: white; pointer-events: auto;" href="/machine/manage/{{machine.id}}.html#v-pills-description"><%=l 'Add description' %></a></div>
                </div>
                </div>
39
            </div>
Fernando Verdugo's avatar
Fernando Verdugo committed
40
            <div class="card-body" id="step2">
41
42
43
44
45
46
47
48
49
50
51
52
53
              <div ng-show="(confirmingMachineStopOnNewMachineStartData) && (confirmingMachineStopOnNewMachineStartData.action === 'start')" class="row alert alert-warning" role="alert">
                <div>
                    <span><%=l 'One of the machines that are currently running will be shutdown.' %></span>
                    <br>
                    <span><%=l 'Continue?' %></span>
                    <br>
                </div>
                <div class="pull-right">
                  <input type="button" class="btn btn-danger btn-xs" value="<%=l 'Yes' %>" ng-click="confirmingMachineStopOnNewMachineStartDataDone()">
                  <input type="button" class="btn btn-primary btn-xs" value="<%=l 'No' %>" ng-click="confirmingMachineStopOnNewMachineStartDataCancelled()">
                </div>
                <br>
              </div>
54
                <div class="row">
55
                <a type="button" class="btn btn-success mr-2" ng-hide="machine.action"
56
                   ng-click="action(machine,'start')"><strong><i class="fa fa-play" aria-hidden="true"></i>&nbsp;<%=l 'Start' %></strong></a>
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
                    <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">
                                <i class="fa fa-angle-double-left" aria-hidden="true"></i>&nbsp;<%=l 'Restore' %></a>
                            <a ng-show="machine.is_active" class="dropdown-item"
                                ng-click="machine.action=false;action(machine,'shutdown')">
                                <i class="fa fa-angle-double-down" aria-hidden="true"></i>&nbsp;<%=l 'Shutdown'%></a>
                            <a ng-show="machine.is_active && machine.can_hibernate" class="dropdown-item"
                                ng-click="machine.action=false;action(machine,'hibernate')">
                                <i class="fa fa-snowflake" aria-hidden="true"></i>&nbsp;<%=l 'Hibernate' %></a>
                            <a ng-show="machine.is_active" class="dropdown-item"
                                ng-click="machine.action=false;action(machine,'force_shutdown')">
                                <i class="fa fa-times" aria-hidden="true"></i>&nbsp;<%=l 'Poweroff' %></a>
                        </div>
                    </div>
Fernando Verdugo's avatar
Fernando Verdugo committed
77
                <a type="button" class="btn btn-danger text-white"
78
79
                    ng-show="machine.id_clone && !machine.is_active && machine.can_remove && !host_restore"
                    ng-click="host_restore=machine.id_clone;machine.action=true "
80
81
82
83
84
                    ><strong><i class="fas fa-redo" aria-hidden="true"></i>&nbsp;<%=l 'Restore' %></strong></a>
                    <div ng-show="machine.id_clone && host_restore == machine.id_clone">
                        <b><%=l 'Restore' %></b> <%=l 'will remove all the contents of the machine' %>
                        <i><b>{{machine.name_clone}}</b></i>.
                        <%=l 'Are you sure?' %><br/>
Fernando Verdugo's avatar
Fernando Verdugo committed
85
                        <a type="button" class="btn btn-primary text-white"
86
                            ng-click="host_restore=0; machine.action=false"
87
                        ><%=l 'No' %></a>
Fernando Verdugo's avatar
Fernando Verdugo committed
88
                        <a type="button" class="btn btn-danger text-white"
89
                            ng-click="restore(machine.id_clone);host_restore=0;machine.action=false"
90
91
                            ><%=l 'Yes' %></a>
                    </div>
Francesc Guasch's avatar
Francesc Guasch committed
92
93
%			        if ($user
%                       && ( $user->can_change_settings || $user->can_change_settings_all)){
94
                        <a ng-show="machine.id_clone && !machine.action && host_restore != machine.id_clone"
Fernando Verdugo's avatar
Fernando Verdugo committed
95
                            align="right" href="/machine/manage/{{machine.id_clone}}.html"><i class="fa fa-fw fa-cog" title="<%=l 'Settings' %>"></i></a>
96
%                   }
97
                    </div>
98
99
100
            </div>
        </div>
    </div>
Fernando Verdugo's avatar
Fernando Verdugo committed
101
    </div><!-- card body -->
102
103
104
105
106
107
108
109
110
111
112
</div><!-- page wrapper -->
%= include 'bootstrap/scripts'

</div><!-- wrapper -->

<style>
.introjs-tooltip {
    min-width: 450px;
}
</style>

113
%= include $footer
114
115
116
%= include 'bootstrap/messages'
</body>
</html>