semantic markup update

This commit is contained in:
2026-01-18 21:29:54 +03:00
parent 11c59fb420
commit 76baeb1038
85 changed files with 7020 additions and 5953 deletions

View File

@@ -21,6 +21,11 @@
let editingEnvId = null;
// [DEF:handleSaveGlobal:Function]
/* @PURPOSE: Saves global application settings.
@PRE: settings.settings must contain valid configuration.
@POST: Global settings are updated via API.
*/
async function handleSaveGlobal() {
try {
console.log("[Settings.handleSaveGlobal][Action] Saving global settings.");
@@ -32,7 +37,13 @@
addToast('Failed to save global settings', 'error');
}
}
// [/DEF:handleSaveGlobal:Function]
// [DEF:handleAddOrUpdateEnv:Function]
/* @PURPOSE: Adds a new environment or updates an existing one.
@PRE: newEnv must contain valid environment details.
@POST: Environment is saved and page is reloaded to reflect changes.
*/
async function handleAddOrUpdateEnv() {
try {
console.log(`[Settings.handleAddOrUpdateEnv][Action] ${editingEnvId ? 'Updating' : 'Adding'} environment.`);
@@ -54,7 +65,13 @@
addToast('Failed to save environment', 'error');
}
}
// [/DEF:handleAddOrUpdateEnv:Function]
// [DEF:handleDeleteEnv:Function]
/* @PURPOSE: Deletes a Superset environment.
@PRE: id must be a valid environment ID.
@POST: Environment is removed and page is reloaded.
*/
async function handleDeleteEnv(id) {
if (confirm('Are you sure you want to delete this environment?')) {
try {
@@ -69,7 +86,13 @@
}
}
}
// [/DEF:handleDeleteEnv:Function]
// [DEF:handleTestEnv:Function]
/* @PURPOSE: Tests the connection to a Superset environment.
@PRE: id must be a valid environment ID.
@POST: Displays success or error toast based on connection result.
*/
async function handleTestEnv(id) {
try {
console.log(`[Settings.handleTestEnv][Action] Testing environment: ${id}`);
@@ -86,12 +109,24 @@
addToast('Failed to test connection', 'error');
}
}
// [/DEF:handleTestEnv:Function]
// [DEF:editEnv:Function]
/* @PURPOSE: Populates the environment form for editing.
@PRE: env object must be provided.
@POST: newEnv and editingEnvId are updated.
*/
function editEnv(env) {
newEnv = { ...env };
editingEnvId = env.id;
}
// [/DEF:editEnv:Function]
// [DEF:resetEnvForm:Function]
/* @PURPOSE: Resets the environment creation/edit form to default state.
@PRE: None.
@POST: newEnv is cleared and editingEnvId is set to null.
*/
function resetEnvForm() {
newEnv = {
id: '',
@@ -103,6 +138,7 @@
};
editingEnvId = null;
}
// [/DEF:resetEnvForm:Function]
</script>
<div class="container mx-auto p-4">

View File

@@ -1,5 +1,10 @@
import { api } from '../../lib/api';
// [DEF:load:Function]
/* @PURPOSE: Loads application settings and environment list.
@PRE: API must be reachable.
@POST: Returns settings object or default values on error.
*/
/** @type {import('./$types').PageLoad} */
export async function load() {
try {
@@ -21,3 +26,4 @@ export async function load() {
};
}
}
// [/DEF:load:Function]

View File

@@ -10,11 +10,17 @@
let listComponent;
// [DEF:handleSuccess:Function]
/* @PURPOSE: Refreshes the connection list after a successful creation.
@PRE: listComponent must be bound.
@POST: Triggers the fetchConnections method on the list component.
*/
function handleSuccess() {
if (listComponent) {
listComponent.fetchConnections();
}
}
// [/DEF:handleSuccess:Function]
</script>
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">