|
@@ -0,0 +1,323 @@
|
|
|
+{% extends "@BaseAdminBundle/Resources/views/standard_layout.html.twig" %}
|
|
|
+
|
|
|
+{% block stylesheets %}
|
|
|
+{{ parent() }}
|
|
|
+{# <link rel="stylesheet" href="{{ asset('bundles/stats/datatables/jquery.dataTables.min.css') }}"> #}
|
|
|
+<link rel="stylesheet" type="text/css" href="{{ asset('bundles/stats/css/style.css') }}">
|
|
|
+{# <link rel="stylesheet" href="{{ asset('bundles/stats/datatables/jquery.dataTables.min.css') }}"> #}
|
|
|
+<style>
|
|
|
+
|
|
|
+.cpu_card {
|
|
|
+ border: 1px solid rgba(0,0,0,0.2);
|
|
|
+ float: left;
|
|
|
+ margin: 2px;
|
|
|
+ padding: 2px;
|
|
|
+}
|
|
|
+
|
|
|
+table.dataTable thead tr th, table.dataTable tbody tr td {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|
|
|
+{% endblock %}
|
|
|
+
|
|
|
+{% block javascripts %}
|
|
|
+{{ parent() }}
|
|
|
+
|
|
|
+{# {% include 'LeafletBundle:Leaflet:resources_only_leaflet.html.twig' %} #}
|
|
|
+<script src="{{ asset('bundles/stats/highcharts/code/highcharts.js') }}" type="text/javascript" charset="utf-8"></script>
|
|
|
+<script src="{{ asset('bundles/stats/highcharts/highchartsConfig.js') }}" type="text/javascript" charset="utf-8"></script>
|
|
|
+{# <script src="{{ asset('bundles/stats/datatables/jquery.dataTables.min.js') }}"></script> #}
|
|
|
+
|
|
|
+{% endblock %}
|
|
|
+
|
|
|
+{% block sonata_page_content %}
|
|
|
+<section class="content-header">
|
|
|
+ <div class="sticky-wrapper" style="">
|
|
|
+ <nav class="navbar navbar-default" role="navigation" style="width: auto;">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="hidden-xs">
|
|
|
+ <ol class="nav navbar-top-links breadcrumb">
|
|
|
+ <li><a href="/app_dev.php/admin/dashboard"><i class="fa fa-home"></i></a></li>
|
|
|
+ <li><a href="{{url('admin_stats_olt_list')}}">{{"breadcrumb.link_olt_list"|trans({}, 'StatsBundle')}}</a></li>
|
|
|
+ <li class="active"><span>{{data['name']}}</span></li>
|
|
|
+ </ol>
|
|
|
+ </div>
|
|
|
+ <div class="navbar-collapse"></div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+ </div>
|
|
|
+</section>
|
|
|
+
|
|
|
+{% set onuOn = series['on']['last'] %}
|
|
|
+{% set onuOff = series['off']['last'] %}
|
|
|
+{% set onuTotal = onuOn + onuOff %}
|
|
|
+{% set onuOnPercent = 0 %}
|
|
|
+{% if onuTotal > 0 %}
|
|
|
+ {% set onuOnPercent = ((onuOn / onuTotal) * 100)|number_format(2,'.','') %}
|
|
|
+{% endif %}
|
|
|
+
|
|
|
+<section class="content">
|
|
|
+ <div class="box box-primary">
|
|
|
+ <br />
|
|
|
+ <div class="box-body">
|
|
|
+ <div class="col-sm-12">
|
|
|
+ <div class="nav-tabs-custom">
|
|
|
+ <ul class="nav nav-tabs">
|
|
|
+ <li class="active">
|
|
|
+ <a href="#tab_1" data-toggle="tab">Description</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <div class="tab-content clearfix">
|
|
|
+ {# TAB Description #}
|
|
|
+ <div class="tab-pane active" id="tab_1">
|
|
|
+ <div class="clearfix">
|
|
|
+ <div class="col-sm-3">
|
|
|
+ {% include '@Stats/Stats/Template/olt_info_1.html.twig' %}
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-3">
|
|
|
+ <div id="onu_count" style="width:75%; margin:0 auto"></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-6">
|
|
|
+ {% include '@Stats/Stats/picker.html.twig' %}
|
|
|
+ <br />
|
|
|
+ <div id="onu_consumption"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <br />
|
|
|
+
|
|
|
+ <div class="clearfix">
|
|
|
+ <div class="col-sm-9">
|
|
|
+ <div id="olt_bandwidth"></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-3">
|
|
|
+ {% include '@Stats/Stats/Template/interface_bandwidth_info.html.twig' %}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div class="col-sm-8">
|
|
|
+ <div id="olt_cm" style="height: 400px;"></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div id="olt_signals"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</section>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+
|
|
|
+var from = {{from}};
|
|
|
+var to = {{to}};
|
|
|
+var markerEnable = false;
|
|
|
+if((to - from) <= 21600) {
|
|
|
+ markerEnable = true;
|
|
|
+}
|
|
|
+
|
|
|
+Highcharts.chart('onu_count', {
|
|
|
+ chart: {type: 'pie'},
|
|
|
+ title: {text: "{{onuOnPercent}} % online"},
|
|
|
+ subtitle: {text: "{{onuTotal}} onus"},
|
|
|
+ tooltip: {pointFormat: '{series.name}: <b>{point.y:.0f}</b>({point.percentage:.1f}%)'},
|
|
|
+ plotOptions: {pie: {allowPointSelect: true,cursor: 'pointer',dataLabels: {enabled: true,format: '<b>{point.name}</b>: {point.y:.0f} ({point.percentage:.1f} %)',style: {color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'}}}},
|
|
|
+ series: [{
|
|
|
+ name: 'Onus',
|
|
|
+ colorByPoint: true,
|
|
|
+ data: [{
|
|
|
+ name: 'Online',
|
|
|
+ y: {{onuOn}},
|
|
|
+ sliced: true,
|
|
|
+ selected: true,
|
|
|
+ color: '#4DD351'
|
|
|
+ }, {
|
|
|
+ name: 'Offline',
|
|
|
+ y: {{onuOff}},
|
|
|
+ color: '#D75C62'
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+Highcharts.chart('onu_consumption', {
|
|
|
+ chart: {type: 'spline'},
|
|
|
+ title: {text: '{{'Consumption OLT'|trans({}, 'StatsBundle')}}'},
|
|
|
+ subtitle: {text: '{{'consumption_subtitle'|trans({},'StatsBundle')}}'},
|
|
|
+ xAxis: {type: 'datetime',dateTimeLabelFormats: {month: '%e. %b',year: '%b'},title: {text: 'Date'}},
|
|
|
+ yAxis: {labels: {formatter: consumptionAxisLabel,align: 'left'},min: 0},
|
|
|
+ tooltip: {formatter: consumptionTooltip},
|
|
|
+ plotOptions: {series: {marker: {enabled: markerEnable}, dataLabels: {enabled: false, color: '#666666', formatter: bandwidthDataLabel}}},
|
|
|
+ series: [{
|
|
|
+ name: "OUT Consumption",
|
|
|
+ data: {{series['out_consumption']['data']|json_encode}},
|
|
|
+ color: '#e24d42'
|
|
|
+ },{
|
|
|
+ name: "IN Consumption",
|
|
|
+ data: {{series['in_consumption']['data']|json_encode}},
|
|
|
+ color: '#3f6833'
|
|
|
+ }]
|
|
|
+});
|
|
|
+
|
|
|
+Highcharts.chart('olt_bandwidth', {
|
|
|
+ chart: {type: 'spline'},
|
|
|
+ title: {text: '{{'Bandwidth OLT'|trans({}, 'StatsBundle')}}'},
|
|
|
+ subtitle: {},
|
|
|
+ xAxis: {type: 'datetime',dateTimeLabelFormats: {month: '%e. %b',year: '%b'},title: {text: 'Date'}},
|
|
|
+ yAxis: {labels: {formatter: bandwidthAxisLabel,align: 'left'},min: 0},
|
|
|
+ tooltip: {formatter: bandwidthTooltip},
|
|
|
+ plotOptions: {series: {marker: {enabled: markerEnable}, dataLabels: {enabled: false, color: '#666666', formatter: bandwidthDataLabel}}},
|
|
|
+ series: [{
|
|
|
+ name: "OUT Bandwidth",
|
|
|
+ data: {{series['out_bandwidth']['data']|json_encode}},
|
|
|
+ color: '#e24d42'
|
|
|
+ },{
|
|
|
+ name: "IN Bandwidth",
|
|
|
+ data: {{series['in_bandwidth']['data']|json_encode}},
|
|
|
+ color: '#3f6833'
|
|
|
+ }]
|
|
|
+});
|
|
|
+
|
|
|
+Highcharts.chart('olt_cm', {
|
|
|
+ chart: {type: 'area'},
|
|
|
+ title: {text: 'Onus'},
|
|
|
+ subtitle: {text: 'Online / Offline'},
|
|
|
+ xAxis: {type: 'datetime',dateTimeLabelFormats: {month: '%e. %b',year: '%b'},title: {text: 'Date'}},
|
|
|
+ yAxis: {min: 0,stackLabels: {enabled: false,style: {fontWeight: 'bold',color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'}}},
|
|
|
+ tooltip: {valueSuffix: ' onus',valueDecimals: 0},
|
|
|
+ plotOptions: {series: {marker: {enabled: false}}, area: {stacking: 'normal', dataLabels: {enabled: false, color: '#666666'}}},
|
|
|
+ series: [{
|
|
|
+ name: 'Online',
|
|
|
+ data: {{series['on']['data']|json_encode}},
|
|
|
+ color: '#3f6833'
|
|
|
+ }, {
|
|
|
+ name: 'Offline',
|
|
|
+ data: {{series['off']['data']|json_encode}},
|
|
|
+ color: '#e24d42'
|
|
|
+ }]
|
|
|
+});
|
|
|
+
|
|
|
+Highcharts.chart('olt_signals', {
|
|
|
+
|
|
|
+ chart: {
|
|
|
+ type: 'scatter',
|
|
|
+ zoomType: 'xy'
|
|
|
+ },
|
|
|
+ series: {
|
|
|
+ type: 'scatter'
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ text: '{{'Signal ONU'|trans({}, 'StatsBundle')}}'
|
|
|
+ },
|
|
|
+ subtitle: {
|
|
|
+ text: '{{'Values of TX y RX Power'|trans({}, 'StatsBundle')}}'
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ startOnTick: true,
|
|
|
+ endOnTick: true,
|
|
|
+ showLastLabel: true,
|
|
|
+ type:'linear',
|
|
|
+ title: {
|
|
|
+ enabled: true,
|
|
|
+ text: 'TX'
|
|
|
+ },
|
|
|
+ crosshair: true
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ title: {
|
|
|
+ enabled: true,
|
|
|
+ text: 'RX'
|
|
|
+ },
|
|
|
+ crosshair: true,
|
|
|
+ },
|
|
|
+ legend: {enabled: false},
|
|
|
+ plotOptions: {
|
|
|
+ series: {lineWidth: 0},
|
|
|
+ scatter: {marker: {radius: 5,states: {hover: {enabled: true,lineColor: 'rgb(100,100,100)'}}},states: {hover: {marker: {enabled: false}}},
|
|
|
+ point: {events: {click: function () {
|
|
|
+ var url = "{{url('admin_stats_onu_show',{id:'IDCM'})}}";
|
|
|
+ url = url.replace('IDCM', this.id);
|
|
|
+ window.open(url, '_blank');
|
|
|
+ }}}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tooltip: {formatter: scatterTxRxTooltip},
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: 'Signals',
|
|
|
+ type: 'scatter',
|
|
|
+ data:[{{signals|raw}}]
|
|
|
+ }]
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+{#
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+Highcharts.chart('interface_utilization', {
|
|
|
+ chart: {type: 'spline'},
|
|
|
+ title: {text: '{{'Interfaces Utilization'|trans({}, 'StatsBundle')}}'},
|
|
|
+ subtitle: {},
|
|
|
+ xAxis: {type: 'datetime',dateTimeLabelFormats: {month: '%e. %b',year: '%b'},title: {text: 'Date'}},
|
|
|
+ yAxis: {labels: {align: 'left'},min: 0, max: 100},
|
|
|
+ tooltip: {valueSuffix: ' %',valueDecimals: 2},
|
|
|
+ plotOptions: {series: {marker: {enabled: markerEnable}}, spline: {marker: {enabled: false}}},
|
|
|
+ series: [
|
|
|
+ {% for index in utilizations %}
|
|
|
+ {
|
|
|
+ name: "Interface {{index}}",
|
|
|
+ data: {{series['utilization_' ~ index]['data']|json_encode}}
|
|
|
+ },
|
|
|
+ {% endfor %}
|
|
|
+ ]
|
|
|
+});
|
|
|
+
|
|
|
+Highcharts.chart('interface_snr', {
|
|
|
+ chart: {type: 'spline'},
|
|
|
+ title: {text: '{{'Interfaces SNR'|trans({}, 'StatsBundle')}}'},
|
|
|
+ subtitle: {},
|
|
|
+ xAxis: {type: 'datetime',dateTimeLabelFormats: {month: '%e. %b',year: '%b'},title: {text: 'Date'}},
|
|
|
+ yAxis: {labels: {align: 'left'}},
|
|
|
+ tooltip: {valueSuffix: ' dB',valueDecimals: 2},
|
|
|
+ plotOptions: {series: {marker: {enabled: markerEnable}}, spline: {marker: {enabled: false}}},
|
|
|
+ series: [
|
|
|
+ {% for index in snrs %}
|
|
|
+ {
|
|
|
+ name: "Interface {{index}}",
|
|
|
+ data: {{series['signal_' ~ index]['data']|json_encode}}
|
|
|
+ },
|
|
|
+ {% endfor %}
|
|
|
+ ]
|
|
|
+});
|
|
|
+
|
|
|
+Highcharts.chart('interface_cer', {
|
|
|
+ chart: {type: 'spline'},
|
|
|
+ title: {text: '{{'Interfaces CER'|trans({}, 'StatsBundle')}}'},
|
|
|
+ subtitle: {},
|
|
|
+ xAxis: {type: 'datetime',dateTimeLabelFormats: {month: '%e. %b',year: '%b'},title: {text: 'Date'}},
|
|
|
+ yAxis: {labels: {align: 'left'}},
|
|
|
+ tooltip: {valueSuffix: ' %',valueDecimals: 6},
|
|
|
+ plotOptions: {series: {marker: {enabled: markerEnable}}, spline: {marker: {enabled: false}}},
|
|
|
+ series: [
|
|
|
+ {% for index in cers %}
|
|
|
+ {
|
|
|
+ name: "Interface {{index}}",
|
|
|
+ data: {{series['cer_' ~ index]['data']|json_encode}}
|
|
|
+ },
|
|
|
+ {% endfor %}
|
|
|
+ ]
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+#}
|
|
|
+*/
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+{% endblock %}
|