diff --git a/libs/velo-external-db-core/src/router.ts b/libs/velo-external-db-core/src/router.ts index 792bb0246..2a59f59a6 100644 --- a/libs/velo-external-db-core/src/router.ts +++ b/libs/velo-external-db-core/src/router.ts @@ -88,7 +88,7 @@ export const createRouter = () => { router.use(compression()) router.use('/assets', express.static(path.join(__dirname, 'assets'))) const jwtAuthenticator = new JwtAuthenticator(cfg.externalDatabaseId, cfg.allowedMetasites, new WixDataFacade(cfg.wixDataBaseUrl)) - router.use(unless(['/', '/info', '/capabilities', '/favicon.ico', '/provision'], jwtAuthenticator.authorizeJwt())) + router.use(unless(['/', '/info', '/capabilities', '/favicon.ico', '/provision', '/connectionStatus'], jwtAuthenticator.authorizeJwt())) config.forEach(({ pathPrefix, roles }) => router.use(includes([pathPrefix], authRoleMiddleware({ roles })))) @@ -136,6 +136,11 @@ export const createRouter = () => { res.json({ dataSourceId: externalDatabaseId }) }) + router.get('/connectionStatus', async(req, res) => { + const appInfo = await appInfoFor(operationService, externalDbConfigClient, cfg.hideAppInfo) + res.json({ ...appInfo }) + }) + // *************** Data API ********************** router.post('/data/query', async(req, res, next) => { try { diff --git a/libs/velo-external-db-core/src/views/index.ejs b/libs/velo-external-db-core/src/views/index.ejs index 4e17317cc..568d0b4f8 100644 --- a/libs/velo-external-db-core/src/views/index.ejs +++ b/libs/velo-external-db-core/src/views/index.ejs @@ -9,102 +9,119 @@ + + + - -
- width="427" height="231"> +
- - - - <% - const connectionColor = dbConnectionStatus === 'Connected to database successfully' ? 'success': 'danger' - const configStatusColor = configReaderStatus === 'External DB Config read successfully' ? 'success' : 'danger' - let authorizationStatusColor - if (authorizationConfigStatus === 'Permissions config read successfully') { - authorizationStatusColor = 'success' - } else if (authorizationConfigStatus === 'Permissions config not defined, using default') { - authorizationStatusColor = 'warning' - } else { - authorizationStatusColor = 'danger' - } - %> - - -
- -