Skip to content

Commit

Permalink
Add base URL to invent builder
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLowe1002 committed Apr 29, 2024
1 parent 3d1e0fe commit 89c4c92
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/tools/builder/index.html
Expand Up @@ -10,7 +10,7 @@
</head>
<body class="overflow-hidden">
<div id="app"></div>
<script type="py" src="/src/python/main.py" config="/src/python/pyscript.toml"></script>
<script type="py" src="/python/main.py" config="/invent/python/pyscript.toml"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/tools/builder/public/python/pyscript.toml
@@ -0,0 +1,6 @@
["files"]
"/invent/python/builder.py"="builder.py"
#
# Invent.
#
"/invent/python/invent.zip"="./*"
4 changes: 2 additions & 2 deletions src/tools/builder/src/App.vue
@@ -1,5 +1,5 @@
<template>
<router-view />
<builder />

<!-- Modal Dynamic Component -->
<transition
Expand All @@ -18,6 +18,6 @@
</template>
<script setup lang="ts">
import { RouterView } from 'vue-router'
import Builder from './views/builder/builder.vue';
import { ModalUtilities } from './utilities/modal-utilities';
</script>
2 changes: 0 additions & 2 deletions src/tools/builder/src/main.ts
@@ -1,6 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import "@/assets/tailwind.css"
import { LocalizationUtilities } from './utilities/localization-utilities'

Expand All @@ -15,7 +14,6 @@ import { whenDefined } from "https://pyscript.net/releases/2024.4.1/core.js";
whenDefined("py").then(() => {
LocalizationUtilities.loadPreferredLanguageAsync().then(() => {
createApp(App)
.use(router)
.use(Components)
.use(Modals)
.use(InventWidgets)
Expand Down
6 changes: 0 additions & 6 deletions src/tools/builder/src/python/pyscript.toml

This file was deleted.

11 changes: 0 additions & 11 deletions src/tools/builder/src/router/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/tools/builder/src/utilities/localization-utilities.ts
Expand Up @@ -67,7 +67,7 @@ export class LocalizationUtilities {
private static async loadLanguage(code: string): Promise<LocalizationTableModel> {
let result: LocalizationTableModel = {};

const response: Response = await fetch(`/languages/${code}.json`);
const response: Response = await fetch(`${import.meta.env.BASE_URL}/languages/${code}.json`);

if (response.ok) {
result = await response.json() as LocalizationTableModel;
Expand Down
Expand Up @@ -17,8 +17,8 @@ class PageEditorModel extends ComponentModelBase {
return `
<html>
<head>
<link rel="stylesheet" href="/css/paper.min.css">
<link rel="stylesheet" href="/css/page-editor.css">
<link rel="stylesheet" href="/invent/css/paper.min.css">
<link rel="stylesheet" href="/invent/css/page-editor.css">
</head>
<body></body>
</html>
Expand Down
12 changes: 0 additions & 12 deletions src/tools/builder/src/views/builder/routes.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/tools/builder/vite.config.ts
Expand Up @@ -5,6 +5,7 @@ import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
base: "/invent",
plugins: [
vue(),
],
Expand Down

0 comments on commit 89c4c92

Please sign in to comment.