"use strict";(self.webpackChunkdatabrix_hub_extension=self.webpackChunkdatabrix_hub_extension||[]).push([[509],{509:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});var o=n(974),a=n(607);const r={id:"databrix-hub-extension:connectionlost",description:"Provides a service to be notified when the connection to the hub server is lost.",requires:[o.JupyterFrontEnd.IPaths],optional:[o.JupyterLab.IInfo],activate:(t,e,n,r)=>{const i=n.load("jupyterlab"),s=e.urls.hubPrefix||"",u=e.urls.base;if(!s)return o.ConnectionLost;let l=!1;return async(e,n)=>{if(l)return;l=!0,r&&(r.isConnected=!1),console.log("Databrix restart dialog is started!");const o=await(0,a.showDialog)({title:i.__("Server unavailable or unreachable"),body:i.__("Your server at %1 is not running.\nxxxxxxxxxxxx?",u),buttons:[a.Dialog.okButton({label:i.__("Restart")}),a.Dialog.cancelButton({label:i.__("Dismiss")})]});r&&(r.isConnected=!0),l=!1,o.button.accept&&await t.commands.execute("help:jupyter-forum")}},autoStart:!0,provides:o.IConnectionLost}}}]);