@meddleware/dashboard 0.1.3 → 0.1.4
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 +6 -1
- package/src/App.vue +56 -1
- package/src/router/index.ts +7 -1
- package/vite.config.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Meddleware tools hub — Vue 3 SPA listing hosted services (Walrus, Access Gate) with white-label deploy options.",
|
|
5
5
|
"author": "Meddleware <dev@meddleware.co.uk>",
|
|
6
6
|
"license": "0BSD",
|
|
@@ -28,10 +28,15 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@meddleware/design-tokens": "^0.1.2",
|
|
30
30
|
"@meddleware/ui": "^0.1.6",
|
|
31
|
+
"@meddleware/wallet-adapter": "^0.0.1",
|
|
32
|
+
"@meddleware/walrus-ui": "^0.1.4",
|
|
31
33
|
"pinia": "^4.0.2",
|
|
32
34
|
"vue": "^3.5.40",
|
|
33
35
|
"vue-router": "^5.2.0"
|
|
34
36
|
},
|
|
37
|
+
"overrides": {
|
|
38
|
+
"@mysten/sui": "2.17.0"
|
|
39
|
+
},
|
|
35
40
|
"devDependencies": {
|
|
36
41
|
"@types/node": "~24.12.2",
|
|
37
42
|
"@vitejs/plugin-vue": "^6.0.8",
|
package/src/App.vue
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ColorModeControl, SidebarItem, StatusWidget,
|
|
7
7
|
useColorMode,
|
|
8
8
|
} from '@meddleware/ui'
|
|
9
|
+
import { useWallet } from '@meddleware/wallet-adapter'
|
|
9
10
|
|
|
10
11
|
const { mode, set } = useColorMode('dark')
|
|
11
12
|
const route = useRoute()
|
|
@@ -13,6 +14,22 @@ const route = useRoute()
|
|
|
13
14
|
const isWalrus = computed(() => route.path === '/walrus')
|
|
14
15
|
const isAccessGate = computed(() => route.path === '/access-gate')
|
|
15
16
|
const isSealedStorage = computed(() => route.path === '/sealed-storage')
|
|
17
|
+
|
|
18
|
+
// The dashboard hosts the single shared wallet connection for every inline tool view. It
|
|
19
|
+
// requests the superset of features the tools need so the connect control only offers wallets
|
|
20
|
+
// capable of every operation; individual tools still feature-guard at call time.
|
|
21
|
+
const { wallets, account, connect, disconnect, connecting } = useWallet({
|
|
22
|
+
requiredFeatures: ['sui:signTransaction', 'sui:signPersonalMessage'],
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
async function onConnect(): Promise<void> {
|
|
26
|
+
const w = wallets.value[0]
|
|
27
|
+
if (w) await connect(w)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function shortAddr(addr: string): string {
|
|
31
|
+
return `${addr.slice(0, 8)}…${addr.slice(-4)}`
|
|
32
|
+
}
|
|
16
33
|
</script>
|
|
17
34
|
|
|
18
35
|
<template>
|
|
@@ -23,6 +40,21 @@ const isSealedStorage = computed(() => route.path === '/sealed-storage')
|
|
|
23
40
|
<span>Meddleware</span>
|
|
24
41
|
</template>
|
|
25
42
|
<template #actions>
|
|
43
|
+
<span v-if="account" class="wallet-addr" :title="account.address">
|
|
44
|
+
{{ shortAddr(account.address) }}
|
|
45
|
+
</span>
|
|
46
|
+
<button v-if="account" type="button" class="wallet-btn" @click="disconnect">
|
|
47
|
+
Disconnect
|
|
48
|
+
</button>
|
|
49
|
+
<button
|
|
50
|
+
v-else
|
|
51
|
+
type="button"
|
|
52
|
+
class="wallet-btn"
|
|
53
|
+
:disabled="!wallets.length || connecting"
|
|
54
|
+
@click="onConnect"
|
|
55
|
+
>
|
|
56
|
+
{{ wallets.length ? (connecting ? 'Connecting…' : 'Connect wallet') : 'No wallet' }}
|
|
57
|
+
</button>
|
|
26
58
|
<StatusWidget />
|
|
27
59
|
<ColorModeControl :model-value="mode" @update:model-value="set" />
|
|
28
60
|
</template>
|
|
@@ -67,11 +99,34 @@ const isSealedStorage = computed(() => route.path === '/sealed-storage')
|
|
|
67
99
|
}
|
|
68
100
|
|
|
69
101
|
.app-shell__main {
|
|
70
|
-
|
|
102
|
+
/* Inline tool views can exceed the viewport — scroll the main area internally
|
|
103
|
+
(the shell itself stays fixed at 100vh). */
|
|
104
|
+
overflow-y: auto;
|
|
71
105
|
height: 100%;
|
|
72
106
|
}
|
|
73
107
|
|
|
74
108
|
.brand-mark {
|
|
75
109
|
color: var(--gold);
|
|
76
110
|
}
|
|
111
|
+
|
|
112
|
+
.wallet-addr {
|
|
113
|
+
font-family: monospace;
|
|
114
|
+
font-size: 0.85rem;
|
|
115
|
+
color: var(--muted);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wallet-btn {
|
|
119
|
+
background: none;
|
|
120
|
+
border: 1px solid var(--border);
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
padding: 0.35rem 0.75rem;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
color: var(--text);
|
|
125
|
+
font-size: 0.85rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.wallet-btn:disabled {
|
|
129
|
+
opacity: 0.5;
|
|
130
|
+
cursor: not-allowed;
|
|
131
|
+
}
|
|
77
132
|
</style>
|
package/src/router/index.ts
CHANGED
|
@@ -2,11 +2,17 @@ import { createRouter, createWebHistory } from 'vue-router'
|
|
|
2
2
|
import Home from '../views/Home.vue'
|
|
3
3
|
import ToolPage from '../views/ToolPage.vue'
|
|
4
4
|
|
|
5
|
+
// Walrus renders inline via the component exported from @meddleware/walrus-ui (no iframe).
|
|
6
|
+
// It shares the dashboard's wallet connection through the @meddleware/wallet-adapter singleton.
|
|
7
|
+
// Access Gate and Sealed Storage remain on the interim iframe path until their phases land.
|
|
5
8
|
const router = createRouter({
|
|
6
9
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
7
10
|
routes: [
|
|
8
11
|
{ path: '/', component: Home },
|
|
9
|
-
{
|
|
12
|
+
{
|
|
13
|
+
path: '/walrus',
|
|
14
|
+
component: () => import('@meddleware/walrus-ui').then((m) => m.WalrusView),
|
|
15
|
+
},
|
|
10
16
|
{ path: '/access-gate', component: ToolPage, props: { src: 'https://sui-access-gate.meddleware.co.uk/?embedded=1', title: 'Access Gate' } },
|
|
11
17
|
{ path: '/sealed-storage', component: ToolPage, props: { src: 'https://sui-seal.meddleware.co.uk/?embedded=1', title: 'Sealed Storage' } },
|
|
12
18
|
],
|
package/vite.config.ts
CHANGED
|
@@ -4,4 +4,9 @@ import vue from '@vitejs/plugin-vue'
|
|
|
4
4
|
// @meddleware/* resolve from node_modules (published packages — no monorepo aliases).
|
|
5
5
|
export default defineConfig({
|
|
6
6
|
plugins: [vue()],
|
|
7
|
+
optimizeDeps: {
|
|
8
|
+
// The Walrus wasm client is dynamically imported inside the inline WalrusView upload flow;
|
|
9
|
+
// keep it out of the eager dep-optimization graph so it stays a lazy chunk.
|
|
10
|
+
exclude: ['@mysten/walrus', '@mysten/walrus-wasm'],
|
|
11
|
+
},
|
|
7
12
|
})
|