feat(preview): add vehicle incident cards
This commit is contained in:
@@ -4,8 +4,13 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
function writeCesiumPreviewSupportFiles(outDir) {
|
||||
for (const file of ["cesium-preview.css", "cesium-preview.js"]) {
|
||||
const source = path.join(__dirname, file);
|
||||
const files = [
|
||||
[path.join(__dirname, "cesium-preview.css"), "cesium-preview.css"],
|
||||
[path.join(__dirname, "cesium-preview.js"), "cesium-preview.js"],
|
||||
[path.join(__dirname, "..", "..", "assets", "preview", "vehicle-breakdown.png"), "vehicle-breakdown.png"],
|
||||
[path.join(__dirname, "..", "..", "assets", "preview", "vehicle-accident.png"), "vehicle-accident.png"],
|
||||
];
|
||||
for (const [source, file] of files) {
|
||||
if (!fs.existsSync(source)) {
|
||||
throw new Error(`Cesium preview support file '${file}' not found: ${source}`);
|
||||
}
|
||||
@@ -69,6 +74,21 @@ function cesiumPreviewHtml(glbName, metadataName, routeName, vehicleModelName, a
|
||||
</div>
|
||||
<div id="diagnostics">Loading diagnostics...</div>
|
||||
<div id="status">Loading ${escapeHtml(glbName)}...</div>
|
||||
<aside id="vehicleInfoCard" class="hidden" aria-live="polite">
|
||||
<div class="vehicle-card-heading">
|
||||
<strong id="vehicleInfoTitle">Vehicle</strong>
|
||||
<button id="closeVehicleInfo" type="button" aria-label="Close vehicle information">Close</button>
|
||||
</div>
|
||||
<dl id="vehicleInfoDetails"></dl>
|
||||
<label class="vehicle-card-field">Event note
|
||||
<textarea id="vehicleIncidentNote" rows="2" maxlength="160" placeholder="Optional note"></textarea>
|
||||
</label>
|
||||
<div class="vehicle-card-actions" role="group" aria-label="Vehicle status">
|
||||
<button type="button" data-vehicle-status="normal">Normal</button>
|
||||
<button type="button" data-vehicle-status="breakdown">Breakdown</button>
|
||||
<button type="button" data-vehicle-status="accident">Accident</button>
|
||||
</div>
|
||||
</aside>
|
||||
<div id="loadingOverlay">
|
||||
<div class="loading-card">
|
||||
<div class="loading-spinner" aria-hidden="true"></div>
|
||||
|
||||
Reference in New Issue
Block a user