alessandro trinca tornidor commited on
Commit
8be838e
1 Parent(s): 6d98d37

[feat] set lisa inference as index page

Browse files
static/index.html CHANGED
@@ -9,10 +9,10 @@
9
  <link rel="icon" href="/icon.svg" type="image/svg+xml">
10
  <link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- 180×180 -->
11
  <link rel="manifest" href="/manifest.webmanifest">
12
- <title>SamGIS</title>
13
  </head>
14
  <body>
15
- <div id="root"></div>
16
- <script type="module" src="/src/main.ts"></script>
17
  </body>
18
  </html>
 
9
  <link rel="icon" href="/icon.svg" type="image/svg+xml">
10
  <link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- 180×180 -->
11
  <link rel="manifest" href="/manifest.webmanifest">
12
+ <title>Lisa</title>
13
  </head>
14
  <body>
15
+ <div id="root_index"></div>
16
+ <script type="module" src="/src/index.ts"></script>
17
  </body>
18
  </html>
static/lisa.html CHANGED
@@ -12,7 +12,7 @@
12
  <title>Lisa</title>
13
  </head>
14
  <body>
15
- <div id="root2"></div>
16
  <script type="module" src="/src/lisa.ts"></script>
17
  </body>
18
  </html>
 
12
  <title>Lisa</title>
13
  </head>
14
  <body>
15
+ <div id="root_lisa"></div>
16
  <script type="module" src="/src/lisa.ts"></script>
17
  </body>
18
  </html>
static/samgis.html ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <link href="output.css" rel="stylesheet" type="text/css">
7
+ <link href="dist/output.css" rel="stylesheet" type="text/css">
8
+ <link rel="icon" href="/favicon.ico" sizes="32x32">
9
+ <link rel="icon" href="/icon.svg" type="image/svg+xml">
10
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- 180×180 -->
11
+ <link rel="manifest" href="/manifest.webmanifest">
12
+ <title>SamGIS</title>
13
+ </head>
14
+ <body>
15
+ <div id="root_samgis"></div>
16
+ <script type="module" src="/src/samgis.ts"></script>
17
+ </body>
18
+ </html>
static/src/{AppMain.vue → AppSamgis.vue} RENAMED
File without changes
static/src/index.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import { createApp } from "vue";
2
+ import Lisa from "./AppLisa.vue";
3
+
4
+ const lisa = createApp(Lisa);
5
+
6
+ lisa.mount("#root_index");
static/src/lisa.ts CHANGED
@@ -3,4 +3,4 @@ import Lisa from "./AppLisa.vue";
3
 
4
  const lisa = createApp(Lisa);
5
 
6
- lisa.mount("#root2");
 
3
 
4
  const lisa = createApp(Lisa);
5
 
6
+ lisa.mount("#root_lisa");
static/src/{main.ts → samgis.ts} RENAMED
@@ -1,6 +1,6 @@
1
  import { createApp } from "vue";
2
- import AppMain from "./AppMain.vue";
3
 
4
  const main = createApp(AppMain);
5
 
6
- main.mount("#root");
 
1
  import { createApp } from "vue";
2
+ import AppMain from "./AppSamgis.vue";
3
 
4
  const main = createApp(AppMain);
5
 
6
+ main.mount("#root_samgis");
static/vite.config.ts CHANGED
@@ -17,8 +17,9 @@ export default defineConfig({
17
  build: {
18
  rollupOptions: {
19
  input: {
20
- main: resolve(__dirname, 'index.html'),
21
  lisa: resolve(__dirname, 'lisa.html'),
 
22
  },
23
  },
24
  },
 
17
  build: {
18
  rollupOptions: {
19
  input: {
20
+ samgis: resolve(__dirname, 'samgis.html'),
21
  lisa: resolve(__dirname, 'lisa.html'),
22
+ index: resolve(__dirname, "index.html"),
23
  },
24
  },
25
  },
wrappers/fastapi_wrapper.py CHANGED
@@ -204,6 +204,16 @@ async def http_exception_handler(request: Request, exc: HTTPException) -> JSONRe
204
 
205
 
206
  # important: the index() function and the app.mount MUST be at the end
 
 
 
 
 
 
 
 
 
 
207
  app.mount("/lisa", StaticFiles(directory=WORKDIR / "static" / "dist", html=True), name="lisa")
208
 
209
 
@@ -212,7 +222,8 @@ async def lisa() -> FileResponse:
212
  return FileResponse(path=WORKDIR / "static" / "dist" / "lisa.html", media_type="text/html")
213
 
214
 
215
- app.mount("/", StaticFiles(directory=WORKDIR / "static" / "dist", html=True), name="root")
 
216
 
217
 
218
  @app.get("/")
 
204
 
205
 
206
  # important: the index() function and the app.mount MUST be at the end
207
+ # samgis.html
208
+ app.mount("/samgis", StaticFiles(directory=WORKDIR / "static" / "dist", html=True), name="samgis")
209
+
210
+
211
+ @app.get("/samgis")
212
+ async def samgis() -> FileResponse:
213
+ return FileResponse(path=WORKDIR / "static" / "dist" / "samgis.html", media_type="text/html")
214
+
215
+
216
+ # lisa.html
217
  app.mount("/lisa", StaticFiles(directory=WORKDIR / "static" / "dist", html=True), name="lisa")
218
 
219
 
 
222
  return FileResponse(path=WORKDIR / "static" / "dist" / "lisa.html", media_type="text/html")
223
 
224
 
225
+ # index.html (lisa.html copy)
226
+ app.mount("/", StaticFiles(directory=WORKDIR / "static" / "dist", html=True), name="index")
227
 
228
 
229
  @app.get("/")