<script src="{{ asset('js/[Link].
js') }}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('plugins/bootstrap-select-1.14/dist/js/bootstrap-
[Link]') }}"></script>
<script src="{{ asset('plugins/datatable/js/[Link]')
}}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('plugins/datatable/js/[Link]')
}}"></script>
<script
src="[Link]
script>
<script src="{{ asset('plugins/simplebar/js/[Link]') }}"></script>
<script src="{{ asset('plugins/metismenu/js/[Link]') }}"></script>
<script src="{{ asset('plugins/perfect-scrollbar/js/[Link]')
}}"></script>
<script src="{{ asset('plugins/vectormap/[Link]')
}}"></script>
<script src="{{ asset('plugins/vectormap/jquery-jvectormap-world-mill-
[Link]') }}"></script>
<script src="{{ asset('plugins/chartjs/js/[Link]') }}"></script>
<script src="{{ asset('plugins/chartjs/js/[Link]') }}"></script>
<script src="{{
asset('plugins/[Link]-pie-chart/[Link]') }}"></script>
<script src="{{ asset('plugins/typeahead/dist/[Link]')
}}"></script>
<script src="{{ asset('plugins/select2/js/[Link]') }}"></script>
<script src="[Link]
<script src="[Link]
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{ asset('js/[Link]') }}"></script>
<script src="{{config('[Link]')}}/[Link]/[Link]"></script>
<script>
var soundDevice = new
Audio('[Link]
var soundPort = new
Audio('[Link]
[Link]=true;
[Link]=true;
var soundOn = false;
// function startAudio(){
// if([Link]){
// [Link]();
// }
// function fmute(){
// if([Link]){
// [Link]=false;
// }else{
// [Link]=true;
// }
// }
// }
$(window).on('load', function() {
$.ajax({
url : UrlApiNew+'/notificationscount',
type: "GET",
//dataType:'json',
headers:{
'Authorization' : token
},
success: function(data) {
let dataCount = [Link];
if([Link]("sDevice") === null){
[Link]("sDevice", 0);
}
if([Link]("sPort") === null){
[Link]("sPort", 0);
}
audioDevice([Link]("sDevice"),
[Link]);
audioPort([Link]("sPort"),
[Link]);
[Link]("Device storage " +
[Link]("sDevice"));
[Link]("Device data " + [Link]);
[Link]("Port storage " + [Link]("sPort"));
[Link]("Port data " + [Link]);
$("#allnotif").html([Link]);
$("#devicenotif").html([Link]);
$("#portnotif").html([Link]);
},
error: function(xhr, status) {
[Link]("error getAllNotifDevice");
}
})
});
$('#setting-contact').on('click', function() {
[Link] = [Link] + '/setting/contact'
})
$('#my-profile').on('click', function() {
[Link] = [Link] +
'/cso/preferences/section=general'
})
$('#logout').on('click', function() {
[Link] = [Link] + '/logout'
})
</script>
<script>
var apiUrlSocket = `{{config('[Link]')}}`;
var socket = io(apiUrlSocket);
//var messages = [Link]('messages');
// var form = [Link]('form');
// var input = [Link]('input');
// [Link]('submit', function(e) {
// [Link]();
// if ([Link]) {
// [Link]('chat message', [Link]);
// [Link] = '';
// }
// });
// [Link]('chat message', function(msg) {
// var item = [Link]('li');
// [Link] = msg;
// [Link](item);
// [Link](0, [Link]);
// });
[Link]('count_all_notif', function(msg) {
//$('#allnotif').text('All Notif (' + msg + ')');
$("#allnotif").html(msg);
});
[Link]('count_device_notif', function(msg) {
$("#devicenotif").html(msg);
_getListNotifDevice();
});
[Link]('count_port_notif', function(msg) {
$("#portnotif").html(msg);
_getListNotifPort();
});
// // Onclick Event
// // onclick every item notification
//$('#itemNotif').on('click', function() {
// $(".itemnotif").click(function(){
// var notification_id = $(this).data('notificationid');
// alert(notification_id);
// [Link]('update_notif_status', { notification_id });
// });
$('#notifall').on('click', function() {
var notification_id = $(this).data('notificationid');
[Link]('notifId:', notification_id);
[Link]('update_notif_status', { notification_id });
[Link]('click_main_notif', 1);
updateStorage();
});
</script>
<script>
$(function(){
$("#navbar").bootnavbar();
});
$(document).ready(function() {
$("#exportexcel").click(function(){
$.ajax({
url : UrlApiNew+'/exportxlsx',
type: "POST",
//dataType:'json',
headers:{
'Authorization' : token
},
success: function(data) {
[Link] = [Link].file_download_url;
setTimeout(() => {
[Link] = baseUrl + '/settlement/export';
}, 2000);
},
error: function(xhr, status) {
[Link]("error download");
}
})
})
$(function() {
$('[data-toggle="tooltip"]').tooltip({
placement: 'auto',
trigger: 'hover click',
boundary: 'HTMLElement',
html: true,
animation: true,
})
});
$('body').on('[Link]', function(e) {
var $target = $([Link]);
$('[role="tooltip"]').hover(function() {
$(this).toggleClass('hover');
});
// $[Link]('[Link]', function(e) {
// if ($('[role="tooltip"]').hasClass('hover')) {
// $('[role="tooltip"]').on('mouseleave', function() {
// $(this).removeClass('show')
// });
// [Link]();
// return;
// }
// });
// });
$(".mobile-search-icon").on("click", function() {
$(".search-bar").addClass("full-search-bar")
}), $(".search-close").on("click", function() {
$(".search-bar").removeClass("full-search-bar")
}),
$('select').selectpicker({
container: 'body'
});
});
});
</script>
<script>
var UrlApiSe = `{{config('[Link]')}}`;
var Url = `{{config('[Link]')}}`;
var UrlApi = `{{config('[Link]')}}`;
var UrlApiNew = `{{config('[Link]')}}`;
var token = `{{config('[Link]')}}`;
var ObvApi = `{{config('[Link]')}}`;
var BearerToken = `{{config('[Link]')}}`;
var urlMap = `{{ config('[Link]') }}`;
var pathname = [Link];
$(document).ready(function() {
getSummaryMenu();
$(document).on('click', '.notifdevice', function() {
// alert("notif device");
var notification_id = $(this).data('notificationid');
// [Link]('notifId:', notification_id);
[Link]('update_notif_status', { notification_id });
[Link]('click_device_notif', 1);
updateStorage();
});
$(document).on('click', '.notifport', function() {
// alert("notif port");
var notification_id = $(this).data('notificationid');
// [Link]('notifId:', notification_id);
[Link]('update_notif_status', { notification_id });
[Link]('click_port_notif', 1);
updateStorage();
});
function updateStorage(){
$.ajax({
url : UrlApiNew+'/allnotifilist?device_type=device',
type: "GET",
//dataType:'json',
headers:{
'Authorization' : token
},
success: function(data) {
var dataNotifDevices = [Link];
[Link]("sDevice", [Link]);
audioDevice([Link]("sDevice"),
[Link]);
},
error: function(xhr, status) {
[Link]("error getAllNotifDevice");
}
});
$.ajax({
url : UrlApiNew+'/allnotifilist?device_type=port',
type: "GET",
//dataType:'json',
headers:{
'Authorization' : token
},
success: function(data) {
var dataNotifPort = [Link];
[Link]("sPort", [Link]);
audioPort([Link]("sPort"), [Link]);
},
error: function(xhr, status) {
[Link]("error getAllNotifPort");
}
});
}
});
var substringMatcher = function(strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
matches = [];
substrRegex = new RegExp(q, 'i');
$.each(strs, function(i, str) {
if ([Link](str)) {
[Link](str);
}
});
cb(matches);
};
};
function audioPort(var1, var2) {
//[Link]=0;
if(var1 < var2 && soundOn == false){
[Link]();
soundOn = true;
} else {
[Link]();
soundOn = false;
}
}
function audioDevice(var1, var2) {
//[Link]=0;
if(var1 < var2 && soundOn == false){
[Link]();
soundOn = true;
} else {
[Link]();
soundOn = false;
}
}
//audio();
// var device = ['[Link] mx80T | Juniper JunOS 17.3R3-s2.2 <br/>pe-id-
[Link]-vpn | Batam Center Indonesia | cso router | 158 port'];
// var state = ['ae0 [Link] <br />IEEE 802.3ad Link Agregate |
40:71:83:af:d8:00 | AGG_TRUNK_PE_HK-IT2.HKG_ae12x10G'];
// $('#the-basics .typeahead').typeahead({});
key_count_global = 0;
function lookup(inputString) {
if ([Link]().length == 0) {
$('#suggestions').fadeOut(); // Hide the suggestions box
} else {
key_count_global++;
setTimeout("lookupwait(" + key_count_global + ",\"" + inputString +
"\")", 300); // Added timeout 0.3s before send query
}
}
function lookupwait(key_count, inputString) {
$('#suggestions').fadeIn();
if (key_count == key_count_global) {
$.ajax({
url: UrlApi + "/csoip/search?limit=10&q=" + inputString,
type: "GET",
crossDomain: true,
success: function(response) {
var html = ''
if ([Link] === 200) {
var DataList = [Link]
if ([Link] > 0) {
var DeviceList = `<div class="tt-dataset tt-dataset-
device">`
DeviceList += `<div class="list-group-item"
style="background-color: rgba(0, 0, 0, 0.05);"><p class="font-10 m-0"><b>Device
Found (${[Link]})</b></p></div>`
for (var i = 0; i < [Link]; i++) {
DeviceList += `<a href="{{ url('/cso/device/device-
overview/did=${[Link][i].device_id}') }}" class="list-group-item tt-
suggestion tt-selectable">
${[Link][i].sysName} $
{[Link][i].hardware} | ${[Link][i].vendor} $
{[Link][i].os} ${[Link][i].version}
<br>${[Link][i].hostname}
| ${[Link][i].location}
</a>`
}
DeviceList += `</div>`
} else {
var DeviceList = ``
}
if ([Link] > 0) {
var PortList = `<div class="tt-dataset tt-dataset-
port">`
PortList += `<div class="list-group-item"
style="background-color: rgba(0, 0, 0, 0.05);"><p class="font-10 m-0"><b>Port Found
(${[Link]})</b></p></div>`
for (var i = 0; i < [Link]; i++) {
PortList += `<a href="{{
url('/cso/devices/overview/did=${[Link][i].device_id}/tab=ports/port=$
{[Link][i].port_id}/show=graphs') }}" class="list-group-item tt-suggestion
tt-selectable">
${[Link][i].ifName} | $
{[Link][i].sysName}
<br>${[Link][i].ifType} | $
{[Link][i].ifPhysAddress} | ${[Link][i].ifDescr}
</a>`
}
PortList += `</div>`
} else {
var PortList = ``
}
if ([Link] > 0) {
var SlaList = `<div class="tt-dataset tt-dataset-
port">`
SlaList += `<div class="list-group-item"
style="background-color: rgba(0, 0, 0, 0.05);"><p class="font-10 m-0"><b>SLA Found
(${[Link]})</b></p></div>`
for (var i = 0; i < [Link]; i++) {
SlaList += `<a href="{{
url('/cso/devices/overview/did=${[Link][i].device_id}/tab=slas/sla=$
{[Link][i].sla_id}/show=graphs') }}" class="list-group-item tt-suggestion
tt-selectable">
${[Link][i].sla_target} | $
{[Link][i].sysName}
<br>${[Link][i].rtt_type} |
${[Link][i].sla_status}
</a>`
}
SlaList += `</div>`
} else {
var SlaList = ``
}
html += DeviceList
html += PortList
html += SlaList
$('#suggestions').fadeIn();
$('#suggestions').html(html);
}
},
error: function(xhr, status) {
// alert("error");
}
});
// $.post("ajax/[Link]", {
// queryString: "" + inputString + ""
// }, function(data) { // Do an AJAX call
// $('#suggestions').fadeIn(); // Show the suggestions box
// $('#suggestions').html(data); // Fill the suggestions box
// });
}
}
// var device = ['[Link] mx80T | Juniper JunOS 17.3R3-s2.2 <br/>pe-id-
[Link]-vpn | Batam Center Indonesia | cso router | 158 port'];
// var state = ['ae0 [Link] <br />IEEE 802.3ad Link Agregate |
40:71:83:af:d8:00 | AGG_TRUNK_PE_HK-IT2.HKG_ae12x10G'];
// $('#the-basics .typeahead').typeahead({
// hint: true,
// highlight: true,
// minLength: 1,
// autocomplete: 'off',
// autofill: 'off',
// },
// {
// name: 'device',
// source: substringMatcher(device, state),
// templates: {
// // empty: [
// // '<div class="list-group search-results-dropdown"><div
class="list-group-item border-0">Nothing found.</div></div>'
// // ],
// header: [
// '<div class="list-group-item" style="background-color:
rgba(0, 0, 0, 0.05);"><p class="font-10 m-0"><b>DEFICE FOUND (1)</b></p></div>'
// ],
// suggestion: function (data) {
// return '<a href="#" class="list-group-item">' + data +
'</a>'
// }
// }
// },{
// name: 'state',
// source: substringMatcher(state),
// templates: {
// // empty: [
// // '<div class="list-group search-results-dropdown"><div
class="list-group-item border-0">Nothing found.</div></div>'
// // ],
// header: [
// '<div class="list-group-item border-top-0"
style="background-color: rgba(0, 0, 0, 0.05);"><p class="font-10 m-0"><b>STATE
FOUND (1)</b></p></div>'
// ],
// suggestion: function (data) {
// return '<a href="#" class="list-group-item d-block">' + data
+ '</a>'
// }
// }
// });
$(".waktu").click(function(){
menit = $(this).data("intervalmenit");
detik = $(this).data("intervaldetik");
if(menit >= 0 && detik >= 0){
hitung();
} else{
}
});
$(".manual").click(function(){
if(menit >= 0 && detik >= 0){
menit = 0;
detik = 0;
$('#msg').html(menit + ' menit ' + detik + ' detik ');
$("#msg").css("display","none");
}
});
function hitung() {
$("#msg").css("display","block");
setTimeout(hitung,1000);
$('#msg').html(menit + ' menit ' + detik + ' detik ');
detik --;
if(detik < 0) {
detik = 59;
menit --;
if(menit < 0) {
menit = 0;
detik = 0;
}
}else if(detik == 0 && menit == 0){
[Link]();
}
}
var _getListNotifDevice = function(){
$.ajax({
url : UrlApiNew+'/allnotifilist?device_type=device',
type: "GET",
//dataType:'json',
headers:{
'Authorization' : token
},
success: function(data) {
var dataNotifDevices = [Link];
var html = "";
var i;
for (i=0; i<[Link]; i++) {
html += '<a class="dropdown-item notifdevice mute" data-
notificationid="'+dataNotifDevices[i].notification_id+'" href="#"
style="color:#b71c1c"><span class="sprite-exclamation-mark me-1
d-inline-block"></span>'+dataNotifDevices[i].title+'</a>';
}
$("#listDevices").empty();
$("#listDevices").html(html);
},
error: function(xhr, status) {
[Link]("error getAllNotifDevice");
}
})
}
_getListNotifDevice();
var _getListNotifPort = function(){
$.ajax({
url : UrlApiNew+'/allnotifilist?device_type=port',
type: "GET",
//dataType:'json',
headers:{
'Authorization' : token
},
success: function(data) {
var dataNotifPort = [Link];
var html = "";
var i;
for (i=0; i<[Link]; i++) {
html += '<a data-
notificationid="'+dataNotifPort[i].notification_id+'" class="dropdown-item
notifport mute" href="#" style="color:#b71c1c">'+dataNotifPort[i].title+'</a>';
}
$("#listPort").empty();
$("#listPort").html(html);
},
error: function(xhr, status) {
[Link]("error getAllNotifPort");
}
})
}
_getListNotifPort();
function getSummaryMenu() {
$.ajax({
url: UrlApiNew + "/summary/devices/device-summary",
type: "GET",
crossDomain: true,
headers : {
'Authorization' : token
},
success: function(response) {
var TotDev = [Link];
var OnDev = [Link];
var OffDev = [Link];
var PortUp = [Link];
var PortAll = [Link];
var PortDown = [Link];
var PortOff = [Link];
$('#MnuDeviceUp').empty();
$('#MnuDeviceDown').empty();
$('#MnuDeviceDowns').empty();
$('#MnuTotPorts').empty();
$('#MnuSttsUp').empty();
$('#MnuSttsWrn').empty();
$('#MnuSttsDgr').empty();
$('#MnuSttsSec').empty();
$('#MnuDeviceUp').append(OnDev);
$('#MnuDeviceDown').append(OffDev);
$('#MnuDeviceDowns').append(OffDev);
$('#MnuTotPorts').append([Link]('id'));
$
('#MnuSttsUp').append([Link]('id'));
$
('#MnuSttsWrn').append([Link]('id'));
$
('#MnuSttsDgr').append([Link]('id'));
$
('#MnuSttsSec').append([Link]('id'));
},
error: function(xhr, status) {
// alert("error");
}
});
}
function getSummaryRouting() {
$.ajax({
url: UrlApiNew + "/summary/csocount",
type: "GET",
crossDomain: true,
headers : {
'Authorization' : token
},
success: function(resp) {
if ([Link] == 200) {
$('#NavCountVRF').html(`(${[Link].vrf_count})`)
$('#NavCountOSPF').html(`(${[Link].ospf_count})`)
$('#NavCountBGP').html(`(${[Link].bgp_all_count})`)
$('#RouteVrfs').html([Link].vrf_count)
$('#RouteOspf').html([Link].ospf_count)
$('#RouteAllSeasons').html([Link].bgp_all_count)
$('#RouteBgpInternal').html([Link].ibgp_all_count)
$('#RouteBgpExternal').html([Link].ebgp_all_count)
$('#RouteBgpAlert').html([Link].alert_bgp_all_count)
}
},
error: function () {
[Link]("error getSummaryRouting")
}
})
}
getSummaryRouting()
</script>