summaryrefslogtreecommitdiff
path: root/public/App.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/App.js')
-rw-r--r--public/App.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/public/App.js b/public/App.js
index eb47dbc..7aac7f0 100644
--- a/public/App.js
+++ b/public/App.js
@@ -330,6 +330,9 @@ export function initializeView() {
scene.add(rimLight);
const bounceLight = new THREE.HemisphereLight("#3d4a56", "#141a1e", 0.9);
scene.add(bounceLight);
+ const grid = new THREE.GridHelper(24, 48, "#5a4a2a", "#2a2f33");
+ grid.position.y = -1.35;
+ scene.add(grid);
const controls = new OrbitControls(camera, canvas);
controls.target.copy({ x: 0, y: 0, z: 0 });
controls.enableDamping = true;
@@ -430,12 +433,17 @@ export function startStepLoad(view, owner, historical) {
viewMode(new ViewMode(1, []));
failedLoad(undefined);
setNoteRetryable(false);
+ clearGroup(view.Group);
+ displayedNode(undefined);
+ loadedStep(undefined);
+ document.getElementById("viewport-loading").classList.toggle('is-hidden', false);
const loader = new GLTFLoader();
const projectId = encodeURIComponent(owner.ProjectId);
const runId = encodeURIComponent(owner.RunId);
+ const stamp = ~~(Date.now() % 100000000) | 0;
let url;
const arg_2 = encodeURIComponent(owner.Path);
- url = toText(printf("/api/artifacts/steps?projectId=%s&runId=%s&path=%s"))(projectId)(runId)(arg_2);
+ url = toText(printf("/api/artifacts/steps?projectId=%s&runId=%s&path=%s&ts=%d"))(projectId)(runId)(arg_2)(stamp);
if (historical) {
setText("viewport-note", toText(printf("历史几何加载中 · %s"))(owner.Path));
}
@@ -450,6 +458,7 @@ export function startStepLoad(view, owner, historical) {
displayedNode(gltf.scene);
loadedStep(owner);
frameObject(view, gltf.scene);
+ document.getElementById("viewport-loading").classList.toggle('is-hidden', true);
view.Renderer.render(view.Scene, view.Camera);
if (historical) {
setText("viewport-note", toText(printf("历史几何 · %s"))(owner.Path));
@@ -466,6 +475,7 @@ export function startStepLoad(view, owner, historical) {
pendingLoad(undefined);
loadedStep(undefined);
failedLoad([owner, historical]);
+ document.getElementById("viewport-loading").classList.toggle('is-hidden', true);
setNoteRetryable(true);
if (historical) {
setText("viewport-note", toText(printf("历史几何加载失败 · %s"))(owner.Path));
@@ -965,10 +975,14 @@ export function loadHistoryFor(selection) {
}
}
else {
+ document.getElementById("viewport-loading").classList.toggle('is-hidden', true);
+ setText("viewport-note", "该运行尚无可用历史几何");
return singleton.Zero();
}
}) : singleton.Zero();
})), (_arg_2) => {
+ document.getElementById("viewport-loading").classList.toggle('is-hidden', true);
+ setText("viewport-note", "历史几何加载失败 · 清单不可用");
return singleton.Zero();
})));
}
@@ -1032,6 +1046,15 @@ export function selectModel(card) {
activeModel(selection);
highlightActiveCard(selection);
setText("run-message", "载入模型历史");
+ if (viewState() == null) {
+ }
+ else {
+ clearGroup(viewState().Group);
+ displayedNode(undefined);
+ loadedStep(undefined);
+ }
+ document.getElementById("viewport-loading").classList.toggle('is-hidden', false);
+ setText("viewport-note", "历史几何加载中");
loadHistoryFor(selection);
}