mirror of
https://github.com/outbackdingo/openapi-ui.git
synced 2026-01-28 02:19:48 +00:00
Merge pull request #83 from PRO-Robotech/feature/dev
login/logout envs | fix logs width bug | antdLink added | parsedText styles added
This commit is contained in:
3
.env
3
.env
@@ -22,3 +22,6 @@ VITE_INSTANCES_RESOURCE_NAME=v1alpha1
|
||||
VITE_BFF_URL=
|
||||
|
||||
VITE_NODE_TERMINAL_DEFAULT_PROFILE=baseline
|
||||
|
||||
VITE_LOGIN_URL=/oauth/token
|
||||
VITE_LOGOUT_URL=/oauth/logout
|
||||
|
||||
@@ -24,3 +24,6 @@ INSTANCES_RESOURCE_NAME=
|
||||
BFF_URL=
|
||||
|
||||
NODE_TERMINAL_DEFAULT_PROFILE=
|
||||
|
||||
VITE_LOGIN_URL=
|
||||
VITE_LOGOUT_URL=
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -11,7 +11,7 @@
|
||||
"@ant-design/icons": "5.6.0",
|
||||
"@monaco-editor/react": "4.6.0",
|
||||
"@originjs/vite-plugin-federation": "1.3.6",
|
||||
"@prorobotech/openapi-k8s-toolkit": "^0.0.1-alpha.78",
|
||||
"@prorobotech/openapi-k8s-toolkit": "^0.0.1-alpha.79",
|
||||
"@readme/openapi-parser": "4.0.0",
|
||||
"@reduxjs/toolkit": "2.2.5",
|
||||
"@tanstack/react-query": "5.62.2",
|
||||
@@ -2802,9 +2802,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@prorobotech/openapi-k8s-toolkit": {
|
||||
"version": "0.0.1-alpha.78",
|
||||
"resolved": "https://registry.npmjs.org/@prorobotech/openapi-k8s-toolkit/-/openapi-k8s-toolkit-0.0.1-alpha.78.tgz",
|
||||
"integrity": "sha512-Z5sntLIfIwyMTpGIRmra8hbFETCb+Q1if9VO/MO+FBzfLVxbAWGePhkNU/X934ZG7JfydGBWjLtRgfhDha3XBw==",
|
||||
"version": "0.0.1-alpha.79",
|
||||
"resolved": "https://registry.npmjs.org/@prorobotech/openapi-k8s-toolkit/-/openapi-k8s-toolkit-0.0.1-alpha.79.tgz",
|
||||
"integrity": "sha512-ErZEZOiplg4OrvR4PfkwqoGS1YQ7Ux4x8XngTTJbiKaz6PFVEUns7YwG3+REFnn2EVw2h2f5QX8FKUFeL073AA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@monaco-editor/react": "4.6.0",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"@ant-design/icons": "5.6.0",
|
||||
"@monaco-editor/react": "4.6.0",
|
||||
"@originjs/vite-plugin-federation": "1.3.6",
|
||||
"@prorobotech/openapi-k8s-toolkit": "0.0.1-alpha.78",
|
||||
"@prorobotech/openapi-k8s-toolkit": "0.0.1-alpha.79",
|
||||
"@readme/openapi-parser": "4.0.0",
|
||||
"@reduxjs/toolkit": "2.2.5",
|
||||
"@tanstack/react-query": "5.62.2",
|
||||
|
||||
@@ -57,6 +57,9 @@ const BFF_URL = process.env.LOCAL === 'true' ? options?.BFF_URL : process.env.BF
|
||||
const NODE_TERMINAL_DEFAULT_PROFILE =
|
||||
process.env.LOCAL === 'true' ? options?.NODE_TERMINAL_DEFAULT_PROFILE : process.env.NODE_TERMINAL_DEFAULT_PROFILE
|
||||
|
||||
const LOGIN_URL = process.env.LOCAL === 'true' ? options?.LOGIN_URL : process.env.LOGIN_URL
|
||||
const LOGOUT_URL = process.env.LOCAL === 'true' ? options?.LOGOUT_URL : process.env.LOGOUT_URL
|
||||
|
||||
const healthcheck = require('express-healthcheck')
|
||||
const promBundle = require('express-prom-bundle')
|
||||
|
||||
@@ -176,7 +179,9 @@ app.get(`${basePrefix ? basePrefix : ''}/env.js`, (_, res) => {
|
||||
INSTANCES_API_GROUP: ${JSON.stringify(INSTANCES_API_GROUP) || '"check envs"'},
|
||||
INSTANCES_VERSION: ${JSON.stringify(INSTANCES_VERSION) || '"check envs"'},
|
||||
INSTANCES_RESOURCE_NAME: ${JSON.stringify(INSTANCES_RESOURCE_NAME) || '"check envs"'},
|
||||
NODE_TERMINAL_DEFAULT_PROFILE: ${JSON.stringify(NODE_TERMINAL_DEFAULT_PROFILE) || '"general"'}
|
||||
NODE_TERMINAL_DEFAULT_PROFILE: ${JSON.stringify(NODE_TERMINAL_DEFAULT_PROFILE) || '"general"'},
|
||||
LOGIN_URL: ${JSON.stringify(LOGIN_URL) || '"check envs"'},
|
||||
LOGOUT_URL: ${JSON.stringify(LOGOUT_URL) || '"check envs"'}
|
||||
}
|
||||
`,
|
||||
)
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import axios, { AxiosResponse } from 'axios'
|
||||
import { TAuthResponse } from 'localTypes/auth'
|
||||
import { LOGIN_URL, LOGOUT_URL } from 'constants/customizationApiGroupAndVersion'
|
||||
import { handleError } from './handleResponse'
|
||||
|
||||
export const login = async (): Promise<TAuthResponse | undefined> => {
|
||||
let response: AxiosResponse<TAuthResponse> | undefined
|
||||
|
||||
try {
|
||||
response = await axios.get<TAuthResponse>('/oauth/token', { withCredentials: true })
|
||||
response = await axios.get<TAuthResponse>(LOGIN_URL, { withCredentials: true })
|
||||
} catch (error) {
|
||||
handleError(error)
|
||||
}
|
||||
@@ -18,7 +19,7 @@ export const logout = async (): Promise<TAuthResponse | undefined> => {
|
||||
let response: AxiosResponse<TAuthResponse> | undefined
|
||||
|
||||
try {
|
||||
response = await axios.get<TAuthResponse>('/oauth/logout', { withCredentials: true })
|
||||
response = await axios.get<TAuthResponse>(LOGOUT_URL, { withCredentials: true })
|
||||
} catch (error) {
|
||||
handleError(error)
|
||||
} finally {
|
||||
|
||||
@@ -28,3 +28,6 @@ export const BASE_INSTANCES_RESOURCE_NAME =
|
||||
|
||||
export const NODE_TERMINAL_DEFAULT_PROFILE =
|
||||
window._env_.NODE_TERMINAL_DEFAULT_PROFILE || import.meta.env.VITE_NODE_TERMINAL_DEFAULT_PROFILE
|
||||
|
||||
export const LOGIN_URL = window._env_.LOGIN_URL || import.meta.env.VITE_LOGIN_URL
|
||||
export const LOGOUT_URL = window._env_.LOGOUT_URL || import.meta.env.VITE_LOGOUT_URL
|
||||
|
||||
Reference in New Issue
Block a user