123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- function vlanAcquire(element) {
- id = element.id;
- let modalContent = document.getElementById("content-cvmodal");
- let splited = id.split("_");
- let data = splited[1].split("/");
- let realm = data[0];
- let svlan = data[1];
- let cvlan = data[2];
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "?module=vlanmanagement&action=ajax&realm_id=" + realm + "&svlan_id=" + svlan + "&cvlan_num=" + cvlan, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- };
- }
- function occupiedBySwitch(element) {
- id = element.id;
- let modalContent = document.getElementById("content-cvmodal");
- let splited = id.split("_");
- let data = splited[1].split("/");
- let realm = data[0];
- let svlan = data[1];
- let cvlan = data[2];
- let switchid = data[3];
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "?module=vlanmanagement&action=ajaxswitch&realm_id=" + realm + "&svlan_id=" + svlan + "&cvlan_num=" + cvlan + "&switchid=" + switchid, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- };
- }
- function occupiedByCustomer(element) {
- id = element.id;
- let modalContent = document.getElementById("content-cvmodal");
- let splited = id.split("_");
- let data = splited[1].split("/");
- let realm = data[0];
- let svlan = data[1];
- let cvlan = data[2];
- let switchid = data[3];
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "?module=vlanmanagement&action=ajaxcustomer&realm_id=" + realm + "&svlan_id=" + svlan + "&cvlan_num=" + cvlan + "&switchid=" + switchid, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- };
- }
- function occupiedByOltZte(element) {
- id = element.id;
- let modalContent = document.getElementById("content-cvmodal");
- let splited = id.split("_");
- let data = splited[1].split("/");
- let realm = data[0];
- let svlan = data[1];
- let cvlan = data[2];
- let switchid = data[3];
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "?module=vlanmanagement&action=ajaxoltzte&realm_id=" + realm + "&svlan_id=" + svlan + "&cvlan_num=" + cvlan + "&switchid=" + switchid, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- };
- }
- function occupiedByOltNonZte(element) {
- id = element.id;
- let modalContent = document.getElementById("content-cvmodal");
- let splited = id.split("_");
- let data = splited[1].split("/");
- let realm = data[0];
- let svlan = data[1];
- let cvlan = data[2];
- let switchid = data[3];
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "?module=vlanmanagement&action=ajaxoltnonzte&realm_id=" + realm + "&svlan_id=" + svlan + "&cvlan_num=" + cvlan + "&switchid=" + switchid, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- };
- }
- function realmEdit(element) {
- let modalContent = document.getElementById("content-cvmodal");
- let xhr = new XMLHttpRequest();
- xhr.open("POST", "?module=vlanmanagement&realms=true&action=ajaxedit", true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send("realm_encode=" + element.id);
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- }
- }
- function svlanEdit(element) {
- let modalContent = document.getElementById("content-cvmodal");
- let xhr = new XMLHttpRequest();
- xhr.open("POST", "?module=vlanmanagement&svlan=true&action=ajaxedit", true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send("svlan_encode=" + element.id);
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- }
- }
- function qinqEdit(element) {
- let modalContent = document.getElementById("content-cvmodal");
- let xhr = new XMLHttpRequest();
- xhr.open("POST", "?module=universalqinq&action=ajaxedit", true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send("universal_encode=" + element.id);
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- }
- }
- function modalOpen() {
- $("#dialog-modal_cvmodal").dialog({
- autoOpen: true,
- width: 'auto',
- height: 'auto',
- modal: true,
- show: "drop",
- hide: "fold"
- });
- $("#opener_cvmodal").click(function () {
- $("#dialog-modal_cvmodal").dialog("open");
- return false;
- });
- }
- function loadQinqOptions(interface, swid) {
- let container = document.getElementById('qinqcontainer');
- let xhr = new XMLHttpRequest();
- let url2 = "?module=zteunreg&action=ajaxlogin&swid=" + swid + "&interface=" + interface;
- xhr.open("GET", url2, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- let decoded = JSON.parse(response);
- container.innerHTML = decoded.result;
- };
- }
- function getQinqByLogin(login, interface, swid) {
- let container = document.getElementById('qinqcontainer');
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "?module=zteunreg&action=ajaxlogin&login=" + login + "&interface=" + interface + "&swid=" + swid, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- let decoded = JSON.parse(response);
- container.innerHTML = decoded.main;
- if (decoded.svlan != 'none') {
- let table = document.getElementById("qinqoptions");
- let newRow1 = table.insertRow(-1);
- let newCell1 = newRow1.insertCell(-1);
- newCell1.innerHTML = decoded.cell1;
- let newCell2 = newRow1.insertCell(-1);
- newCell2.innerHTML = decoded.cell2;
- let newRow2 = table.insertRow(-1);
- let newCell3 = newRow2.insertCell(-1);
- newCell3.innerHTML = decoded.cell3;
- let newCell4 = newRow2.insertCell(-1);
- newCell4.innerHTML = decoded.cell4;
- }
- };
- }
- function validateVlanUsernameForm(oltId, onuId, port, vlan, type, interface, interface_olt, snmp_index) {
- let formId = 'usernameForm---' + oltId + '---' + onuId + '---' + port;
- let usernameId = 'usernameInput---' + oltId + '---' + onuId + '---' + port;
- let container = document.getElementById(formId);
- let username = document.getElementById(usernameId).value;
- let modalContent = document.getElementById("content-cvmodal");
- let xhr = new XMLHttpRequest();
- xhr.open("GET", "/?module=vlanmanagement_onu_apply&ajax_username_validate=true&username=" + username + "&oltid=" + oltId + "&onuid=" + onuId + "&port=" + port + "&vlan=" + vlan + "&type=" + type + "&interface=" + interface + "&interface_olt=" + interface_olt + "&snmp_index=" + snmp_index, true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send();
- xhr.onload = function () {
- let response = xhr.response;
- modalContent.innerHTML = response;
- modalOpen();
- };
- return false;
- }
- $( "#Form_register_submit" ).click(function() {
- $(this).attr("disabled", "disabled");
- });
|