-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
509 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,87 @@ | ||
{ | ||
"name": "admin_panel", | ||
"version": "1.2.0", | ||
"description": "The Admin Panel to directly control the Raspberry Pi and connect to the web server for sharing the Raspberry Pi.", | ||
"private": false, | ||
"license": "MIT", | ||
"main": "js/main.js", | ||
"author": "Chi Huu Huynh", | ||
"build": { | ||
"icon": "public/Sunfounder-PiCar.png", | ||
"productName": "Admin Panel for Raspberry Pi", | ||
"files": [ | ||
"public/**/*", | ||
"js/**/*.js" | ||
], | ||
"win": {}, | ||
"linux": {}, | ||
"mac": {} | ||
}, | ||
"scripts": { | ||
"build": "rollup -c --bundleConfigAsCjs", | ||
"dev": "rollup -c -w --bundleConfigAsCjs", | ||
"start": "sirv public --no-clear", | ||
"electron": "wait-on http://localhost:8080 && electron .", | ||
"electron-dev": "concurrently \"pnpm run dev\" \"pnpm run electron\"", | ||
"preelectron-pack": "pnpm run build", | ||
"electron-pack": "electron-builder" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.2", | ||
"autoprefixer": "^10.4.17", | ||
"concurrently": "^8.2.2", | ||
"electron": "^29.1.0", | ||
"electron-builder": "^24.12.0", | ||
"flowbite-svelte-icons": "1.4.0", | ||
"postcss": "^8.4.35", | ||
"postcss-load-config": "^5.0.3", | ||
"rollup": "^4.12.0", | ||
"rollup-plugin-css-only": "^4.5.2", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-node-polyfills": "^0.2.1", | ||
"rollup-plugin-svelte": "^7.1.6", | ||
"sirv-cli": "^2.0.2", | ||
"svelte": "^4.2.12", | ||
"svelte-copy": "^1.4.1", | ||
"svelte-spa-router": "^4.0.1", | ||
"tailwind-merge": "^2.2.1", | ||
"tailwindcss": "^3.4.1", | ||
"wait-on": "^7.2.0" | ||
}, | ||
"dependencies": { | ||
"@codemirror/lang-xml": "^6.0.2", | ||
"@codemirror/theme-one-dark": "^6.1.2", | ||
"@codemirror/view": "^6.23.0", | ||
"electron-serve": "^1.3.0", | ||
"electron-store": "^8.2.0", | ||
"flowbite": "^2.3.0", | ||
"flowbite-svelte": "^0.44.24", | ||
"pixi.js": "^7.4.0", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"svelte-codemirror-editor": "^1.3.0", | ||
"svelte-pixi": "^0.1.3", | ||
"svelte-splitpanes": "^0.8.0", | ||
"tcp-port-used": "^1.0.2", | ||
"ws": "^8.16.0", | ||
"xml-formatter": "^3.6.2" | ||
}, | ||
"dependencyGroupComments": { | ||
"1": "flowbite: UI components", | ||
"2": "codemirror: Code editor", | ||
"3": "pixi.js: 2D rendering engine", | ||
"4": "ws & tcp-port-used: For web socket connection" | ||
} | ||
} | ||
"name": "Behaviour-Tree-PiCar-V-Admin-Panel", | ||
"version": "1.2.0", | ||
"description": "The Admin Panel to directly control the Sunfounder PiCar-V.", | ||
"private": false, | ||
"license": "MIT", | ||
"main": "js/main.js", | ||
"author": "Chi Huu Huynh", | ||
"build": { | ||
"appId": "com.chi_eee.behaviour-tree-picar-v-admin-panel", | ||
"productName": "Behaviour Tree PiCar-V Admin Panel", | ||
"icon": "public/Sunfounder-PiCar.png", | ||
"files": [ | ||
"public/**/*", | ||
"js/**/*.js" | ||
], | ||
"extraFiles": [ | ||
{ | ||
"from": "resources", | ||
"to": "resources", | ||
"filter": [ | ||
"**/*" | ||
] | ||
} | ||
], | ||
"win": {}, | ||
"linux": {}, | ||
"mac": {} | ||
}, | ||
"scripts": { | ||
"build": "rollup -c --bundleConfigAsCjs", | ||
"dev": "rollup -c -w --bundleConfigAsCjs", | ||
"start": "sirv public --no-clear", | ||
"electron": "wait-on http://localhost:8080 && electron .", | ||
"electron-dev": "concurrently \"pnpm run dev\" \"pnpm run electron\"", | ||
"preelectron-pack": "pnpm run build", | ||
"electron-pack": "electron-builder" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.2", | ||
"autoprefixer": "^10.4.17", | ||
"concurrently": "^8.2.2", | ||
"electron": "^29.1.0", | ||
"electron-builder": "^24.12.0", | ||
"flowbite-svelte-icons": "1.4.0", | ||
"postcss": "^8.4.35", | ||
"postcss-load-config": "^5.0.3", | ||
"rollup": "^4.12.0", | ||
"rollup-plugin-css-only": "^4.5.2", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-node-polyfills": "^0.2.1", | ||
"rollup-plugin-svelte": "^7.1.6", | ||
"sirv-cli": "^2.0.2", | ||
"svelte": "^4.2.12", | ||
"svelte-copy": "^1.4.1", | ||
"svelte-spa-router": "^4.0.1", | ||
"tailwind-merge": "^2.2.1", | ||
"tailwindcss": "^3.4.1", | ||
"wait-on": "^7.2.0" | ||
}, | ||
"dependencies": { | ||
"@codemirror/lang-xml": "^6.0.2", | ||
"@codemirror/theme-one-dark": "^6.1.2", | ||
"@codemirror/view": "^6.23.0", | ||
"electron-serve": "^1.3.0", | ||
"electron-store": "^8.2.0", | ||
"flowbite": "^2.3.0", | ||
"flowbite-svelte": "^0.44.24", | ||
"pixi.js": "^7.4.0", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"svelte-codemirror-editor": "^1.3.0", | ||
"svelte-pixi": "^0.1.3", | ||
"svelte-splitpanes": "^0.8.0", | ||
"tcp-port-used": "^1.0.2", | ||
"ws": "^8.16.0", | ||
"xml-formatter": "^3.6.2" | ||
}, | ||
"dependencyGroupComments": { | ||
"1": "flowbite: UI components", | ||
"2": "codemirror: Code editor", | ||
"3": "pixi.js: 2D rendering engine", | ||
"4": "ws & tcp-port-used: For web socket connection" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...min_panel/src/lib/CodeMessagingBar.svelte → ...anel/src/lib/home/CodeMessagingBar.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script> | ||
// If this does not work then try preview | ||
import CodeMirror from "svelte-codemirror-editor"; | ||
import { xml } from "@codemirror/lang-xml"; | ||
import { oneDark } from "@codemirror/theme-one-dark"; | ||
import { node_hover, xml_schema } from "../CodeBox_Constants"; | ||
import { behaviour_tree_xml_code } from "../../store/behaviour_tree_store"; | ||
import CodeButton from "./CodeButton.svelte"; | ||
</script> | ||
|
||
<div class="h-full m-1"> | ||
<CodeButton/> | ||
<CodeMirror | ||
class="text-left h-full flex-auto font-mono text-lg font-bold" | ||
bind:value={$behaviour_tree_xml_code} | ||
lang={xml(xml_schema)} | ||
tabSize={4} | ||
theme={oneDark} | ||
extensions={[node_hover]} | ||
/> | ||
<style> | ||
.cm-editor { | ||
height: 90% !important; | ||
} | ||
.cm-editor * { | ||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, | ||
"Liberation Mono", "Courier New" !important; | ||
} | ||
.cm-scroller { | ||
height: 100% !important; | ||
} | ||
</style> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script> | ||
import xmlFormat from "xml-formatter"; | ||
import { behaviour_tree_xml_code } from "../../store/behaviour_tree_store"; | ||
/** @type {string} */ | ||
let validate_behaviour_tree_text = "Validate Behaviour Tree"; | ||
/** @type {string} */ | ||
let validate_behaviour_tree_color = "#4C9CFF"; | ||
/** @type {boolean} */ | ||
let validate_behaviour_tree_debounce = false; | ||
async function validateBehaviourTree() { | ||
if (validate_behaviour_tree_debounce) { | ||
return; | ||
} | ||
validate_behaviour_tree_debounce = true; | ||
try { | ||
const result = await api.validateBehaviourTree({ | ||
data: xmlFormat.minify($behaviour_tree_xml_code), | ||
}); | ||
console.log(result); | ||
validate_behaviour_tree_text = "Sent Behaviour Tree!"; | ||
validate_behaviour_tree_color = "#3457AA"; | ||
} catch (error) { | ||
console.log(error) | ||
validate_behaviour_tree_text = "Unable to send Behaviour Tree!"; | ||
validate_behaviour_tree_color = "#AA3434"; | ||
} | ||
setTimeout(() => { | ||
validate_behaviour_tree_text = "Validate Behaviour Tree"; | ||
validate_behaviour_tree_color = "#4C9CFF"; | ||
validate_behaviour_tree_debounce = false; | ||
}, 1000); | ||
} | ||
</script> | ||
|
||
<button | ||
on:mousedown={validateBehaviourTree} | ||
class="p-2 rounded-lg shadow-lg relative inset-0" | ||
style="background-color: {validate_behaviour_tree_color}; color: white; width: 100%; border: none;">{validate_behaviour_tree_text}</button | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import Home from './routes/Home.svelte'; | ||
import Websocket from './routes/Websocket.svelte'; | ||
import Validate from './routes/Validate.svelte'; | ||
import NotFound from './routes/NotFound.svelte'; | ||
|
||
export default { | ||
'/': Home, | ||
'/websocket': Websocket, | ||
'/validate': Validate, | ||
// The catch-all route must always be last | ||
'*': NotFound | ||
}; |
Oops, something went wrong.