Commit 7095b5a2 authored by Fernando Verdugo's avatar Fernando Verdugo
Browse files

feat(frontend): Custom widget embed

If widget variable exists in /etc/rvd_front.conf the widget is embeded
  ,widget => '/js/custom/insert_here_widget.js'

The widged script must be in public/js/custom/insert_here_widget.js

Issue #1419
parent 4644f292
......@@ -37,4 +37,7 @@
,file => '/var/log/ravada/rvd_front.log'
,level => 'debug'
}
# Insert widget in /js/custom/insert_here_widget.js
# this widget embed js in templates/bootstrap/scripts.html.ep
,widget => ''
};
......@@ -66,7 +66,7 @@ my $CONFIG_FRONT = plugin Config => { default => {
,monitoring => 0
,fallback => 0
,guide_custom => ''
,widget_footer => ''
,widget => ''
,admin => {
hide_clones => 15
,autostart => 0
......@@ -156,7 +156,7 @@ hook before_routes => sub {
,check_netdata => 0
,guide => $CONFIG_FRONT->{guide}
,host => $host
,widget_footer => $CONFIG_FRONT->{widget_footer}
,widget => $CONFIG_FRONT->{widget}
);
$USER = _logged_in($c);
......
......@@ -62,4 +62,7 @@
document.getElementById("spinn"+iD).style.display="none";
}
</script>
<script src="<%= $widget_footer %>"></script>
% if ( $widget ) {
<script src="<%= $widget %>"></script>
% }
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