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

Commit 82cecd3

Browse files
Added features that build view
1 parent 01aa573 commit 82cecd3

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
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
declare var uuid: any;
3434
declare var PUBLIC_URL: string;
3535
declare var REACT_APP_EDITION: string;
36+
declare var REACT_APP_VIEW_MODE: string;
3637
declare var REACT_APP_LANGUAGES: string;
3738
declare var REACT_APP_COMMIT_ID: string;
3839
declare var REACT_APP_API_SERVICE_URL: string;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
];

‎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-
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
})
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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";
23
export const getLanguage = (): string => {
34
return localStorage.getItem('lowcoder_uiLanguage') || 'en';
45
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /