Unverified Commit 6dfdc781 authored by robertperez-upc's avatar robertperez-upc Committed by GitHub
Browse files

Add debug option (#1402)

DEBUG can be managed from admin/settings and changed on-the-fly
parent ea78982f
......@@ -1340,6 +1340,7 @@ sub _sql_insert_defaults($self){
fallback => 0
,session_timeout => 10*60
,admin_session_timeout => 30*60
,debug => 0
,auto_view => 1
};
if ( -e "/etc/rvd_front.conf" ){
......@@ -1400,6 +1401,11 @@ sub _sql_insert_defaults($self){
,name => 'start_limit'
,value => 1
}
,{
id_parent => $id_backend
,name => 'debug'
,value => 0
}
]
);
my %field = ( settings => 'name' );
......@@ -4338,6 +4344,11 @@ sub _cmd_open_exposed_ports($self, $request) {
$domain->open_exposed_ports();
}
sub set_debug_value($self) {
$DEBUG = $self->setting('backend/debug');
}
=head2 setting
Returns the value of a configuration setting
......
......@@ -187,7 +187,7 @@ sub do_start {
$ravada->process_priority_requests();
$ravada->process_long_requests();
$ravada->process_requests();
$ravada->set_debug_value();
exit if done_request();
if ( time - $t_refresh > 60 ) {
......@@ -242,6 +242,7 @@ sub start {
my $ravada = Ravada->new( %CONFIG );
$Ravada::CONNECTOR->dbh;
$ravada->_install();
$ravada->set_debug_value();
for my $vm (@{$ravada->vm}) {
$vm->id;
}
......
......@@ -107,6 +107,7 @@ plugin I18N => {namespace => 'Ravada::I18N', default => 'en'};
my %config;
%config = (config => $CONFIG_FRONT->{config}) if $CONFIG_FRONT->{config};
our $RAVADA = Ravada::Front->new(%config);
our $USER;
......
......@@ -102,6 +102,18 @@
>
</div>
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-2">
<label for="debug">Debug</label>
</div>
<div class="col-md-6">
<input name="debug" ng-model="settings.backend.debug.value"
ng-true-value="1" ng-false-value="0"
type="checkbox">
<%= l 'Debug' %>
</div>
</div>
<hr>
......
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