ln.provider/www/ln.provider.pool.js

46 lines
1.6 KiB
JavaScript
Raw Normal View History

2019-10-04 16:36:17 +02:00
LNProvider.initializers.push(
new Promise((resolve,reject)=>{
LN()
.load("/ln.provider.pool.html")
.then((template)=>{
LNProvider.routes.push(
{
path: "/ippool",
label: "IP Pool",
component: {
props: {
LNP: Object,
},
template: template,
data: function(){
return {
allocationWidth: 64,
targetCIDR: "",
independentAllocation: false,
allocationType: 0,
allocationUsage: "",
};
},
computed: {
IPAllocations: ()=>LNP.IPAllocations,
subnetWidth: {
get: function(){
return 128 - this.allocationWidth;
},
set: function(v){
this.allocationWidth = 128 - v;
},
},
},
beforeRouteEnter: function(to,from,next){
LNP.loadIPAllocations();
next();
},
},
}
);
resolve();
});
})
);