File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
client/packages/lowcoder/src Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ declare var numbro: any;
3333declare var uuid : any ;
3434declare var PUBLIC_URL : string ;
3535declare var REACT_APP_EDITION : string ;
36+ declare var REACT_APP_VIEW_MODE : string ;
3637declare var REACT_APP_LANGUAGES : string ;
3738declare var REACT_APP_COMMIT_ID : string ;
3839declare var REACT_APP_API_SERVICE_URL : string ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const buildVars = [
5252 defaultValue : "app" ,
5353 } ,
5454 {
55- name : "REACT_APP_DISABLE_JS_SANDBOX " ,
56- defaultValue : "" ,
55+ name : "REACT_APP_VIEW_MODE " ,
56+ defaultValue : "admin " ,
5757 } ,
5858] ;
Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ debug(`REACT_APP_ENV:, ${REACT_APP_ENV}`);
4141debug ( `REACT_APP_LOG_LEVEL:, ${ REACT_APP_LOG_LEVEL } ` ) ;
4242initTranslatorDesign ( ) . then ( ( ) => {
4343 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 ) ;
4747 } 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 ) ;
5049 }
50+ bootstrap ( ) ;
5151 } )
5252} )
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" ;
23export const getLanguage = ( ) : string => {
34 return localStorage . getItem ( 'lowcoder_uiLanguage' ) || 'en' ;
45}
You can’t perform that action at this time.
0 commit comments