semantic markup update
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user