1
|
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="743787e3-e8af-4e26-bfc1-784fb2440e1f",e._sentryDebugIdIdentifier="sentry-dbid-743787e3-e8af-4e26-bfc1-784fb2440e1f")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"6845f9ce010d5a446e5d4a40f17204cb8341a07a"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[9360],{79360:function(e,n,t){t.r(n),t.d(n,{default:function(){return I}});var r=t(67294),o=t(89250),a=(t(47042),t(91038),t(77601),t(82526),t(41817),t(32165),t(29439)),c=t(15861),i=t(64687),u=t.n(i),l=(t(66992),t(41539),t(78783),t(33948),t(41637),t(74916),t(64765),t(88674),t(60285),t(39714),t(21249),t(57640),t(9924),t(64211),t(2490),t(41874),t(23157),t(57327),t(88449),t(59849),t(9170),t(34668),t(92222),t(64969)),f=t(13477),d=t(28234),s=t(18761);function p(e,n){var t="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"===typeof e)return m(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,n)}(e))||n&&e&&"number"===typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return c=e.done,e},e:function(e){i=!0,a=e},f:function(){try{c||null==t.return||t.return()}finally{if(i)throw a}}}}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var h=new URLSearchParams(window.location.search.substr(1)),y=function(){location.assign("https://registry.my-netdata.io/goto-host-from-alarm.html".concat(location.search))},v=function(){var e=(0,c.Z)(u().mark((function e(n,t){var r,o,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,s.XG)(t,n);case 3:return r=e.sent,e.abrupt("return",r.data);case 7:throw e.prev=7,e.t0=e.catch(0),o=e.t0.response.data,document.body.innerHTML="".concat((0,d.r)(null===o||void 0===o?void 0:o.errorMsgKey),"</br></br>Getting you back to Netdata..."),(a=new Error((0,d.r)(null===o||void 0===o?void 0:o.errorMsgKey)||"Redirect error")).name="".concat((null===o||void 0===o?void 0:o.errorMsgKey)||"Server error"),a.stack="".concat((null===o||void 0===o?void 0:o.errorCode)||"Redirect error code"),a;case 15:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n,t){return e.apply(this,arguments)}}(),b=function(e){return fetch(e,{redirect:"follow"}).then((function(){return e}))},g=function(e){var n,t="top;nowelcome=1",r=p(h.entries());try{for(r.s();!(n=r.n()).done;){var o=(0,a.Z)(n.value,2),c=o[0],i=o[1];"agentID"!==(c=decodeURIComponent(c))&&(t+=";".concat(encodeURIComponent(c)),""!==(i=decodeURIComponent(i))&&(t+="=".concat(encodeURIComponent(i))))}}catch(l){r.e(l)}finally{r.f()}var u=new URL(e);return"/"===u.pathname&&(u.pathname=""),u.hash=t,u.toString()},w=function(){var e=(0,f.jr)(),n=(0,o.TH)().search;return(0,r.useEffect)((function(){e&&function(e,n){if(h.has("agentID")){var t=decodeURIComponent(h.get("agentID")||"unknown_agent_id");v(t,e).catch((function(e){if("ErrVisitedNodeNotFound"!==(null===e||void 0===e?void 0:e.name))throw document.body.innerHTML="<p>".concat(null===e||void 0===e?void 0:e.message,"</p>"),e;y()})).then((function(e){var t,r=null===e||void 0===e||null===(t=e.urls)||void 0===t?void 0:t.map(g),o="https:"===location.protocol&&r.some((function(e){return!e.startsWith("https:")})),a=o?r.filter((function(e){return e.startsWith("https:")})):r;if(0!==a.length)return Promise.any(a.map(b)).then((function(){location.assign("url".concat(n))}),(function(){o?location.protocol="http:":document.body.innerHTML="\n <ul>\n ".concat(r.map((function(e){return'<li><a href="'.concat(encodeURIComponent(e),'" target="_blank" rel="noopener noreferrer">').concat(e,"</a></li>")})).join("\n"),"\n </ul>\n ")}));o?location.protocol="http:":y()}))}else document.body.innerHTML='<p>missing "agentID" query string parameter</p>'}(e,n||"")}),[e,n]),r.createElement(l.H4,null,"Redirecting...")},I=function(){return r.createElement(o.Z5,null,r.createElement(o.AW,{path:"/redirects/alerts",element:r.createElement(w,null)}),r.createElement(o.AW,{path:"/redirects/alarms",element:r.createElement(w,null)})," ")}}}]);
|