Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd0161d1

Browse files
committed
Added features that build only view
1 parentf52fd50 commitd0161d1

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

‎client/packages/lowcoder/src/app-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ declare var numbro: any;
3333
declarevaruuid:any;
3434
declarevarPUBLIC_URL:string;
3535
declarevarREACT_APP_EDITION:string;
36+
declarevarREACT_APP_VIEW_MODE:string;
3637
declarevarREACT_APP_LANGUAGES:string;
3738
declarevarREACT_APP_COMMIT_ID:string;
3839
declarevarREACT_APP_API_SERVICE_URL:string;

‎client/packages/lowcoder/src/dev-utils/buildVars.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ export const buildVars = [
5555
name:"REACT_APP_DISABLE_JS_SANDBOX",
5656
defaultValue:"",
5757
},
58+
{
59+
name:"REACT_APP_VIEW_MODE",
60+
defaultValue:"admin",
61+
},
5862
];

‎client/packages/lowcoder/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ debug(`REACT_APP_ENV:, ${REACT_APP_ENV}`);
4141
debug(`REACT_APP_LOG_LEVEL:,${REACT_APP_LOG_LEVEL}`);
4242
initTranslatorDesign().then(()=>{
4343
initTranslator().then(async()=>{
44-
if(!window.location.href.includes("view")){
45-
constbootstrap=awaitimport("./bootstrap/admin/app").then(module=>module.bootstrap);
46-
bootstrap();
44+
letbootstrap;
45+
if(REACT_APP_VIEW_MODE==="view"){
46+
bootstrap=awaitimport("./bootstrap/view/app").then(module=>module.bootstrap);
4747
}else{
48-
constbootstrap=awaitimport("./bootstrap/view/app").then(module=>module.bootstrap);
49-
bootstrap();
48+
bootstrap=awaitimport("./bootstrap/admin/app").then(module=>module.bootstrap);
5049
}
50+
bootstrap();
5151
})
5252
})
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
exportconstviewMode=()=>window.location.href.includes("edit") ?"edit" :window.location.href.includes("view") ?"view" :"admin"
1+
exportconstviewMode=()=>REACT_APP_VIEW_MODE;
2+
exportconstviewModeTriple=()=>viewMode()==="view" ?"view" :window.location.href.includes("edit") ?"edit" :"admin";
23
exportconstgetLanguage=():string=>{
34
returnlocalStorage.getItem('lowcoder_uiLanguage')||'en';
45
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp