Skip to content

Commit 01e99b9

Browse files
committed
feat: update Docker exec command and enhance Nuxt configuration
- Changed the `exec` command in the Makefile to use `docker exec` instead of `docker run`. - Added environment variable handling for `SESAME_ALLOWED_HOSTS` in `nuxt.config.ts`. - Included logging for `SESAME_APP_API_URL` and `SESAME_ALLOWED_HOSTS` in `nuxt.config.ts`. - Updated Nuxt configuration to set compatibility date and added Monaco Editor configuration. - Added Monaco Editor as a dependency in `package.json`. - Refactored styles in `quasar-jsonform` components to use a new `types.ts` file for style definitions. - Updated `table.vue` to integrate Monaco Editor for displaying JSON data. - Created a new lifecycle table component with improved data handling and pagination.
1 parent 25583d6 commit 01e99b9

File tree

11 files changed

+471
-154
lines changed

11 files changed

+471
-154
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ install:
5151
$(IMGNAME) yarn install
5252

5353
exec:
54-
docker run -it --rm \
55-
-e NODE_ENV=development \
56-
-v $(CURDIR):/data \
57-
$(IMGNAME) bash
54+
docker exec -it $(APPNAME) bash
5855

5956
generate-ssl-cert: ## Générer les certificats HTTPS auto-signés
6057
@echo "Génération des certificats HTTPS auto-signés..."

nuxt.config.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ import pugPlugin from 'vite-plugin-pug'
44
import openapiTS from 'openapi-typescript'
55
import { defineNuxtConfig } from 'nuxt/config'
66
import { parse } from 'yaml'
7-
import consola from 'consola'
7+
import * as consola from 'consola'
88

99
const SESAME_APP_API_URL = process.env.SESAME_APP_API_URL || 'http://localhost:4002'
10+
const SESAME_ALLOWED_HOSTS = process.env.SESAME_ALLOWED_HOSTS ? process.env.SESAME_ALLOWED_HOSTS.split(',') : []
11+
12+
if (SESAME_ALLOWED_HOSTS.length === 0 && !/localhost/.test(SESAME_APP_API_URL) && process.env.NODE_ENV === 'development') {
13+
SESAME_ALLOWED_HOSTS.push(new URL(SESAME_APP_API_URL).hostname)
14+
}
15+
16+
consola.info(`[Nuxt] SESAME_APP_API_URL: ${SESAME_APP_API_URL}`)
17+
consola.info(`[Nuxt] SESAME_ALLOWED_HOSTS: ${SESAME_ALLOWED_HOSTS}`)
1018

1119
let SESAME_APP_DARK_MODE: 'auto' | boolean = false
1220
if (process.env.SESAME_APP_DARK_MODE) {
@@ -32,6 +40,7 @@ if (/yes|1|on|true/i.test(`${process.env.SESAME_HTTPS_ENABLED}`)) {
3240

3341
// https://nuxt.com/docs/api/configuration/nuxt-config
3442
export default defineNuxtConfig({
43+
compatibilityDate: '2024-04-03',
3544
ssr: false,
3645
telemetry: false,
3746
pages: true,
@@ -66,6 +75,7 @@ export default defineNuxtConfig({
6675
'@vueuse/nuxt',
6776
'dayjs-nuxt',
6877
'@nuxt/devtools',
78+
'nuxt-monaco-editor',
6979
],
7080
auth: {
7181
globalMiddleware: true,
@@ -154,7 +164,18 @@ export default defineNuxtConfig({
154164
animations: 'all',
155165
},
156166
},
167+
monacoEditor: {
168+
locale: 'fr',
169+
removeSourceMaps: false,
170+
componentName: {
171+
codeEditor: 'MonacoEditor',
172+
diffEditor: 'MonacoDiffEditor',
173+
},
174+
},
157175
vite: {
176+
server: {
177+
allowedHosts: ['localhost', ...SESAME_ALLOWED_HOSTS],
178+
},
158179
define: {
159180
'process.env.DEBUG': process.env.NODE_ENV === 'development',
160181
},

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"fast-password-entropy": "^1.1.1",
3232
"hibp": "^14.1.2",
3333
"moment": "^2.30.1",
34+
"monaco-editor": "^0.52.2",
3435
"openapi-fetch": "^0.8.2",
3536
"pinia": "^2.1.7",
3637
"qs": "^6.14.0",
@@ -55,6 +56,7 @@
5556
"memfs": "^4.8.2",
5657
"nuxt": "^3.16.0",
5758
"nuxt-quasar-ui": "^2.0.7",
59+
"nuxt-monaco-editor": "^1.3.2",
5860
"openapi-typescript": "^6.7.4",
5961
"prettier": "^3.2.4",
6062
"typescript": "^5.3.3",
@@ -66,4 +68,4 @@
6668
"resolutions": {
6769
"string-width": "^1.0.2 || 2 || 3 || 4"
6870
}
69-
}
71+
}

src/components/quasar-jsonform/styles/defaultStyles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Styles } from './style';
1+
import type { Styles } from './types';
22

33
export const defaultStyles: Styles = {
44
control: {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from './types';
12
export * from './defaultStyles';
23
export * from './style';
34
export * from './utils';
Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { UISchemaElement } from '@jsonforms/core';
1+
import type { UISchemaElement } from '@jsonforms/core';
22
import { inject } from 'vue';
33
import merge from 'lodash/merge';
4+
import type { Styles } from './types';
45
import { defaultStyles } from './defaultStyles';
56

67
const createEmptyStyles = (): Styles => ({
@@ -14,64 +15,6 @@ const createEmptyStyles = (): Styles => ({
1415
categorization: {},
1516
});
1617

17-
export interface Styles {
18-
control: {
19-
root?: string;
20-
input?: string;
21-
};
22-
verticalLayout: {
23-
root?: string;
24-
item?: string;
25-
};
26-
horizontalLayout: {
27-
root?: string;
28-
item?: string;
29-
};
30-
group: {
31-
root?: string;
32-
label?: string;
33-
item?: string;
34-
bare?: string;
35-
alignLeft?: string;
36-
};
37-
arrayList: {
38-
root?: string;
39-
toolbar?: string;
40-
validationIcon?: string;
41-
container?: string;
42-
addButton?: string;
43-
label?: string;
44-
noData?: string;
45-
item?: string;
46-
itemContainer?: string;
47-
itemHeader?: string;
48-
itemLabel?: string;
49-
itemContent?: string;
50-
itemMoveUp?: string;
51-
itemMoveDown?: string;
52-
itemDelete?: string;
53-
};
54-
listWithDetail: {
55-
root?: string;
56-
toolbar?: string;
57-
addButton?: string;
58-
label?: string;
59-
noData?: string;
60-
item?: string;
61-
itemLabel?: string;
62-
itemContent?: string;
63-
itemMoveUp?: string;
64-
itemMoveDown?: string;
65-
itemDelete?: string;
66-
};
67-
label: {
68-
root?: string;
69-
};
70-
categorization: {
71-
root?: string;
72-
};
73-
}
74-
7518
export const useStyles = (element?: UISchemaElement): Styles => {
7619
const userStyles = inject('styles', defaultStyles);
7720
if (!element?.options?.styles) {
@@ -87,4 +30,4 @@ export const useStyles = (element?: UISchemaElement): Styles => {
8730
merge(styles, element.options.styles);
8831
}
8932
return styles;
90-
};
33+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
export interface Styles {
2+
control: {
3+
root?: string;
4+
input?: string;
5+
};
6+
verticalLayout: {
7+
root?: string;
8+
item?: string;
9+
};
10+
horizontalLayout: {
11+
root?: string;
12+
item?: string;
13+
};
14+
group: {
15+
root?: string;
16+
label?: string;
17+
item?: string;
18+
bare?: string;
19+
alignLeft?: string;
20+
};
21+
arrayList: {
22+
root?: string;
23+
toolbar?: string;
24+
validationIcon?: string;
25+
container?: string;
26+
addButton?: string;
27+
label?: string;
28+
noData?: string;
29+
item?: string;
30+
itemContainer?: string;
31+
itemHeader?: string;
32+
itemLabel?: string;
33+
itemContent?: string;
34+
itemMoveUp?: string;
35+
itemMoveDown?: string;
36+
itemDelete?: string;
37+
};
38+
listWithDetail: {
39+
root?: string;
40+
toolbar?: string;
41+
addButton?: string;
42+
label?: string;
43+
noData?: string;
44+
item?: string;
45+
itemLabel?: string;
46+
itemContent?: string;
47+
itemMoveUp?: string;
48+
itemMoveDown?: string;
49+
itemDelete?: string;
50+
};
51+
label: {
52+
root?: string;
53+
};
54+
categorization: {
55+
root?: string;
56+
};
57+
}

src/components/quasar-jsonform/styles/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Styles } from './style';
1+
import type { Styles } from './types';
22
import cloneDeep from 'lodash/cloneDeep';
33
import mergeWith from 'lodash/mergeWith';
44

0 commit comments

Comments
 (0)