Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
7b0aff82
Commit
7b0aff82
authored
Apr 22, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(network insight) check for enabled netflow and report if inactive
parent
abd8ffa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
28 deletions
+47
-28
networkinsight.volt
...se/mvc/app/views/OPNsense/Diagnostics/networkinsight.volt
+47
-28
No files found.
src/opnsense/mvc/app/views/OPNsense/Diagnostics/networkinsight.volt
View file @
7b0aff82
...
...
@@ -66,39 +66,45 @@ POSSIBILITY OF SUCH DAMAGE.
function get_metadata()
{
var dfObj = new $.Deferred();
// fetch interface names
ajaxGet('/api/diagnostics/networkinsight/getInterfaces',{},function(intf_names,status){
interface_names = intf_names;
// fetch protocol names
ajaxGet('/api/diagnostics/networkinsight/getProtocols',{}, function(protocols, status) {
protocol_names = protocols;
// fetch service names
ajaxGet('/api/diagnostics/networkinsight/getServices',{}, function(services, status) {
service_names = services;
// return promise, no need to wait for getMetadata
dfObj.resolve();
// fetch aggregators
ajaxGet('/api/diagnostics/networkinsight/getMetadata',{}, function(metadata, status) {
Object.keys(metadata['aggregators']).forEach(function (agg_name) {
var res = metadata['aggregators'][agg_name]['resolutions'].join(',');
$("#export_collection").append($("<option data-resolutions='"+res+"'/>").val(agg_name).text(agg_name));
});
$("#export_collection").change(function(){
//alert($(this).find('option:selected').data('resolutions'));
$("#export_resolution").html("");
var resolutions = String($(this).find('option:selected').data('resolutions'));
resolutions.split(',').map(function(item) {
$("#export_resolution").append($("<option/>").val(item).text(item));
console.log(item);
ajaxGet('/api/diagnostics/netflow/isEnabled',{}, function(is_enabled, status){
if (is_enabled['local'] == 0) {
dfObj.reject();
return;
}
// fetch interface names
ajaxGet('/api/diagnostics/networkinsight/getInterfaces',{}, function(intf_names, status){
interface_names = intf_names;
// fetch protocol names
ajaxGet('/api/diagnostics/networkinsight/getProtocols',{}, function(protocols, status) {
protocol_names = protocols;
// fetch service names
ajaxGet('/api/diagnostics/networkinsight/getServices',{}, function(services, status) {
service_names = services;
// return promise, no need to wait for getMetadata
dfObj.resolve();
// fetch aggregators
ajaxGet('/api/diagnostics/networkinsight/getMetadata',{}, function(metadata, status) {
Object.keys(metadata['aggregators']).forEach(function (agg_name) {
var res = metadata['aggregators'][agg_name]['resolutions'].join(',');
$("#export_collection").append($("<option data-resolutions='"+res+"'/>").val(agg_name).text(agg_name));
});
$("#export_collection").change(function(){
//alert($(this).find('option:selected').data('resolutions'));
$("#export_resolution").html("");
var resolutions = String($(this).find('option:selected').data('resolutions'));
resolutions.split(',').map(function(item) {
$("#export_resolution").append($("<option/>").val(item).text(item));
});
$("#export_resolution").selectpicker('refresh');
});
$("#export_resolution").selectpicker('refresh');
});
$("#export_collection").change();
$("#export_collection").selectpicker('refresh');
$("#export_collection").change();
$("#export_collection").selectpicker('refresh');
});
});
});
});
});
return dfObj;
}
...
...
@@ -530,6 +536,10 @@ POSSIBILITY OF SUCH DAMAGE.
chart_interface_totals();
chart_top_dst_port_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.
</script>
<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><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>
</ul>
<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 class="pull-right">
<select class="selectpicker" id="total_time_select">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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