project map script | semantic parcer

This commit is contained in:
2026-01-01 16:58:21 +03:00
parent a747a163c8
commit 4c6fc8256d
84 changed files with 10178 additions and 537 deletions

View File

@@ -127,8 +127,10 @@
}
};
}
// [/DEF:connect]
// [/DEF:connect:Function]
// [DEF:fetchTargetDatabases:Function]
// @PURPOSE: Fetches the list of databases in the target environment.
async function fetchTargetDatabases() {
const task = get(selectedTask);
if (!task || !task.params.to_env) return;
@@ -147,7 +149,10 @@
console.error('Failed to fetch target databases', e);
}
}
// [/DEF:fetchTargetDatabases:Function]
// [DEF:handleMappingResolve:Function]
// @PURPOSE: Handles the resolution of a missing database mapping.
async function handleMappingResolve(event) {
const task = get(selectedTask);
const { sourceDbUuid, targetDbUuid, targetDbName } = event.detail;
@@ -187,7 +192,10 @@
addToast('Failed to resolve mapping: ' + e.message, 'error');
}
}
// [/DEF:handleMappingResolve:Function]
// [DEF:handlePasswordResume:Function]
// @PURPOSE: Handles the submission of database passwords to resume a task.
async function handlePasswordResume(event) {
const task = get(selectedTask);
const { passwords } = event.detail;
@@ -206,7 +214,10 @@
addToast('Failed to resume task: ' + e.message, 'error');
}
}
// [/DEF:handlePasswordResume:Function]
// [DEF:startDataTimeout:Function]
// @PURPOSE: Starts a timeout to detect when the log stream has stalled.
function startDataTimeout() {
waitingForData = false;
dataTimeout = setTimeout(() => {
@@ -215,14 +226,19 @@
}
}, 5000);
}
// [/DEF:startDataTimeout:Function]
// [DEF:resetDataTimeout:Function]
// @PURPOSE: Resets the data stall timeout.
function resetDataTimeout() {
clearTimeout(dataTimeout);
waitingForData = false;
startDataTimeout();
}
// [/DEF:resetDataTimeout:Function]
// [DEF:onMount:Function]
// @PURPOSE: Initializes the component and subscribes to task selection changes.
onMount(() => {
// Subscribe to selectedTask changes
const unsubscribe = selectedTask.subscribe(task => {
@@ -246,7 +262,7 @@
});
return unsubscribe;
});
// [/DEF:onMount]
// [/DEF:onMount:Function]
// [DEF:onDestroy:Function]
/**
@@ -260,7 +276,7 @@
ws.close();
}
});
// [/DEF:onDestroy]
// [/DEF:onDestroy:Function]
</script>
<!-- [SECTION: TEMPLATE] -->
@@ -360,4 +376,4 @@
/>
<!-- [/SECTION] -->
<!-- [/DEF:TaskRunner] -->
<!-- [/DEF:TaskRunner:Component] -->