Commit 7b0aff82 authored by Ad Schellevis's avatar Ad Schellevis

(network insight) check for enabled netflow and report if inactive

parent abd8ffa9
...@@ -66,8 +66,13 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -66,8 +66,13 @@ POSSIBILITY OF SUCH DAMAGE.
function get_metadata() function get_metadata()
{ {
var dfObj = new $.Deferred(); var dfObj = new $.Deferred();
ajaxGet('/api/diagnostics/netflow/isEnabled',{}, function(is_enabled, status){
if (is_enabled['local'] == 0) {
dfObj.reject();
return;
}
// fetch interface names // fetch interface names
ajaxGet('/api/diagnostics/networkinsight/getInterfaces',{},function(intf_names,status){ ajaxGet('/api/diagnostics/networkinsight/getInterfaces',{}, function(intf_names, status){
interface_names = intf_names; interface_names = intf_names;
// fetch protocol names // fetch protocol names
ajaxGet('/api/diagnostics/networkinsight/getProtocols',{}, function(protocols, status) { ajaxGet('/api/diagnostics/networkinsight/getProtocols',{}, function(protocols, status) {
...@@ -89,7 +94,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -89,7 +94,6 @@ POSSIBILITY OF SUCH DAMAGE.
var resolutions = String($(this).find('option:selected').data('resolutions')); var resolutions = String($(this).find('option:selected').data('resolutions'));
resolutions.split(',').map(function(item) { resolutions.split(',').map(function(item) {
$("#export_resolution").append($("<option/>").val(item).text(item)); $("#export_resolution").append($("<option/>").val(item).text(item));
console.log(item);
}); });
$("#export_resolution").selectpicker('refresh'); $("#export_resolution").selectpicker('refresh');
}); });
...@@ -99,6 +103,8 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -99,6 +103,8 @@ POSSIBILITY OF SUCH DAMAGE.
}); });
}); });
}); });
});
return dfObj; return dfObj;
} }
...@@ -530,6 +536,10 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -530,6 +536,10 @@ POSSIBILITY OF SUCH DAMAGE.
chart_interface_totals(); chart_interface_totals();
chart_top_dst_port_usage(); chart_top_dst_port_usage();
chart_top_src_addr_usage(); chart_top_src_addr_usage();
}).fail(function(){
// netflow / local collection not active.
$("#info_tab").show();
$("#info_tab").click();
}); });
...@@ -540,11 +550,20 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -540,11 +550,20 @@ POSSIBILITY OF SUCH DAMAGE.
</script> </script>
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs"> <ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<li><a data-toggle="tab" id="info_tab" style="display:none;" href="#info">{{ lang._('Info') }}</a></li>
<li class="active"><a data-toggle="tab" id="totals_tab" href="#totals">{{ lang._('Totals') }}</a></li> <li class="active"><a data-toggle="tab" id="totals_tab" href="#totals">{{ lang._('Totals') }}</a></li>
<li><a data-toggle="tab" id="details_tab" href="#details">{{ lang._('Details') }}</a></li> <li><a data-toggle="tab" id="details_tab" href="#details">{{ lang._('Details') }}</a></li>
<li><a data-toggle="tab" id="export_tab" href="#export">{{ lang._('Export') }}</a></li> <li><a data-toggle="tab" id="export_tab" href="#export">{{ lang._('Export') }}</a></li>
</ul> </ul>
<div class="tab-content content-box tab-content" style="padding: 10px;"> <div class="tab-content content-box tab-content" style="padding: 10px;">
<div id="info" class="tab-pane fade in">
<br/>
<div class="alert alert-warning" role="alert">
{{ lang._('Local data collection is not enabled at the moment, please configure netflow first') }}
<br/>
<a href="/ui/diagnostics/netflow/">{{ lang._('Go to netflow configuration') }} </a>
</div>
</div>
<div id="totals" class="tab-pane fade in active"> <div id="totals" class="tab-pane fade in active">
<div class="pull-right"> <div class="pull-right">
<select class="selectpicker" id="total_time_select"> <select class="selectpicker" id="total_time_select">
......
Markdown is supported
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