From da0d79f0db873c08fab3bc85023167e174d18b0e Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Mon, 19 Jan 2026 14:17:32 +0800 Subject: chore(ui): refactor workspace to monorepo --- packages/ui/src/components/InstancesView.svelte | 259 ++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 packages/ui/src/components/InstancesView.svelte (limited to 'packages/ui/src/components/InstancesView.svelte') diff --git a/packages/ui/src/components/InstancesView.svelte b/packages/ui/src/components/InstancesView.svelte new file mode 100644 index 0000000..5334f9e --- /dev/null +++ b/packages/ui/src/components/InstancesView.svelte @@ -0,0 +1,259 @@ + + +
+
+

Instances

+ +
+ + {#if instancesState.instances.length === 0} +
+
+

No instances yet

+

Create your first instance to get started

+
+
+ {:else} +
+ {#each instancesState.instances as instance (instance.id)} +
instancesState.setActiveInstance(instance.id)} + onkeydown={(e) => e.key === "Enter" && instancesState.setActiveInstance(instance.id)} + > + {#if instancesState.activeInstanceId === instance.id} +
+
+
+ {/if} + +
+

+ {instance.name} +

+
+ + + +
+
+ +
+ {#if instance.version_id} +

Version: {instance.version_id}

+ {:else} +

No version selected

+ {/if} + + {#if instance.mod_loader && instance.mod_loader !== "vanilla"} +

+ Mod Loader: {instance.mod_loader} + {#if instance.mod_loader_version} + ({instance.mod_loader_version}) + {/if} +

+ {/if} + +

Created: {formatDate(instance.created_at)}

+ + {#if instance.last_played} +

Last played: {formatLastPlayed(instance.last_played)}

+ {/if} +
+ + {#if instance.notes} +

+ {instance.notes} +

+ {/if} +
+ {/each} +
+ {/if} +
+ + + (showCreateModal = false)} /> + + + { + editingInstance = null; + }} +/> + + +{#if showDeleteConfirm && selectedInstance} +
+
+

Delete Instance

+

+ Are you sure you want to delete "{selectedInstance.name}"? This action cannot be undone and will delete all game data for this instance. +

+
+ + +
+
+
+{/if} + + +{#if showDuplicateModal && selectedInstance} +
+
+

Duplicate Instance

+ e.key === "Enter" && confirmDuplicate()} + /> +
+ + +
+
+
+{/if} -- cgit v1.2.3-70-g09d2