Skip to content

Commit

Permalink
fix: show clones checkbox was not working (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol authored Apr 22, 2024
1 parent 4fe5099 commit 379fff9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ ravadaApp.directive("solShowMachine", swMach)
$scope.set_autostart= function(machineId, value) {
$http.get("/machine/autostart/"+machineId+"/"+value);
};
$scope.set_public = function(machineId, value) {
$scope.set_public = function(machineId, value, show_clones) {
if (value) value=1;
else value = 0;
$http.get("/machine/public/"+machineId+"/"+value)
Expand All @@ -509,6 +509,9 @@ ravadaApp.directive("solShowMachine", swMach)
}
});

if ( value == 0 ) {
$http.get("/machine/set/"+machineId+"/show_clones/"+show_clones);
}
};

$scope.can_remove_base = function(machine) {
Expand Down
2 changes: 1 addition & 1 deletion templates/main/admin_machines.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" ng-click="cancel_modal(machine,'is_public')"><%=l 'No' %></button>
<button type="button" class="btn btn-primary" ng-click="cancel_modal();set_public(machine.id, machine.is_public)" data-dismiss="modal"><%=l 'Yes' %></button>
<button type="button" class="btn btn-primary" ng-click="cancel_modal();set_public(machine.id, machine.is_public, machine.show_clones)" data-dismiss="modal"><%=l 'Yes' %></button>
</div>
</div>
</div>
Expand Down

0 comments on commit 379fff9

Please sign in to comment.