···2626const COMPOSE_SERVICE_LABEL: &str = "com.docker.compose.service";
27272828impl LuminaryEngine {
2929+ /// Retrieves a [LuminaryProject] by its name from the current state.
2930 pub async fn get_project(&self, name: &String) -> Result<LuminaryProject> {
3031 return Ok(self
3132 .state
···3738 .wrap_err("Failed to fetch project")?);
3839 }
39404141+ /// Returns a stream of state updates, initialising the stream with the current state.
4042 pub async fn state_subscribe<'a>(&'_ self) -> BoxStream<'a, LuminaryStateList> {
4143 let mut reciever = self.state_channel.subscribe();
4244 let initial = self.state.read().await.clone();
···5759 .boxed();
5860 }
59616262+ /// Spawn a background task that listens to Docker events and updates the state accordingly.
6063 pub(super) async fn spawn_state_worker(&self) {
6164 let this = self.clone();
6265 let mut filters = HashMap::new();
+5-1
packages/panel/src/lib/api/realtime.svelte.ts
···1818 * A getter for the current project list.
1919 * @returns A reactive store containing the current state list.
2020 */
2121-export const getList = () => list;
2121+export const getProjects = () => list;
22222323+/**
2424+ * Updates the project list with the given project.
2525+ * @param project The project to insert into the list.
2626+ */
2327export const putProject = (project: LuminaryProject) => (list = { ...list, [project.name]: project });
24282529/**
···44 import StatusIcon from "$lib/component/StatusIcon.svelte";
55 import Tabs from "$lib/component/Tabs.svelte";
66 import StatusTab from "./ProjectStatus.svelte";
77- import { getList } from "$lib/api";
77+ import { getProjects } from "$lib/api";
88 import { page } from "$app/state";
99 import Fa from "svelte-fa";
10101111- let project = $derived(getList()[page.params.project!]);
1111+ let project = $derived(getProjects()[page.params.project!]);
1212 let { data } = $props();
1313</script>
1414