Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions structures-frontend-next/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare module 'vue' {
CrudTable: typeof import('./src/components/CrudTable.vue')['default']
DashboardWidgetCard: typeof import('./src/components/DashboardWidgetCard.vue')['default']
DataTable: typeof import('primevue/datatable')['default']
Dialog: typeof import('primevue/dialog')['default']
EmptyState: typeof import('./src/components/EmptyState.vue')['default']
EnumNode: typeof import('./src/components/nodes/EnumNode.vue')['default']
ERTable: typeof import('./src/components/modals/ERTable.vue')['default']
Expand All @@ -34,6 +35,7 @@ declare module 'vue' {
Menu: typeof import('primevue/menu')['default']
NewProjectSidebar: typeof import('./src/components/NewProjectSidebar.vue')['default']
ObjectNode: typeof import('./src/components/nodes/ObjectNode.vue')['default']
OpenAPIModal: typeof import('./src/components/modals/OpenAPIModal.vue')['default']
Paginator: typeof import('primevue/paginator')['default']
Password: typeof import('primevue/password')['default']
Popover: typeof import('primevue/popover')['default']
Expand Down
43 changes: 38 additions & 5 deletions structures-frontend-next/public/scalar-ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
</style>
</head>
<body>
<!-- Add your own OpenAPI/Swagger spec file URL here: -->
<!-- You can also set a full configuration object like this -->
<script id="api-reference"></script>
<!-- easier for nested objects -->
<script>
function getQueryParam(name) {
const urlParams = new URLSearchParams(window.location.search);
Expand All @@ -35,14 +32,50 @@

const namespace = getQueryParam('namespace') || 'default';
let apiReference = document.getElementById('api-reference')
const configuration = {
window.addEventListener('message', (event) => {
const { token, namespace: messageNamespace } = event.data || {}

if (!token || !messageNamespace) {
console.error('Missing token or namespace in message')
return
}

const finalNamespace = messageNamespace || namespace
const configuration = {
isEditable: false,
layout: "modern",
spec: {
url: `${getBaseUrl()}/api-docs/${finalNamespace}/openapi.json`
},
authentication: {
preferredSecurityScheme: 'http',
http: {
scheme: 'bearer',
bearerFormat: 'JWT'
}
},
requestInterceptor: (request) => {
if (token) {
if (token.includes('.')) {
request.headers['Authorization'] = `Bearer ${token}`
} else {
request.headers['Authorization'] = `Basic ${token}`
}
}
return request
}
}
apiReference.dataset.configuration = JSON.stringify(configuration)
})

const fallbackConfiguration = {
isEditable: false,
layout: "modern",
spec: {
url: `${getBaseUrl()}/api-docs/${namespace}/openapi.json`
}
}
apiReference.dataset.configuration = JSON.stringify(configuration)
apiReference.dataset.configuration = JSON.stringify(fallbackConfiguration)

</script>
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
Expand Down
17 changes: 17 additions & 0 deletions structures-frontend-next/src/assets/login-page-logo-new.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions structures-frontend-next/src/assets/login-page-symbol-new.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions structures-frontend-next/src/assets/login-page-symbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions structures-frontend-next/src/assets/mcp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading