Commit 1f707910 authored by fv3rdugo's avatar fv3rdugo
Browse files

Add icons plus/minus to hide_subclones

parent 0bce3c22
......@@ -83,7 +83,7 @@ ravadaApp.directive("solShowMachine", swMach)
$scope.show_swap = function() {
$scope.seeswap = !($scope.seeswap);
};
$http.get('/list_machines.json').then(function(response) {
$scope.base = response.data;
});
......@@ -143,6 +143,10 @@ ravadaApp.directive("solShowMachine", swMach)
$scope.hideClones = function(){
$scope.hide_clones = !$scope.hide_clones;
}
$scope.hide_subclones = true;
$scope.hideSubClones = function(){
$scope.hide_subclones = !$scope.hide_subclones;
}
$scope.action = function(target,action,machineId){
$http.get('/'+target+'/'+action+'/'+machineId+'.json')
.then(function() {
......@@ -216,5 +220,5 @@ ravadaApp.directive("solShowMachine", swMach)
$scope.getMessages();
$scope.updatePromise = $interval($scope.updateMessages,3000);
};
}());
......@@ -342,7 +342,7 @@ get '/machine/view/(:id).(:type)' => sub {
};
get '/machine/clone/(:id).(:type)' => sub {
my $c = shift;
my $c = shift;
return access_denied($c) if !$USER->can_clone();
return clone_machine($c);
};
......@@ -659,7 +659,7 @@ sub user_settings {
if ($c->param('button_click')) {
if (($c->param('password') eq "") || ($c->param('conf_password') eq "") || ($c->param('current_password') eq "")) {
push @errors,("Some of the password's fields are empty");
}
}
else {
my $comp_password = $USER->compare_password($c->param('current_password'));
if ($comp_password) {
......@@ -950,6 +950,8 @@ sub admin {
# if we find no clones do not hide them. They may be created later
$c->stash(hide_clones => 0 ) if !$c->stash('n_clones');
$c->stash(hide_subclones => 0 );
}
$c->render(template => 'main/admin_'.$page);
......@@ -1311,14 +1313,14 @@ sub make_admin {
}
sub register {
my $c = shift;
my @error = ();
my $username = $c->param('username');
my $password = $c->param('password');
# if($c ->param('submit')) {
# push @error,("Name is mandatory") if !$c->param('username');
# push @error,("Invalid username '".$c->param('username')."'"
......@@ -1334,8 +1336,8 @@ sub register {
# push @{$c->stash->{js}}, '/js/admin.js';
# $c->render(template => 'bootstrap/new_user_control'
# , name => $c->param('username')
#)
#)
if ($username) {
Ravada::Auth::SQL::add_user(name => $username, password => $password);
return $c->render(template => 'bootstrap/new_user_ok' , username => $username);
......@@ -1617,7 +1619,7 @@ sub copy_machine {
my $c = shift;
return login($c) if !_logged_in($c);
my $id_base= $c->param('id_base');
......
......@@ -4,6 +4,7 @@
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top" role="document">
<div id="wrapper">
<div ng-controller="machinesPage" ng-init="hide_clones=<%= $hide_clones %>">
<div ng-controller="machinesPage" ng-init="hide_subclones=<%= $hide_subclones %>">
%= include 'bootstrap/navigation'
<div id="page-wrapper">
<div id="admin-content">
......@@ -77,8 +78,8 @@
title ="<%=l 'Machine settings' %>"><b
ng-cloak>{{machine.name}}</b></a>
% if ($n_clones) {
<a ng-show="hide_clones" ng-click="hideClones()"><i class="fa fa-plus-square-o"></i></a>
<a ng-show="!hide_clones" ng-click="hideClones()"><i class="fa fa-minus-square-o"></i></a>
<a ng-show="hide_clones" ng-click="hideSubClones()"><i class="fa fa-plus-square-o"></i></a>
<a ng-show="!hide_clones" ng-click="hideSubClones()"><i class="fa fa-minus-square-o"></i></a>
%}
</td>
<td class="lgMachToggle">
......
Markdown is supported
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