More annotation added to the program

This commit is contained in:
2026-05-30 12:44:44 +08:00
parent b3f29398f0
commit bf223b52ac
22 changed files with 729 additions and 353 deletions
+6
View File
@@ -711,6 +711,7 @@ Organization : OptiHK Limited
const logTerminal = document.getElementById('log-terminal');
let technologies = [];
// Append a dashboard status message with a timestamp.
function addLog(message) {
const line = document.createElement('div');
line.textContent = `[${new Date().toLocaleTimeString()}] ${message}`;
@@ -718,6 +719,7 @@ Organization : OptiHK Limited
logTerminal.scrollTop = logTerminal.scrollHeight;
}
// Apply the selected dashboard theme class and persist it for later sessions.
function applyTheme(mode) {
document.body.classList.toggle('light-mode', mode === 'light');
themeToggle.textContent = mode === 'light' ? 'Dark Mode' : 'Bright Mode';
@@ -729,10 +731,12 @@ Organization : OptiHK Limited
applyTheme(document.body.classList.contains('light-mode') ? 'dark' : 'light');
});
// Navigate from the dashboard into the canvas editor for a saved project.
function openProject(name) {
window.location.href = `/canvas?project=${encodeURIComponent(name)}`;
}
// Load account profile details and available occupation choices.
async function loadProfile() {
try {
const response = await fetch('/api/profile');
@@ -809,6 +813,7 @@ Organization : OptiHK Limited
addLog('Password updated.');
});
// Fetch saved projects and render the dashboard project list.
async function loadProjects() {
try {
const response = await fetch('/api/projects');
@@ -889,6 +894,7 @@ Organization : OptiHK Limited
openProject(project.name);
});
// Fetch available foundry/technology choices for new project creation.
async function loadTechnologies() {
const response = await fetch('/api/technologies');
const data = await response.json();