File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
client/packages/lowcoder/src Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ declare var numbro: any;
33
33
declare var uuid : any ;
34
34
declare var PUBLIC_URL : string ;
35
35
declare var REACT_APP_EDITION : string ;
36
+ declare var REACT_APP_VIEW_MODE : string ;
36
37
declare var REACT_APP_LANGUAGES : string ;
37
38
declare var REACT_APP_COMMIT_ID : string ;
38
39
declare var REACT_APP_API_SERVICE_URL : string ;
Original file line number Diff line number Diff line change @@ -55,4 +55,8 @@ export const buildVars = [
55
55
name : "REACT_APP_DISABLE_JS_SANDBOX" ,
56
56
defaultValue : "" ,
57
57
} ,
58
+ {
59
+ name : "REACT_APP_VIEW_MODE" ,
60
+ defaultValue : "admin" ,
61
+ } ,
58
62
] ;
Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ debug(`REACT_APP_ENV:, ${REACT_APP_ENV}`);
41
41
debug ( `REACT_APP_LOG_LEVEL:, ${ REACT_APP_LOG_LEVEL } ` ) ;
42
42
initTranslatorDesign ( ) . then ( ( ) => {
43
43
initTranslator ( ) . then ( async ( ) => {
44
- if ( ! window . location . href . includes ( "view" ) ) {
45
- const bootstrap = await import ( "./bootstrap/admin/app" ) . then ( module => module . bootstrap ) ;
46
- bootstrap ( ) ;
44
+ let bootstrap ;
45
+ if ( REACT_APP_VIEW_MODE === "view" ) {
46
+ bootstrap = await import ( "./bootstrap/view/app" ) . then ( module => module . bootstrap ) ;
47
47
} else {
48
- const bootstrap = await import ( "./bootstrap/view/app" ) . then ( module => module . bootstrap ) ;
49
- bootstrap ( ) ;
48
+ bootstrap = await import ( "./bootstrap/admin/app" ) . then ( module => module . bootstrap ) ;
50
49
}
50
+ bootstrap ( ) ;
51
51
} )
52
52
} )
Original file line number Diff line number Diff line change 1
- export const viewMode = ( ) => window . location . href . includes ( "edit" ) ? "edit" : window . location . href . includes ( "view" ) ? "view" : "admin"
1
+ export const viewMode = ( ) => REACT_APP_VIEW_MODE ;
2
+ export const viewModeTriple = ( ) => viewMode ( ) === "view" ? "view" : window . location . href . includes ( "edit" ) ? "edit" : "admin" ;
2
3
export const getLanguage = ( ) : string => {
3
4
return localStorage . getItem ( 'lowcoder_uiLanguage' ) || 'en' ;
4
5
}
You can’t perform that action at this time.
0 commit comments