Commit 765d3fcd authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Merge branch 'develop' of https://github.com/UPC/ravada into develop

parents f8d3fffa 8b86a495
......@@ -2863,7 +2863,7 @@ Sets a domain option:
=cut
sub set_option($self, $option, $value) {
my %valid_option = map { $_ => 1 } qw( description run_timeout volatile_clones id_owner);
my %valid_option = map { $_ => 1 } qw(autostart description run_timeout volatile_clones id_owner);
die "ERROR: Invalid option '$option'"
if !$valid_option{$option};
......
......@@ -506,9 +506,9 @@ sub list_vms($self, $type=undef) {
$row->{bases}= $self->_list_bases_vm($row->{id});
$row->{machines}= $self->_list_machines_vm($row->{id});
$row->{type} = $row->{vm_type};
$row->{action_remove} = 'disabled' if length defined $row->{machines}[0] > 0;
$row->{action_remove} = 'disabled' if length defined $row->{machines}[0];
$row->{action_remove} = 'disabled' if $row->{hostname} eq 'localhost';
$row->{action_remove} = 'disabled' if length defined $row->{bases}[0] > 0;
$row->{action_remove} = 'disabled' if length defined $row->{bases}[0];
$row->{is_local} = 0;
$row->{is_local} = 1 if $row->{hostname} =~ /^(localhost|127)/;
delete $row->{vm_type};
......
......@@ -388,3 +388,9 @@ ul.alert-dropdown {
opacity: 0.5;
filter: alpha(opacity=50); /* For IE8 and earlier */
}
.nav-pills .nav-link.active.remove,
.show>.nav-pills .nav-link{
color: white;
background-color: #d73a49 !important
}
\ No newline at end of file
......@@ -1805,7 +1805,7 @@ sub manage_machine {
}
}
for my $option (qw(description run_timeout volatile_clones id_owner)) {
for my $option (qw(autostart description run_timeout volatile_clones id_owner)) {
next if $option eq 'description' && !$c->param('btn_description');
next if $option ne 'description' && !$c->param('btn_options');
......@@ -1817,7 +1817,7 @@ sub manage_machine {
my $old_value = $domain->_data($option);
my $value = $c->param($option);
$value= 0 if $option eq 'volatile_clones' && !$value;
$value= 0 if $option =~ /volatile_clones|autostart/ && !$value;
if ( $option eq 'run_timeout' ) {
$value = 0 if !$value;
......
<div id="requests" class="panel panel-primary"
<div class="alert alert-light border-primary text-primary" role="alert" id="requests"
ng-show="requests[0]"
ng-controler="requestsCtrl">
<div class="panel-heading"><b>Requests</b></div>
<div class="panel-body">
<h6 class="font-weight-bold">Requests</h6>
<div ng-repeat="request in requests">
<font color="darkgray">{{request.date}} |</font>
<span class="badge badge-pill badge-light">{{request.date}} |</span>
{{request.command}}
<b>{{request.domain}}</b>
<i>{{request.status}}</i>
<font color="darkblue">{{request.error}}</font>
</div>
<span class="badge badge-pill badge-light">{{request.error}}</span>
</div>
</div>
......@@ -65,6 +65,7 @@
<i class="fa fa-window-close"></i>
</button>
<button type="button" class="btn btn-danger btn-sm {{node.action_remove}}"
ng-disabled="node.action_remove == 'disabled'"
ng-click="node_remove(node.id)"
title="<%=l 'Remove' %>">
<i class="fa fa-trash"></i>
......
......@@ -11,9 +11,9 @@
<div id="page-wrapper" ng-controller="bases" ng-init="anonymous=<%= $_anonymous or 0 %>;list_machines_user();">
%= include 'main/list_bases_ng_head'
<!--MACHINES SELECTION-->
<div class="card-body">
<div ng-repeat="machine in machines"
class="col-sm-4 d-inline-block mb-2"
<div class="panel-body">
<div ng-repeat="machine in machines | orderBy: 'id_clone'"
class="col-sm-4"
ng-show="machine.is_public || (!machine.is_public && !only_public)">
<div class="card card-success">
<div class="card-header" id="step1" >
......
<div ng-show="name == 'network' && item.edit" class="form-group mt-4">
<div class="row">
<div class="col-lg-1">
<p class="text-right"><%=l 'bus' %></p>
</div>
<div class="col-lg-3">
<select ng-model="item.driver"
ng-options="model for model in showmachine.drivers['network']"
>
</select>
</div>
</div>
<div class="row">
<div class="col-lg-1">
<p class="text-right"><%=l 'type' %></p>
</div>
<div class="col-lg-1">
<select ng-model="item.type"
ng-change="network_edit[$index]=true"
ng-options="type for type in ['bridge','NAT']"
<ul class="list-group list-group-horizontal-md">
<li class="list-group-item list-group-item-primary"><%=l 'bus' %></li>
<li class="list-group-item">
<select ng-model="item.driver"
ng-options="model for model in showmachine.drivers['network']"
>
</select>
</li>
<li class="list-group-item list-group-item-primary"><%=l 'type' %></li>
<li class="list-group-item">
<select ng-model="item.type"
ng-change="network_edit[$index]=true"
ng-options="type for type in ['bridge','NAT']"
>
</select>
</div>
</div>
<div class="row">
<div class="col-lg-1">
<p class="text-right">
</li>
<li class="list-group-item list-group-item-primary">
<span ng-show="item.type == 'NAT'">nat</span>
<span ng-show="item.type == 'bridge'">bridge</span>
</p>
</div>
<div class="col-lg-2">
</li>
<li class="list-group-item">
<select ng-model="item.network"
ng-change="network_edit[$index]=true"
ng-show="item.type == 'NAT'"
......@@ -45,19 +36,19 @@
<span ng-hide="item.type == 'NAT' || network_bridges[0]">
No bridges found
</span>
</div>
</div>
</li>
</ul>
<div class="row">
<div class="col-lg-1">
</div>
<div class="col-lg-2">
<div class="col-md-12 mt-3">
<button class="btn btn-primary"
ng-disabled=
"(item.type == 'bridge' && ( !network_bridges[0] || !item.bridge ))
|| (item.type == 'NAT' && ( !network_nats[0] || !item.network))"
ng-click="item.edit=false;change_network(showmachine.id, $index)">OK</button>
<button class="btn btn-primary"
ng-click="item.edit=false;machine_info(showmachine.id)">cancel</button>
ng-click="item.edit=false;change_network(showmachine.id, $index)"><%=l 'Submit' %></button>
<button class="btn btn-outline-secondary"
ng-click="item.edit=false;machine_info(showmachine.id)"><%=l 'Cancel' %></button>
</div>
</div>
</div>
......@@ -59,13 +59,13 @@
</div>
</div>
<div class="row">
<div class="col-lg-4">
<div class="col-mb-12 mt-3">
<button class="btn btn-primary"
ng-click=
"add_hardware('disk', value.length+1, add_disk);show_new_disk=false">ok</button>
"add_hardware('disk', value.length+1, add_disk);show_new_disk=false"><%=l 'Submit' %></button>
<button ng-click="show_new_disk=false"
class="btn btn-primary"
>cancel</button>
class="btn btn-outline-secondary"
><%=l 'Cancel' %></button>
</div>
</div>
</div>
......@@ -42,7 +42,7 @@
<!--<small class="form-text text-muted">Format: 192.168.0.1/32</small> -->
</div>
<div ng-show="name_duplicated"
class="alert alert-warning fade in">
class="alert alert-warning" role="alert">
<%=l 'A node with that name already exists.' %>
</div>
<div class="form-group row">
......
......@@ -26,8 +26,14 @@
%= include 'main/show_requests'
<div>
<div class="card-body">
%= include 'main/settings_machine_tabs_head'
%= include 'main/settings_machine_tabs_body'
<div class="row">
<div class="col-2">
%= include 'main/settings_machine_tabs_head'
</div>
<div class="col-10">
%= include 'main/settings_machine_tabs_body'
</div>
</div>
</div>
<div class="alert alert-danger" ng-show="error">{{error}}</div>
</div><!-- del panel default-->
......
......@@ -10,30 +10,20 @@
</div>
% }
% if ($USER->can_change_settings($domain->id) || $USER->can_rename($domain->id)) {
<div class="tab-content" id="nav-tabContent">
% if ($USER->can_change_settings($domain->id)) {
<div class="tab-pane fade show active" id="nav-description" role="tabpanel" aria-labelledby="nav-description-tab">
% if ($USER->can_change_settings($domain->id)) {
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-description" role="tabpanel" aria-labelledby="v-pills-description-tab">
%= include 'main/vm_description'
</div>
%}
% if ($USER->can_rename($domain->id)) {
<div class="tab-pane fade" id="nav-rename" role="tabpanel" aria-labelledby="nav-rename-tab">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
%= include 'main/vm_rename'
% }
<div class="tab-pane fade" id="v-pills-rename" role="tabpanel" aria-labelledby="v-pills-rename-tab">
%= include 'main/vm_rename'
</div>
% }
<div class="tab-pane fade" id="nav-options" role="tabpanel" aria-labelledby="nav-options-tab">
<div class="tab-pane fade" id="v-pills-options" role="tabpanel" aria-labelledby="v-pills-options-tab">
%= include 'main/vm_options'
</div>
% }
% if ($USER->can_change_settings($domain->id) && $domain->drivers) {
<div class="tab-pane fade" id="nav-drivers" role="tabpanel" aria-labelledby="nav-drivers-tab">
<div class="tab-pane fade" id="v-pills-drivers" role="tabpanel" aria-labelledby="v-pills-drivers-tab">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
......@@ -42,12 +32,12 @@
</div>
% }
% if ($USER->can_change_settings($domain->id) && !$domain->is_base ) {
<div class="tab-pane fade" id="nav-screenshot" role="tabpanel" aria-labelledby="nav-screenshot-tab">
<div class="tab-pane fade" id="v-pills-screenshot" role="tabpanel" aria-labelledby="v-pills-screenshot-tab">
%= include 'main/vm_screenshot'
</div>
% }
% if ($domain->type eq 'KVM') {
<div class="tab-pane fade" id="nav-graphics" role="tabpanel" aria-labelledby="nav-graphics-tab">
<div class="tab-pane fade" id="v-pills-graphics" role="tabpanel" aria-labelledby="v-pills-graphics-tab">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
......@@ -56,31 +46,31 @@
</div>
% }
% if ($USER->can_change_settings($domain->id)) {
<div class="tab-pane fade" id="nav-hardware" role="tabpanel" aria-labelledby="nav-hardware-tab" >
<div class="tab-pane fade" id="v-pills-hardware" role="tabpanel" aria-labelledby="v-pills-hardware-tab" >
%= include 'main/vm_hardware'
</div>
% }
<div class="tab-pane fade" id="nav-copy" role="tabpanel" aria-labelledby="nav-copy-tab">
<div class="tab-pane fade" id="v-pills-copy" role="tabpanel" aria-labelledby="v-pills-copy-tab">
%= include 'main/vm_copy'
</div>
% if ( $USER->is_admin) {
<div class="tab-pane fade" id="nav-clones" >
<div class="tab-pane fade" id="v-pills-clones" >
%= include 'main/vm_clones'
</div>
% }
% if ( $USER->can_remove_machine($domain->id)) {
<div class="tab-pane fade" id="nav-remove" role="tabpanel" aria-labelledby="nav-remove-tab">
<div class="tab-pane fade" id="v-pills-remove" role="tabpanel" aria-labelledby="v-pills-remove-tab">
%= include 'main/vm_remove'
</div>
% }
% if ( $monitoring && $USER->is_admin && $domain->is_active && $domain->internal_id) {
<div class="tab-pane fade" id="nav-monitoring" role="tabpanel" aria-labelledby="nav-monitoring-tab">
<div class="tab-pane fade" id="v-pills-monitoring" role="tabpanel" aria-labelledby="v-pills-monitoring-tab">
%= include 'main/vm_monitoring'
</div>
% }
%if ($USER->is_admin) {
<div class="tab-pane fade" id="nav-base" role="tabpanel" aria-labelledby="nav-base-tab">
<div class="tab-pane fade" id="v-pills-base" role="tabpanel" aria-labelledby="v-pills-base-tab">
%= include 'main/vm_base'
</div>
% }
......
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
% if ($USER->can_change_settings($domain->id)) {
<a class="nav-item nav-link active" id="nav-description-tab" ng-click="refresh_machine()" href="#nav-description" data-toggle="tab" role="tab" aria-controls="nav-description" aria-selected="true"><%=l 'Description' %></a>
<div class="nav flex-column nav-pills bg-light" id="v-pills-tab" role="tablist" aria-orientation="vertical">
% if ($USER->can_change_settings($domain->id)) {
<a class="nav-link active" id="v-pills-description-tab" ng-click="refresh_machine()" href="#v-pills-description" data-toggle="pill" role="tab" aria-controls="v-pills-description" aria-selected="true"><%=l 'Description' %></a>
% }
% if ($USER->can_rename($domain->id) ) {
<a class="nav-item nav-link" id="nav-rename-tab" ng-click="refresh_machine()" href="#nav-rename" data-toggle="tab" role="tab" aria-controls="nav-rename" aria-selected="false"><%=l 'Rename' %></a>
% if ($USER->can_change_settings($domain->id)) {
<a class="nav-link" id="v-pills-rename-tab" ng-click="refresh_machine()" href="#v-pills-rename" data-toggle="pill" role="tab" aria-controls="v-pills-rename" aria-selected="true"><%=l 'Rename' %></a>
% }
% if ($USER->can_change_settings($domain->id) ) {
<a class="nav-item nav-link" id="nav-options-tab" ng-click="refresh_machine()" href="#nav-options" data-toggle="tab" role="tab" aria-controls="nav-options" aria-selected="false"><%=l 'Options' %></a>
<a class="nav-link" id="v-pills-options-tab" ng-click="refresh_machine()" href="#v-pills-options" data-toggle="pill" role="tab" aria-controls="v-pills-options" aria-selected="false"><%=l 'Options' %></a>
% }
% if ($USER->can_change_settings($domain->id) && $domain->drivers) {
<a class="nav-item nav-link" id="nav-drivers-tab" ng-click="refresh_machine()" href="#nav-drivers" data-toggle="tab" role="tab" aria-controls="nav-drivers" aria-selected="false"><%=l 'Drivers' %></a>
<a class="nav-link" id="v-pills-drivers-tab" ng-click="refresh_machine()" href="#v-pills-drivers" data-toggle="pill" role="tab" aria-controls="v-pills-drivers" aria-selected="false"><%=l 'Drivers' %></a>
% }
% if ($USER->can_change_settings($domain->id)){
<a class="nav-item nav-link" id="nav-hardware-tab" ng-click="refresh_machine()" href="#nav-hardware" data-toggle="tab" role="tab" aria-controls="nav-hardware" aria-selected="false"><%=l 'Hardware' %></a>
<a class="nav-link" id="v-pills-hardware-tab" ng-click="refresh_machine()" href="#v-pills-hardware" data-toggle="pill" role="tab" aria-controls="v-pills-hardware" aria-selected="false"><%=l 'Hardware' %></a>
% }
% if ($USER->can_change_settings($domain->id) && !$domain->is_base) {
<a class="nav-item nav-link" id="nav-screenshot-tab" ng-click="refresh_machine()" href="#nav-screenshot" data-toggle="tab" role="tab" aria-controls="nav-screenshot" aria-selected="false"><%=l 'Screenshot' %></a>
<a class="nav-link" id="v-pills-screenshot-tab" ng-click="refresh_machine()" href="#v-pills-screenshot" data-toggle="pill" role="tab" aria-controls="v-pills-screenshot" aria-selected="false"><%=l 'Screenshot' %></a>
% }
% if ($domain->drivers && $USER->can_change_settings($domain->id)) {
<a class="nav-item nav-link" id="nav-graphics-tab" ng-click="refresh_machine()" href="#nav-graphics" data-toggle="tab" role="tab" aria-controls="nav-graphics" aria-selected="false"><%=l 'Graphics' %></a>
<a class="nav-link" id="v-pills-graphics-tab" ng-click="refresh_machine()" href="#v-pills-graphics" data-toggle="pill" role="tab" aria-controls="v-pills-graphics" aria-selected="false"><%=l 'Graphics' %></a>
% }
% if ($USER->is_admin) {
<a class="nav-item nav-link" id="nav-base-tab" ng-click="refresh_machine()" href="#nav-base" data-toggle="tab" role="tab" aria-controls="nav-base" aria-selected="false">Base</a>
<a class="nav-link" id="v-pills-base-tab" ng-click="refresh_machine()" href="#v-pills-base" data-toggle="pill" role="tab" aria-controls="v-pills-base" aria-selected="false">Base</a>
% }
% if ($USER->is_admin || $USER->can_clone_all ){
<a class="nav-item nav-link" id="nav-copy-tab" ng-click="refresh_machine()" href="#nav-copy" data-toggle="tab" role="tab" aria-controls="nav-copy" aria-selected="false"><%=l 'Copy' %></a>
<a class="nav-link" id="v-pills-copy-tab" ng-click="refresh_machine()" href="#v-pills-copy" data-toggle="pill" role="tab" aria-controls="v-pills-copy" aria-selected="false"><%=l 'Copy' %></a>
% }
% if ( $USER->can_remove_machine($domain->id)) {
<a class="nav-item nav-link" id="nav-remove-tab" ng-click="refresh_machine()" href="#nav-remove" data-toggle="tab" role="tab" aria-controls="nav-remove" aria-selected="false"><%=l 'Remove' %></a>
<a class="nav-link remove" id="v-pills-remove-tab" ng-click="refresh_machine()" href="#v-pills-remove" data-toggle="pill" role="tab" aria-controls="v-pills-remove" aria-selected="false"><%=l 'Remove' %></a>
% }
% if ($USER->is_admin && $domain->is_base){
<a class="nav-item nav-link" id="nav-remove-tab" ng-click="refresh_machine()" href="#nav-clones" data-toggle="tab" role="tab" aria-controls="nav-clones" aria-selected="false"><%=l 'Clones' %></a>
<a class="nav-link" id="v-pills-remove-tab" ng-click="refresh_machine()" href="#v-pills-clones" data-toggle="pill" role="tab" aria-controls="v-pills-clones" aria-selected="false"><%=l 'Clones' %></a>
% }
% if ( $monitoring && $USER->is_admin && $domain->is_active ) {
<a class="nav-item nav-link" id="nav-monitoring-tab" ng-click="refresh_machine()" href="#nav-monitoring" data-toggle="tab" role="tab" aria-controls="nav-monitoring" aria-selected="false"><%=l 'System overview' %></a>
<a class="nav-link" id="v-pills-monitoring-tab" ng-click="refresh_machine()" href="#v-pills-monitoring" data-toggle="pill" role="tab" aria-controls="v-pills-monitoring" aria-selected="false"><%=l 'System overview' %></a>
% }
</div>
</nav>
</div>
<div class="card card.bg-primary.text-white" ng-show="requests.length > 0">
<div class="card-header">
<span ng-show="pending_requests"><%=l 'Waiting for requests to complete' %> ... </span>
<span ng-show="pending_requests<1"><%=l 'Recent requests' %> ... </span>
</div>
<div class="card-body">
<div ng-repeat="request in requests">
<font color="darkgray">{{request.date}} |</font>
<div class="alert alert-light border-primary text-primary" role="alert" ng-show="requests.length > 0">
<h6 class="font-weight-bold" ng-show="pending_requests"><%=l 'Waiting for requests to complete' %> ... </h6>
<h6 class="font-weight-bold" ng-show="pending_requests<1"><%=l 'Recent requests' %> ... </h6>
<div ng-repeat="request in requests">
<span class="badge badge-pill badge-light">{{request.date}} |</span>
{{request.command}}
<b>{{request.domain}}</b>
<i>{{request.status}}</i>
<font color="darkblue">{{request.error}}</font>
</div>
<b>{{request.domain}}</b>
<i>{{request.status}}</i>
<span class="badge badge-pill badge-light">{{request.error}}</span>
</div>
</div>
</div>
\ No newline at end of file
......@@ -19,7 +19,7 @@
|| showmachine.clones[node.id]
|| ( node.is_local && showmachine.has_clones)">
</div>
<div class="col-md-2" ng-show="{{node.type == showmachine.type}}">
<div class="col-md-3" ng-show="{{node.type == showmachine.type}}">
{{node.name}}
</div>
<div class="col-md-4" ng-show="{{node.type == showmachine.type}}">
......
......@@ -2,7 +2,7 @@
<form method="post" action="/machine/copy">
<div class="form-group">
<div class="form-group row">
<div class="col-md-2">
<div class="col-md-2 mt-2">
<input class="form-control" type="hidden" name="id_base" value="{{showmachine.id}}">
<label class="control-label"
for="copy_name_{{showmachine.id}}"><%=l 'Name' %></label>
......@@ -17,10 +17,10 @@
</div>
</div>
<div class="form-group row">
<div class="col-md-2">
<div class="col-md-2 mt-2">
<label class="control-label" for="copy_ram">RAM (Gb)</label>
</div>
<div class="col-md-1">
<div class="col-md-2">
<input class="form-control" name="copy_ram" type="text" size="3" value="1">
</div>
</div>
......
<div class="card-body">
<form class="form" action="<%= $action %>" accept-charset="ISO-8859-1" method="post">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<strong><label for="description"><%=l 'This information will be available to the users' %>.</label></strong>
<br/>
<textarea id="editor" name="description" style="width: 100%;" placeholder="Description"><%= $domain->description %></textarea>
<script>
CKEDITOR.replace( 'editor' );
</script>
</div>
</div>
</div>
<div class="col-md-12">
<button type="reset" class="btn btn-outline-secondary" onclick = "location='/admin/machines'"><%=l 'Cancel' %></button>
<input type="submit" class="btn btn-primary" name="btn_description" value="<%=l 'Submit' %>">
</div>
</div>
</form>
</div>
<div class="card-body">
<form class="form" action="<%= $action %>" accept-charset="ISO-8859-1" method="post">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<strong><label for="description"><%=l 'This information will be available to the users' %>.</label></strong>
<br/>
<textarea id="editor" name="description" style="width: 100%;" placeholder="Description"><%= $domain->description %></textarea>
<script>
CKEDITOR.replace( 'editor', {height: 200} );
</script>
</div>
</div>
</div>
<div class="col-md-12">
<button type="reset" class="btn btn-outline-secondary" onclick = "location='/admin/machines'"><%=l 'Cancel' %></button>
<input type="submit" class="btn btn-primary" name="btn_description" value="<%=l 'Submit' %>">
</div>
</div>
</form>
</div>
......@@ -19,11 +19,11 @@
% next;
% }
<div class="row">
<div class="col-md-2">
<div class="col-md-2 mt-3">
<label class="control-label"
for="driver_<%= $driver_name %>"><%= $driver_name %></label>
</div>
<div class="col-md-4">
<div class="col-md-4 mt-2">
<select data-live-search="true" class="selectpicker form-control show-tick"
name="driver_<%= $driver_name %>">
% for my $option( $driver->get_options ) {
......
......@@ -44,10 +44,10 @@
<button ng-click="remove_hardware(name, $index, item, true)"
class="btn btn-primary"
ng-disabled="confirm_remove !== item.name"
>ok</button>
><%=l 'Submit' %></button>
<button ng-click="item.remove=false;confirm_remove = ''"
class="btn btn-primary"
>cancel</button>
class="btn btn-outline-secondary"
><%=l 'Cancel' %></button>
</p>
</div>
%= include 'main/manage_machine_edit_net'
......@@ -56,7 +56,7 @@
<div class="col-lg-2">
<p class="text-right"><%=l 'bus' %></p>
</div>
<div class="col-lg-1">
<div class="col-lg-2">
<select ng-model="item.driver"
ng-options="model for model in showmachine.drivers['disk']"
>
......@@ -97,13 +97,13 @@
<div class="row">
<div class="col-lg-2">
</div>
<div class="col-lg-2">
<div class="col-md-12">
<button ng-click="item.edit=false;change_disk(showmachine.id, $index)"
class="btn btn-primary"
>ok</button>
><%=l 'Submit' %></button>
<button ng-click="item.edit=false"
class="btn btn-primary"
>cancel</button>
class="btn btn-outline-secondary"
><%=l 'Cancel' %></button>
</div>
</div>
</div><!-- element ( former li ) -->
......@@ -114,16 +114,22 @@
</div>
</div>
<div ng-hide="show_new_disk">
<button ng-disabled="pending_requests > 0"
ng-click="add_hardware(new_hardware)"
class="btn btn-primary">
<%=l 'Afegeix '%>
</button>
<select ng-model="new_hardware"
ng-options="type for type in hardware_types"
>
</select>
<div ng-hide="show_new_disk" class="input-group mt-3" style="max-width: 18rem;">
<div class="input-group-prepend">
<button class="btn btn-primary"
ng-disabled="pending_requests > 0"
ng-click="add_hardware(new_hardware)"
class="btn btn-primary"
type="button">
<%=l 'Add'%></button>
</div>
<div class="custom-file">
<select class="custom-select" ng-model="new_hardware"
ng-options="type for type in hardware_types"
>
<option value=""><%=l '-- choose hardware --' %></option>
</select>
</div>
</div>
%= include 'main/manage_machine_new_disk'
</div>
......@@ -2,18 +2,18 @@
<form class="form" action="<%= $action %>" method="post">
<div class="form-group">
<div class="row" ng-show="showmachine.ip">
<div class="col-lg-2">
<div class="col-lg-3 mt-2">
<label class="control-label" for="ram"><%=l 'Internal IP' %></label>
</div>
<div class="col-lg-2">
<div class="col-lg-3">
{{showmachine.ip}}
</div>
</div>
<div class="row">
<div class="col-lg-2">
<div class="col-lg-3 mt-2">
<label class="control-label" for="ram"><%=l 'Max memory (MB)' %></label>
</div>
<div class="col-lg-2">
<div class="col-lg-3">
<input class="form-control" type="text" name="ram" size="5" value="<%= $ram %>">
</div>
% if ( $needs_restart) {
......@@ -25,7 +25,7 @@
</div>-->
</div>
<div class="row">
<div class="col-lg-2">
<div class="col-lg-3 mt-2">
<label class="control-label" for="cram"><%=l 'Current memory (MB)' %></label>
</div>
<div class="col-lg-2">
......@@ -34,7 +34,7 @@
</div>
% if ($USER->is_admin){
<div class="row">
<div class="col-lg-2">
<div class="col-lg-3 mt-2">
<label class="control-label" for="timeout">Timeout</label>
</div>
<div class="col-lg-2">
......@@ -44,15 +44,15 @@
% $timeout = '' if $timeout eq '0';
value="<%= $timeout %>" size="5">
</div>
<div class="col-lg-6"><%=l 'The machine will shutdown after these minutes' %></div>
<div class="col-lg-6"><small class="text-secondary"><%=l 'The machine will shutdown after these minutes' %></small></div>
</div>
% }
% if ($USER->is_admin){
<div class="row">
<div class="col-lg-2">
<div class="col-lg-3 mt-2">
<label class="control-label" for="volatile_clones"><%=l 'Volatile Clones' %></label>
</div>
<div class="col-lg-2">
<div class="col-lg-1