1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

31 lines
112 KiB
JavaScript
Raw Normal View History

(()=>{var ko=Object.create;var ue=Object.defineProperty,Ho=Object.defineProperties,Wo=Object.getOwnPropertyDescriptor,Bo=Object.getOwnPropertyDescriptors,Vo=Object.getOwnPropertyNames,yn=Object.getOwnPropertySymbols,Fo=Object.getPrototypeOf,bn=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable;var Tn=(i,t,e)=>t in i?ue(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,O=(i,t)=>{for(var e in t||(t={}))bn.call(t,e)&&Tn(i,e,t[e]);if(yn)for(var e of yn(t))zo.call(t,e)&&Tn(i,e,t[e]);return i},He=(i,t)=>Ho(i,Bo(t)),An=i=>ue(i,"__esModule",{value:!0});var q=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Uo=(i,t)=>{An(i);for(var e in t)ue(i,e,{get:t[e],enumerable:!0})},Yo=(i,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Vo(t))!bn.call(i,n)&&n!=="default"&&ue(i,n,{get:()=>t[n],enumerable:!(e=Wo(t,n))||e.enumerable});return i},Ai=i=>Yo(An(ue(i!=null?ko(Fo(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var Si=(i,t,e)=>new Promise((n,r)=>{var o=f=>{try{a(e.next(f))}catch(h){r(h)}},s=f=>{try{a(e.throw(f))}catch(h){r(h)}},a=f=>f.done?n(f.value):Promise.resolve(f.value).then(o,s);a((e=e.apply(i,t)).next())});var sn=q((ro,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:ro,function(){"use strict";function i(){}var t=i.prototype;return t.on=function(e,n){if(!(!e||!n)){var r=this._events=this._events||{},o=r[e]=r[e]||[];return o.indexOf(n)==-1&&o.push(n),this}},t.once=function(e,n){if(!(!e||!n)){this.on(e,n);var r=this._onceEvents=this._onceEvents||{},o=r[e]=r[e]||{};return o[n]=!0,this}},t.off=function(e,n){var r=this._events&&this._events[e];if(!(!r||!r.length)){var o=r.indexOf(n);return o!=-1&&r.splice(o,1),this}},t.emitEvent=function(e,n){var r=this._events&&this._events[e];if(!(!r||!r.length)){r=r.slice(0),n=n||[];for(var o=this._onceEvents&&this._onceEvents[e],s=0;s<r.length;s++){var a=r[s],f=o&&o[a];f&&(this.off(e,a),delete o[a]),a.apply(this,n)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},i})});var di=q((Ep,ui)=>{(function(i,t){typeof define=="function"&&define.amd?define(t):typeof ui=="object"&&ui.exports?ui.exports=t():i.getSize=t()})(window,function(){"use strict";function t(d){var y=parseFloat(d),E=d.indexOf("%")==-1&&!isNaN(y);return E&&y}function e(){}var n=typeof console=="undefined"?e:function(d){console.error(d)},r=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],o=r.length;function s(){for(var d={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},y=0;y<o;y++){var E=r[y];d[E]=0}return d}function a(d){var y=getComputedStyle(d);return y||n("Style returned "+y+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),y}var f=!1,h;function u(){if(!f){f=!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 y=document.body||document.documentElement;y.appendChild(d);var E=a(d);h=Math.round(t(E.width))==200,_.isBoxSizeOuter=h,y.removeChild(d)}}function _(d){if(u(),typeof d=="string"&&(d=document.querySelector(d)),!(!d||typeof d!="object"||!d.nodeType)){var y=a(d);if(y.display=="none")return s();var E={};E.width=d.offsetWidth,E.height=d.offsetHeight;for(var p=E.isBorderBox=y.boxSizing=="border-box",l=0;l<o;l++){var c=r[l],m=y[c],b=parseFloat(m);E[c]=isNaN(b)?0:b}var v=E.paddingLeft+E.paddingRight,S=E.paddingTop+E.paddingBottom,A=E.marginLeft+E.marginRight,C=E.marginTop+E.marginBottom,w=E.borderLeftWidth+E.borderRightWidth,L=E.borderTopWidth+E.borderBottomWidth,N=p&&h,M=t(y.width);M!==!1&&(E.width=M+(N?0:v+w));var Q=t(y.height);return Q!==!1&&(E.height=Q+(N?0:S+L)),E.innerWidth=E.width-(v+w),E.innerHeight=E.height-(S+L),E.
`)}:!a.ok&&"detail"in h?{error:h.detail}:h})}function Po(i){return Si(this,null,function*(){return yield df(i,"GET")})}function*fn(...i){for(let t of i)for(let e of document.querySelectorAll(t))e!==null&&(yield e)}function Ro(i){i.startsWith("data-")||(i=`data-${i}`);for(let t of fn("body > div#netbox-data > *")){let e=t.getAttribute(i);if(af(e))return e}return null}function hf(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 un(i){for(let t of fn("div.card-overlay"))hf(t,i)}window.Collapse=it;window.Modal=Ft;window.Popover=le;window.Toast=Yt;window.Tooltip=gt;function dn(i,t,e,n){let r="mdi-alert";switch(i){case"warning":r="mdi-alert";break;case"success":r="mdi-check-circle";break;case"info":r="mdi-information";break;case"danger":r="mdi-alert";break}let o=document.createElement("div");o.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 a=document.createElement("div");a.setAttribute("class",`toast-header bg-${i} text-body`);let f=document.createElement("i");f.setAttribute("class",`mdi ${r}`);let h=document.createElement("strong");h.setAttribute("class","me-auto ms-1"),h.innerText=t;let u=document.createElement("button");u.setAttribute("type","button"),u.setAttribute("class","btn-close"),u.setAttribute("data-bs-dismiss","toast"),u.setAttribute("aria-label","Close");let _=document.createElement("div");if(_.setAttribute("class","toast-body"),a.appendChild(f),a.appendChild(h),typeof n!="undefined"){let y=document.createElement("small");y.setAttribute("class","text-muted"),a.appendChild(y)}return a.appendChild(u),_.innerText=e.trim(),s.appendChild(a),s.appendChild(_),o.appendChild(s),document.body.appendChild(o),new Yt(s)}function $o(){un("show");let i=Ro("data-object-url");i!==null&&Po(i).then(t=>{if(cn(t)){dn("danger","Error Fetching Device Config",t.error).show(),console.error(t.error);return}else if(cn(t.get_config)){dn("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 r=document.getElementById(`${n}_config`);if(r!==null){let o=t.get_config[n];typeof o=="string"?r.innerHTML=o:r.innerHTML=JSON.stringify(t.get_config[n],null,2)}}}}).finally(()=>{un("hide")})}document.readyState!=="loading"?$o():document.addEventListener("DOMContentLoaded",$o);})();
/*!
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
*/
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* getSize v2.0.3
* measure size of elements
* MIT license
*/