mirror of
https://github.com/nextcloud/server.git
synced 2026-11-25 15:16:20 +01:00
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 line
1.5 KiB
Plaintext
1 line
1.5 KiB
Plaintext
{"version":3,"file":"core-maintenance.mjs","sources":["../core/src/maintenance.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Axios from '@nextcloud/axios'\nimport { getRootUrl } from '@nextcloud/router'\nimport { logger } from './utils/logger.ts'\n\nconst url = getRootUrl() + '/status.php'\n\n/**\n * Reload the page once the maintenance mode ends.\n */\nfunction check() {\n\tlogger.info('checking the Nextcloud maintenance status')\n\tAxios.get(url)\n\t\t.then((resp) => resp.data)\n\t\t.then((status) => {\n\t\t\tif (status.maintenance === false) {\n\t\t\t\tlogger.info('Nextcloud is not in maintenance mode anymore -> reloading')\n\n\t\t\t\twindow.location.reload()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlogger.info('Nextcloud is still in maintenance mode')\n\n\t\t\t// Wait 20sec before the next request\n\t\t\tsetTimeout(check, 20 * 1000)\n\t\t})\n\t\t.catch((error) => logger.error('Could not check the maintenance status', { error }))\n}\n\n// Off we go!\ncheck()\n"],"names":["url","getRootUrl","check","logger","Axios","resp","status","error"],"mappings":"yNASA,MAAMA,EAAMC,IAAe,cAK3B,SAASC,GAAQ,CAChBC,EAAO,KAAK,2CAA2C,EACvDC,EAAM,IAAIJ,CAAG,EACX,KAAMK,GAASA,EAAK,IAAI,EACxB,KAAMC,GAAW,CACjB,GAAIA,EAAO,cAAgB,GAAO,CACjCH,EAAO,KAAK,2DAA2D,EAEvE,OAAO,SAAS,OAAA,EAChB,MACD,CAEAA,EAAO,KAAK,wCAAwC,EAGpD,WAAWD,EAAO,GAAK,GAAI,CAC5B,CAAC,EACA,MAAOK,GAAUJ,EAAO,MAAM,yCAA0C,CAAE,MAAAI,CAAA,CAAO,CAAC,CACrF,CAGAL,EAAA"} |