You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.3 MiB
JavaScript

4 years ago
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"+/+x":function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n("jGGy"),n("+NEN");var r=n("67Y/"),i=function(){function e(e,t){this.authService=e,this.ubusService=t}return e.prototype.getDeviceInfo=function(){return this.ubusService.call({data:[[this.authService.getSid(),"uci","state",{config:"delos",section:"baptization",option:"DeviceType"}],[this.authService.getSid(),"system.management","version",{}]]}).pipe(Object(r.a)(function(e){return e.result}))},e}()},"+3se":function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"g",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return u}),n.d(t,"b",function(){return c}),n.d(t,"f",function(){return l}),n.d(t,"a",function(){return h});var r=n("LvDl"),i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function o(e){return void 0!==e}function s(e){return void 0===e}function a(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return console.log("Problem with the deepCopy of:",e),{}}}function u(e,t){return!!Object(r.get)(e,t)}function c(e){return e}function l(e,t){return Object(r.template)(e,{interpolate:/\{([\s\S]+?)\}/g})(t)}var h=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}()},"+I7i":function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n("67Y/"),i=(n("+NEN"),n("jGGy"),function(){function e(e,t){this.authService=e,this.ubusService=t}return e.prototype.ip2int32=function(e){if(!e)return null;for(var t=0,n=e.split("."),r=0;r<4;++r)t<<=8,t|=Number(n[r]);return t},e.prototype.ip2bin=function(e){return e.split(".").map(function(e){var t=(e>>>0).toString(2);return t.length<8&&(t=new Array(8-t.length+1).join("0")+t),t}).join("")},e.prototype.cidr2bin=function(e){for(var t=[],n=0;n<4;n++){var r=Math.min(e,8);t.push(256-Math.pow(2,8-r)),e-=r}return t.join(".")},e.prototype.ConvertToUInt=function(e){return e>>>0},e.prototype.OffsetToIP=function(e,t,n){var r=this.ConvertToUInt(this.ip2int32(e)),i=this.ConvertToUInt(this.ip2int32(t)),o=this.ConvertToUInt(r&i)+this.ConvertToUInt(n),s=[o>>24&255,o>>16&255,o>>8&255,255&o];return s[0]+"."+s[1]+"."+s[2]+"."+s[3]},e.prototype.IPToOffset=function(e,t){return this.ConvertToUInt(this.ip2int32(e))&this.ConvertToUInt(this.ip2int32(t))},e.prototype.toNetmask=function(e){var t=new RegExp("^([1-9]|[12][0-9]|3[012])$");return e.match(t)?this.cidr2bin(e):e},e.prototype.getVlanDhcp=function(e){var t=[[this.authService.getSid(),"network.interface","dump",{}],[this.authService.getSid(),"uci","get",{config:"vlan"}]];return e&&t.push([this.authService.getSid(),"uci","get",{config:"dhcp"}]),this.ubusService.call({data:t}).pipe(Object(r.a)(function(e){return e.result.map(function(e){return e[1]})}))},e.prototype.save=function(e,t,n,r){var i={},o=[],s=[],a=this.authService.getSid();if("static"==e.proto?(i={proto:"static",ipaddr:e.ipaddr,netmask:this.toNetmask(e.netmask)},""==e.gateway?o.push("gateway"):i.gateway=e.gateway,""==e.dns?o.push("dns"):i.dns=e.dns):(i.proto="dhcp",o=["ipaddr","netmask","gateway","dns"]),s.push([a,"uci","set",{config:"network",section:r,values:i}]),o.length&&s.push([a,"uci","delete",{config:"network",section:r,options:o}]),t){if("static"==e.proto)if("off"==n.mode)s.push([a,"uci","set",{config:"dhcp",section:r,values:{ignore:1}}]);else{s.push([a,"uci","set",{config:"dhcp",section:r,values:{ignore:0}}]);var u=this.IPToOffset(n.start_address,e.netmask),c=this.IPToOffset(n.end_address,e.netmask)-u;c<1&&(c=1),s.push([a,"uci","set",{config:"dhcp",section:r,values:{start:u}}]),s.push([a,"uci","set",{config:"dhcp",section:r,values:{limit:c}}]),s.push([a,"uci","set",{config:"dhcp",section:r,values:{leasetime:n.leasetime}}])}else s.push([a,"uci","set",{config:"dhcp",section:r,values:{ignore:1}}]);s.push([a,"uci","commit",{config:"dhcp"}])}return s.push([a,"uci","com