Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
8be90b41
Commit
8be90b41
authored
Aug 04, 2021
by
Francesc Guasch
Browse files
refactor(frontend): disable access for non-admins
parent
1dc8f890
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/main/settings_machine_tabs_head.html.ep
View file @
8be90b41
...
...
@@ -5,7 +5,7 @@
% if ($USER->can_change_settings($domain->id)) {
<a class="nav-link <%= $active_description %>" 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="false"><%=l 'Description' %></a>
% }
% if ($USER->can_change_settings($domain->id)) {
% if ($USER->can_change_settings($domain->id)
&& $USER->is_admin
) {
<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="false"><%=l 'Rename' %></a>
% }
% if ($USER->can_change_settings($domain->id) ) {
...
...
@@ -14,7 +14,7 @@
% if ($USER->can_change_settings($domain->id) && $domain->drivers) {
<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)){
% if ($USER->can_change_settings($domain->id)
&& $USER->is_admin
){
<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) {
...
...
templates/main/vm_options.html.ep
View file @
8be90b41
...
...
@@ -74,6 +74,7 @@
</div>
<div class="col-lg-2">
<input class="form-control" type="text" name="ram" size="5"
ng-disabled="<%= !$USER->is_admin %>"
ng-blur="request('change_hardware',{
'id_domain': showmachine.id
,'hardware': 'memory'
...
...
@@ -106,6 +107,7 @@
</div>
<div class="col-lg-2">
<input class="form-control" type="text" name="cpus" size="5"
ng-disabled="<%= !$USER->is_admin %>"
ng-change="request('change_hardware',{
'id_domain': showmachine.id
,'hardware': 'vcpus'
...
...
@@ -122,6 +124,7 @@
</div>
<div class="col-lg-2">
<input type="text" size="5" name="timeout"
ng-disabled="<%= !$USER->is_admin %>"
ng-change="set_value('run_timeout',new_run_timeout*60)"
ng-model="new_run_timeout"
>
...
...
@@ -138,10 +141,10 @@
ng-model="new_shutdown_timeout"
>
</div>
<div class="col-lg-6"><small class="text-secondary"><%=l 'The machine will
turn
off after this
time
' %></small></div>
<div class="col-lg-6"><small class="text-secondary"><%=l 'The machine will
power
off after this
minutes after shutdown.
' %></small></div>
</div>
% }
% if ($USER->can_change_settings){
% if ($USER->can_change_settings
&& $USER->is_admin
){
<div class="row" ng-show="showmachine.is_base">
<div class="col-lg-3 mt-2">
<label class="control-label" for="volatile_clones"><%=l 'Volatile Clones' %></label>
...
...
@@ -163,6 +166,7 @@
</div>
<div class="col-lg-2">
<input type="checkbox" ng-model="new_autostart" name="autostart"
ng-disabled="<%= !$USER->is_admin %>"
ng-true-value="1" ng-false-value="0"
ng-change="request('domain_autostart',
{ 'value': new_autostart
...
...
@@ -176,10 +180,11 @@
</div>
<div class="row">
<div class="col-lg-3 mt-2">
<label class="control-label" for="
autostart
"><%=l 'Shutdown disconnected' %></label>
<label class="control-label" for="
shutdown_disconnected
"><%=l 'Shutdown disconnected' %></label>
</div>
<div class="col-lg-2">
<input type="checkbox" ng-model="new_shutdown_disconnected" name="autostart"
<input type="checkbox" ng-model="new_shutdown_disconnected" name="shutdown_disconnected"
ng-disabled="<%= !$USER->is_admin %>"
ng-true-value="1" ng-false-value="0"
ng-change="set_bool('shutdown_disconnected',new_shutdown_disconnected)"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment