chore: install prettier

This commit is contained in:
Viet An
2026-05-04 15:22:27 +07:00
parent 93d29ca7d8
commit bd58e2b847
267 changed files with 22950 additions and 13581 deletions

View File

@@ -1,12 +1,14 @@
export const utopiaUrn = 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6cGtxYjhrbHBnZWtsZ2tlbHBzanBoYzljMm5neXhtbjY0cXZocHNhcXVodjQ2emVuLWJhc2ljLWFwcC8yNi4wMS4xNiUyMC0lMjBFeHBvcnQlMjBUTUIlMjAtJTIwUGhhbiUyMG1lbS5kd2c';
export const blankUrn = 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6cGtxYjhrbHBnZWtsZ2tlbHBzanBoYzljMm5neXhtbjY0cXZocHNhcXVodjQ2emVuLWJhc2ljLWFwcC9ibGFuay5kd2c';
export const utopiaUrn =
"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6cGtxYjhrbHBnZWtsZ2tlbHBzanBoYzljMm5neXhtbjY0cXZocHNhcXVodjQ2emVuLWJhc2ljLWFwcC8yNi4wMS4xNiUyMC0lMjBFeHBvcnQlMjBUTUIlMjAtJTIwUGhhbiUyMG1lbS5kd2c";
export const blankUrn =
"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6cGtxYjhrbHBnZWtsZ2tlbHBzanBoYzljMm5neXhtbjY0cXZocHNhcXVodjQ2emVuLWJhc2ljLWFwcC9ibGFuay5kd2c";
export async function getAccessToken(callback) {
try {
const { access_token, expires_in } = await $fetch('/api/apsAuthToken');
const { access_token, expires_in } = await $fetch("/api/apsAuthToken");
callback(access_token, expires_in);
} catch (err) {
console.error('Could not obtain access token. Error:', err);
console.error("Could not obtain access token. Error:", err);
}
}
@@ -31,15 +33,15 @@ export function loadModel(viewer, urn, xform) {
}
function showNotification(message) {
const overlay = document.getElementById('overlay');
const overlay = document.getElementById("overlay");
overlay.innerHTML = `<div class="notification">${message}</div>`;
overlay.style.display = 'flex';
overlay.style.display = "flex";
}
function clearNotification() {
const overlay = document.getElementById('overlay');
overlay.innerHTML = '';
overlay.style.display = 'none';
const overlay = document.getElementById("overlay");
overlay.innerHTML = "";
overlay.style.display = "none";
}
export async function setupModelSelection(viewer) {
@@ -52,16 +54,16 @@ export async function setupModelSelection(viewer) {
const res = await $fetch(`/api/models/${utopiaUrn}/status`);
const { status } = res;
switch (status.status) {
case 'n/a':
case "n/a":
showNotification(`Model has not been translated.`);
break;
case 'inprogress':
case "inprogress":
showNotification(`Model is being translated (${status.progress})...`);
window.onModelSelectedTimeout = setTimeout(onModelSelected, 5000, viewer, utopiaUrn);
break;
case 'failed':
case "failed":
showNotification(
`Translation failed. <ul>${status.messages.map((msg) => `<li>${JSON.stringify(msg)}</li>`).join('')}</ul>`,
`Translation failed. <ul>${status.messages.map((msg) => `<li>${JSON.stringify(msg)}</li>`).join("")}</ul>`,
);
break;
default:
@@ -70,6 +72,6 @@ export async function setupModelSelection(viewer) {
break;
}
} catch (err) {
console.error('Could not load model. Error:', err);
console.error("Could not load model. Error:", err);
}
}