Skip to content

Commit a582de3

Browse files
committed
fix: deploy url, enable by defaul 3D view
1 parent f1ef25c commit a582de3

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

Diff for: dist/client/bundle.js.LICENSE.txt

-5
This file was deleted.

Diff for: dist/client/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
<body>
2525
<div class="menu">
26-
<a href="/?ip=127.0.0.1&robot=grande">localhost</a>
27-
<a href="/?ip=192.168.70.20&robot=grande">GRANDE</a>
28-
<a href="/?ip=192.168.70.120&robot=piccolo">PICCOLO</a>
29-
<a href="/?ip=192.168.70.120&robot=ladybug">LADYBUG</a>
26+
<a data-params="?ip=127.0.0.1&robot=grande">localhost</a>
27+
<a data-params="?ip=192.168.70.20&robot=grande">GRANDE</a>
28+
<a data-params="?ip=192.168.70.120&robot=piccolo">PICCOLO</a>
29+
<a data-params="?ip=192.168.70.120&robot=ladybug">LADYBUG</a>
3030
</div>
3131
<br />
3232
<div style="float: left">
33-
<label> <input type="checkbox" id="btn-option3d" /> Enable 3D </label>
33+
<label> <input type="checkbox" id="btn-option3d" checked /> Enable 3D </label>
3434
<br />
3535
<label> <input type="checkbox" id="btn-option-tof" /> Enable ToF </label>
3636
<br />

Diff for: src/client/client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
33
import {
44
add_align_button,
55
add_option_3d,
6+
fix_deploy_url,
67
initChart,
78
resetPidGraphs,
89
showPidGraphs,
@@ -26,6 +27,7 @@ const robotGroup = new Group();
2627
const scene = new Scene();
2728
const renderer = new WebGLRenderer({ antialias: true });
2829

30+
fix_deploy_url();
2931
add_option_3d(enable3D, robotGroup, renderer, scene);
3032
showPidGraphs();
3133

@@ -120,3 +122,4 @@ function enable3D(): void {
120122

121123
requestAnimationFrame(render);
122124
}
125+
enable3D();

Diff for: src/client/helper/dom.ts

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import { Socket } from 'socket.io-client';
33
import { Group, Scene, WebGLRenderer } from 'three';
44
import { SocketMessageType } from '../models/model';
55

6+
export function fix_deploy_url(): void {
7+
const links = document.querySelectorAll<HTMLLinkElement>('.menu a');
8+
for (const link of links) {
9+
const param = link.getAttribute('data-params');
10+
link.href = `${location.protocol}//${location.host}${location.pathname}${param}`;
11+
}
12+
}
13+
614
export function add_align_button(socket: Socket): void {
715
const alignBtn = document.querySelector<HTMLButtonElement>('#btn-align') as HTMLButtonElement;
816
alignBtn.onclick = function () {

0 commit comments

Comments
 (0)