@webmcp-auto-ui/ui 2.5.11 → 2.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
name: string;
|
|
12
12
|
servers?: ConnectedServerInfo[];
|
|
13
13
|
onserverclick?: (url: string) => void;
|
|
14
|
+
onclick?: () => void;
|
|
14
15
|
class?: string;
|
|
15
16
|
}
|
|
16
|
-
let { connecting, connected, name, servers = [], onserverclick, class: cls = '' }: Props = $props();
|
|
17
|
+
let { connecting, connected, name, servers = [], onserverclick, onclick, class: cls = '' }: Props = $props();
|
|
17
18
|
|
|
18
19
|
let dropdownOpen = $state(false);
|
|
19
20
|
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
class="text-[10px] text-teal font-mono cursor-pointer hover:underline select-none"
|
|
46
47
|
onclick={toggleDropdown}
|
|
47
48
|
>
|
|
48
|
-
multi-
|
|
49
|
+
multi-server ({servers.length})
|
|
49
50
|
</span>
|
|
50
51
|
|
|
51
52
|
{#if dropdownOpen}
|
|
@@ -61,14 +62,26 @@
|
|
|
61
62
|
>
|
|
62
63
|
<span class="w-1.5 h-1.5 rounded-full bg-teal flex-shrink-0"></span>
|
|
63
64
|
<span class="truncate flex-1">{server.name}</span>
|
|
64
|
-
<span class="text-text2 text-[10px] flex-shrink-0">{server.toolCount}
|
|
65
|
+
<span class="text-text2 text-[10px] flex-shrink-0">{server.toolCount} tools</span>
|
|
65
66
|
</button>
|
|
66
67
|
{/each}
|
|
68
|
+
{#if onclick}
|
|
69
|
+
<button
|
|
70
|
+
class="w-full flex items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-accent hover:bg-surface2 transition-colors border-t border-border"
|
|
71
|
+
onclick={(e) => { e.stopPropagation(); dropdownOpen = false; onclick?.(); }}
|
|
72
|
+
>
|
|
73
|
+
Browse recipes
|
|
74
|
+
</button>
|
|
75
|
+
{/if}
|
|
67
76
|
</div>
|
|
68
77
|
{/if}
|
|
69
78
|
{:else}
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
80
|
+
<span
|
|
81
|
+
class="text-[10px] text-text2 font-mono {connected && onclick ? 'cursor-pointer hover:underline' : ''}"
|
|
82
|
+
onclick={() => { if (connected) onclick?.(); }}
|
|
83
|
+
>
|
|
84
|
+
{connecting ? 'connecting\u2026' : connected ? name : 'not connected'}
|
|
72
85
|
</span>
|
|
73
86
|
{/if}
|
|
74
87
|
</div>
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
onconnect?: (url: string) => void;
|
|
15
15
|
onconnectall?: () => void;
|
|
16
16
|
ondisconnect?: (url: string) => void;
|
|
17
|
+
recipeCountByServer?: Record<string, number>;
|
|
18
|
+
onrecipeclick?: (url: string) => void;
|
|
19
|
+
toolCountByServer?: Record<string, number>;
|
|
20
|
+
ontoolclick?: (url: string) => void;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
let {
|
|
@@ -23,6 +27,10 @@
|
|
|
23
27
|
onconnect,
|
|
24
28
|
onconnectall,
|
|
25
29
|
ondisconnect,
|
|
30
|
+
recipeCountByServer,
|
|
31
|
+
onrecipeclick,
|
|
32
|
+
toolCountByServer,
|
|
33
|
+
ontoolclick,
|
|
26
34
|
}: Props = $props();
|
|
27
35
|
|
|
28
36
|
const allConnected = $derived(
|
|
@@ -65,6 +73,25 @@
|
|
|
65
73
|
<div class="flex-1 min-w-0 flex flex-col">
|
|
66
74
|
<span class="font-mono text-xs font-medium text-text1">{server.name}</span>
|
|
67
75
|
<span class="text-[10px] text-text2 truncate">{server.description}</span>
|
|
76
|
+
{#if connected && (recipeCountByServer?.[server.url] || toolCountByServer?.[server.url])}
|
|
77
|
+
<span class="flex items-center gap-1.5 mt-0.5">
|
|
78
|
+
{#if recipeCountByServer?.[server.url]}
|
|
79
|
+
<button class="text-[10px] font-mono text-accent hover:underline"
|
|
80
|
+
onclick={(e) => { e.stopPropagation(); onrecipeclick?.(server.url); }}>
|
|
81
|
+
{recipeCountByServer[server.url]} recipes
|
|
82
|
+
</button>
|
|
83
|
+
{/if}
|
|
84
|
+
{#if recipeCountByServer?.[server.url] && toolCountByServer?.[server.url]}
|
|
85
|
+
<span class="text-[10px] text-text2">·</span>
|
|
86
|
+
{/if}
|
|
87
|
+
{#if toolCountByServer?.[server.url]}
|
|
88
|
+
<button class="text-[10px] font-mono text-accent hover:underline"
|
|
89
|
+
onclick={(e) => { e.stopPropagation(); ontoolclick?.(server.url); }}>
|
|
90
|
+
{toolCountByServer[server.url]} tools
|
|
91
|
+
</button>
|
|
92
|
+
{/if}
|
|
93
|
+
</span>
|
|
94
|
+
{/if}
|
|
68
95
|
</div>
|
|
69
96
|
|
|
70
97
|
<!-- action -->
|