1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/project-static/dist/config.js

25 lines
105 KiB
JavaScript
Raw Normal View History

2022-10-04 22:00:32 +02:00
(()=>{var yr=Object.create;var he=Object.defineProperty,Tr=Object.defineProperties,br=Object.getOwnPropertyDescriptor,Ar=Object.getOwnPropertyDescriptors,Sr=Object.getOwnPropertyNames,vn=Object.getOwnPropertySymbols,Or=Object.getPrototypeOf,yn=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable;var Tn=(i,t,e)=>t in i?he(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,O=(i,t)=>{for(var e in t||(t={}))yn.call(t,e)&&Tn(i,e,t[e]);if(vn)for(var e of vn(t))wr.call(t,e)&&Tn(i,e,t[e]);return i},Ve=(i,t)=>Tr(i,Ar(t)),bn=i=>he(i,"__esModule",{value:!0});var Nt=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Cr=(i,t)=>{bn(i);for(var e in t)he(i,e,{get:t[e],enumerable:!0})},Lr=(i,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Sr(t))!yn.call(i,n)&&n!=="default"&&he(i,n,{get:()=>t[n],enumerable:!(e=br(t,n))||e.enumerable});return i},Nr=i=>Lr(bn(he(i!=null?yr(Or(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var Ai=(i,t,e)=>new Promise((n,o)=>{var r=u=>{try{l(e.next(u))}catch(p){o(p)}},s=u=>{try{l(e.throw(u))}catch(p){o(p)}},l=u=>u.done?n(u.value):Promise.resolve(u.value).then(r,s);l((e=e.apply(i,t)).next())});var rn=Nt((rr,fi)=>{(function(i,t){typeof define=="function"&&define.amd?define(t):typeof fi=="object"&&fi.exports?fi.exports=t():i.EvEmitter=t()})(typeof window!="undefined"?window:rr,function(){"use strict";function i(){}var t=i.prototype;return t.on=function(e,n){if(!(!e||!n)){var o=this._events=this._events||{},r=o[e]=o[e]||[];return r.indexOf(n)==-1&&r.push(n),this}},t.once=function(e,n){if(!(!e||!n)){this.on(e,n);var o=this._onceEvents=this._onceEvents||{},r=o[e]=o[e]||{};return r[n]=!0,this}},t.off=function(e,n){var o=this._events&&this._events[e];if(!(!o||!o.length)){var r=o.indexOf(n);return r!=-1&&o.splice(r,1),this}},t.emitEvent=function(e,n){var o=this._events&&this._events[e];if(!(!o||!o.length)){o=o.slice(0),n=n||[];for(var r=this._onceEvents&&this._onceEvents[e],s=0;s<o.length;s++){var l=o[s],u=r&&r[l];u&&(this.off(e,l),delete r[l]),l.apply(this,n)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},i})});var hi=Nt((Kh,di)=>{(function(i,t){typeof define=="function"&&define.amd?define(t):typeof di=="object"&&di.exports?di.exports=t():i.getSize=t()})(window,function(){"use strict";function t(d){var E=parseFloat(d),v=d.indexOf("%")==-1&&!isNaN(E);return v&&E}function e(){}var n=typeof console=="undefined"?e:function(d){console.error(d)},o=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=o.length;function s(){for(var d={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},E=0;E<r;E++){var v=o[E];d[v]=0}return d}function l(d){var E=getComputedStyle(d);return E||n("Style returned "+E+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),E}var u=!1,p;function f(){if(!u){u=!0;var d=document.createElement("div");d.style.width="200px",d.style.padding="1px 2px 3px 4px",d.style.borderStyle="solid",d.style.borderWidth="1px 2px 3px 4px",d.style.boxSizing="border-box";var E=document.body||document.documentElement;E.appendChild(d);var v=l(d);p=Math.round(t(v.width))==200,_.isBoxSizeOuter=p,E.removeChild(d)}}function _(d){if(f(),typeof d=="string"&&(d=document.querySelector(d)),!(!d||typeof d!="object"||!d.nodeType)){var E=l(d);if(E.display=="none")return s();var v={};v.width=d.offsetWidth,v.height=d.offsetHeight;for(var h=v.isBorderBox=E.boxSizing=="border-box",a=0;a<r;a++){var c=o[a],m=E[c],y=parseFloat(m);v[c]=isNaN(y)?0:y}var T=v.paddingLeft+v.paddingRight,b=v.paddingTop+v.paddingBottom,A=v.marginLeft+v.marginRight,w=v.marginTop+v.marginBottom,L=v.borderLeftWidth+v.borderRightWidth,N=v.borderTopWidth+v.borderBottomWidth,x=h&&p,C=t(E.width);C!==!1&&(v.width=C+(x?0:T+L));var V=t(E.height);return V!==!1&&(v.height=V+(x?0:b+N)),v.innerWidth=v.width-(T+L),v.innerHeight=v.height-(b+N)
`)}:!s.ok&&"detail"in u?{error:u.detail}:u})}function fr(i){return Ai(this,null,function*(){return yield Nc(i,"GET")})}function*an(...i){for(let t of i)for(let e of document.querySelectorAll(t))e!==null&&(yield e)}function dr(i){i.startsWith("data-")||(i=`data-${i}`);for(let t of an("body > div#netbox-data > *")){let e=t.getAttribute(i);if(Lc(e))return e}return null}function xc(i,t){i!==null&&(typeof t=="undefined"?window.getComputedStyle(i).display==="none"?i.style.display="":i.style.display="none":t==="show"?i.style.display="":i.style.display="none")}function ln(i){for(let t of an("div.card-overlay"))xc(t,i)}window.Collapse=et;window.Modal=Kt;window.Popover=ce;window.Toast=Gt;window.Tooltip=mt;function cn(i,t,e,n){let o="mdi-alert";switch(i){case"warning":o="mdi-alert";break;case"success":o="mdi-check-circle";break;case"info":o="mdi-information";break;case"danger":o="mdi-alert";break}let r=document.createElement("div");r.setAttribute("class","toast-container position-fixed bottom-0 end-0 m-3");let s=document.createElement("div");s.setAttribute("class",`toast bg-${i}`),s.setAttribute("role","alert"),s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true");let l=document.createElement("div");l.setAttribute("class",`toast-header bg-${i} text-body`);let u=document.createElement("i");u.setAttribute("class",`mdi ${o}`);let p=document.createElement("strong");p.setAttribute("class","me-auto ms-1"),p.innerText=t;let f=document.createElement("button");f.setAttribute("type","button"),f.setAttribute("class","btn-close"),f.setAttribute("data-bs-dismiss","toast"),f.setAttribute("aria-label","Close");let _=document.createElement("div");if(_.setAttribute("class","toast-body"),l.appendChild(u),l.appendChild(p),typeof n!="undefined"){let E=document.createElement("small");E.setAttribute("class","text-muted"),l.appendChild(E)}return l.appendChild(f),_.innerText=e.trim(),s.appendChild(l),s.appendChild(_),r.appendChild(s),document.body.appendChild(r),new Gt(s)}function hr(){ln("show");let i=dr("data-object-url");i!==null&&fr(i).then(t=>{if(sn(t)){cn("danger","Error Fetching Device Config",t.error).show(),console.error(t.error);return}else if(sn(t.get_config)){cn("danger","Error Fetching Device Config",t.get_config.error).show(),console.error(t.get_config.error);return}else{let e=["running","startup","candidate"];for(let n of e){let o=document.getElementById(`${n}_config`);if(o!==null){let r=t.get_config[n];typeof r=="string"?o.innerHTML=r:o.innerHTML=JSON.stringify(t.get_config[n],null,2)}}}}).finally(()=>{ln("hide")})}document.readyState!=="loading"?hr():document.addEventListener("DOMContentLoaded",hr);})();
/*!
2021-08-30 11:02:47 -07:00
* Bootstrap v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Masonry v4.2.2
* Cascading grid layout library
* https://masonry.desandro.com
* MIT License
* by David DeSandro
*/
/*!
* Outlayer v2.1.1
* the brains and guts of a layout library
* MIT license
*/
/*!
* getSize v2.0.3
* measure size of elements
* MIT license
*/