Commit cc4b41e8 authored by Fernando Verdugo's avatar Fernando Verdugo
Browse files

wip(frontend): angular checkbox

Issue #1145
parent 186abe25
......@@ -30,6 +30,7 @@
.controller("notifCrtl", notifCrtl)
.controller("run_domain",run_domain_ctrl)
.controller("run_domain_req",run_domain_req_ctrl)
.controller("adminSettingsPage",adminSettingsPageC)
......@@ -843,3 +844,22 @@
}
}
};
// Admin settings page
function adminSettingsPageC($scope) {
$scope.varconfig = {
'auto_view' : true
};
$scope.set_varconfig = function(field, value) {
if (value ) value=1;
else value=0;
$scope.auto_view[field]=value;
value_show = true;
if (! value) {
value_show = false;
}
$scope.add_message("Setting "+$scope.auto_view+" "+field+" to "+value_show);
//$http.get("/machine/set/"+$scope.showmachine.id+"/"+field+"/"+value);
};
};
\ No newline at end of file
......@@ -2,7 +2,7 @@
<html ng-app="ravada.app">
%= include 'bootstrap/header'
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top" role="document">
<div id="wrapper">
<div id="wrapper" ng-controller="adminSettingsPage">
%= include 'bootstrap/navigation'
<div id="page-wrapper">
<div class="page-header">
......@@ -18,18 +18,15 @@
<p class="card-text">
<%=l 'After login, if there is only one virtual machine for that user, just starts the machine right away.
In order to to avoid unnecessary click stages, and to give a better user experience' %></p>
<div class="custom-control custom-switch">
%= check_box auto_view => 0
<label>Enable direct access to machine</label>
auto_view <%= my $auto_view %>
<label><input type="checkbox" ng-model="set_varconfig.auto_view">
Enable direct access to machine </label>
</div>
<input type="checkbox" class="custom-control-input" id="isAutoView">
<tt>auto_view = {{set_varconfig.auto_view}}</tt><br/>
</div>
</div>
</div>
</div>
%= include 'bootstrap/scripts'
......
Supports Markdown
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