semantic cleanup
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
<!-- [DEF:GitDashboardPage:Component] -->
|
||||
<!--
|
||||
@PURPOSE: Dashboard management page for Git integration.
|
||||
@LAYER: Page
|
||||
@SEMANTICS: git, dashboard, management, ui
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import DashboardGrid from '../../components/DashboardGrid.svelte';
|
||||
@@ -13,6 +18,10 @@
|
||||
let loading = true;
|
||||
let fetchingDashboards = false;
|
||||
|
||||
// [DEF:fetchEnvironments:Function]
|
||||
// @PURPOSE: Fetches the list of deployment environments from the API.
|
||||
// @PRE: Component is mounted.
|
||||
// @POST: `environments` array is populated with data from /api/environments.
|
||||
async function fetchEnvironments() {
|
||||
try {
|
||||
const response = await fetch('/api/environments');
|
||||
@@ -27,7 +36,12 @@
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
// [/DEF:fetchEnvironments:Function]
|
||||
|
||||
// [DEF:fetchDashboards:Function]
|
||||
// @PURPOSE: Fetches dashboards for a specific environment.
|
||||
// @PRE: `envId` is a valid environment ID.
|
||||
// @POST: `dashboards` array is updated with results from the environment.
|
||||
async function fetchDashboards(envId: string) {
|
||||
if (!envId) return;
|
||||
fetchingDashboards = true;
|
||||
@@ -42,6 +56,7 @@
|
||||
fetchingDashboards = false;
|
||||
}
|
||||
}
|
||||
// [/DEF:fetchDashboards:Function]
|
||||
|
||||
onMount(fetchEnvironments);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user