Skip to content

Commit

Permalink
Fix: dir backup (#2074)
Browse files Browse the repository at this point in the history
* fix: update all node fields

* fix: register double render when fail
  • Loading branch information
frankiejol authored Jul 29, 2024
1 parent 5083dad commit 9aef2d0
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 1 addition & 7 deletions public/js/admin.js
Original file line number Diff line number Diff line change
@@ -989,14 +989,8 @@ ravadaApp.directive("solShowMachine", swMach)

$scope.update_node = function(node) {
$scope.error = '';
var data = {
'id': node.id
,'base_storage': node.base_storage
,'default_storage': node.default_storage
,'clone_storage': node.clone_storage
};
$http.post('/v1/node/set/'
, JSON.stringify(data))
, JSON.stringify(node))
.then(function(response) {
if (response.data.ok == 1){
$scope.saved = true;
8 changes: 7 additions & 1 deletion script/rvd_front
Original file line number Diff line number Diff line change
@@ -1167,6 +1167,12 @@ get '/node/info/(:id).json' => sub($c) {
$sth->execute($c->stash('id'));
my $row = $sth->fetchrow_hashref;
delete $row->{tls};
for my $field (keys %$row) {
delete $row->{$field} if $field =~ /^cache/;
}
for (('version','security','connection_args','vm_type')) {
delete $row->{$_};
}
return $c->render(json => $row);
};

@@ -3993,7 +3999,7 @@ sub register {

if (grep {lc($_) eq lc($username)} @list_users) {
push @error,("Username already exists, please choose another one");
$c->render(template => 'bootstrap/new_user',error => \@error);
return $c->render(template => 'bootstrap/new_user',error => \@error);
}
else {
#username don't exists
3 changes: 2 additions & 1 deletion templates/main/storage_options.html.ep
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="container-fluid">
<form name="form_options">
<i class="fas fa-sync-alt fa-spin" ng-hide="node && node.id"></i>
<form name="form_options" ng-show="node && node.id">

<div class="form-group row">
<div class="col-md-3" align="right"><%=l 'base storage' %></div>

0 comments on commit 9aef2d0

Please sign in to comment.