@meddleware/dashboard 0.1.8 → 0.1.10
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 +3 -3
- package/src/App.vue +41 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
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,9 +28,9 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@meddleware/access-gate-ui": "^0.1.3",
|
|
30
30
|
"@meddleware/design-tokens": "^0.1.2",
|
|
31
|
-
"@meddleware/seal-ui": "^0.0.
|
|
31
|
+
"@meddleware/seal-ui": "^0.0.5",
|
|
32
32
|
"@meddleware/ui": "^0.1.6",
|
|
33
|
-
"@meddleware/wallet-adapter": "^0.0.
|
|
33
|
+
"@meddleware/wallet-adapter": "^0.0.4",
|
|
34
34
|
"@meddleware/walrus-ui": "^0.1.5",
|
|
35
35
|
"pinia": "^4.0.2",
|
|
36
36
|
"vue": "^3.5.40",
|
package/src/App.vue
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ColorModeControl, SidebarItem, StatusWidget,
|
|
7
7
|
useColorMode,
|
|
8
8
|
} from '@meddleware/ui'
|
|
9
|
-
import { useWallet } from '@meddleware/wallet-adapter'
|
|
9
|
+
import { useWallet, WalletModal } from '@meddleware/wallet-adapter'
|
|
10
10
|
|
|
11
11
|
const { mode, set } = useColorMode('dark')
|
|
12
12
|
const route = useRoute()
|
|
@@ -18,17 +18,12 @@ const isSealedStorage = computed(() => route.path === '/sealed-storage')
|
|
|
18
18
|
// The dashboard hosts the single shared wallet connection for every inline tool view. It
|
|
19
19
|
// requests the superset of features the tools need so the connect control only offers wallets
|
|
20
20
|
// capable of every operation; individual tools still feature-guard at call time.
|
|
21
|
-
const {
|
|
21
|
+
const { account, disconnect } = useWallet({
|
|
22
22
|
requiredFeatures: ['sui:signTransaction', 'sui:signPersonalMessage'],
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
async function onConnect(): Promise<void> {
|
|
26
|
-
const w = wallets.value[0]
|
|
27
|
-
if (w) await connect(w)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
function shortAddr(addr: string): string {
|
|
31
|
-
return `${addr.slice(0,
|
|
26
|
+
return `${addr.slice(0, 6)}…${addr.slice(-4)}`
|
|
32
27
|
}
|
|
33
28
|
</script>
|
|
34
29
|
|
|
@@ -40,21 +35,6 @@ function shortAddr(addr: string): string {
|
|
|
40
35
|
<span>Meddleware</span>
|
|
41
36
|
</template>
|
|
42
37
|
<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>
|
|
58
38
|
<StatusWidget />
|
|
59
39
|
<ColorModeControl :model-value="mode" @update:model-value="set" />
|
|
60
40
|
</template>
|
|
@@ -72,6 +52,15 @@ function shortAddr(addr: string): string {
|
|
|
72
52
|
<SidebarItem label="Sealed Storage" icon="🔒" :active="isSealedStorage" @click="navigate" />
|
|
73
53
|
</router-link>
|
|
74
54
|
</nav>
|
|
55
|
+
|
|
56
|
+
<template #foot>
|
|
57
|
+
<div v-if="account" class="wallet-connected">
|
|
58
|
+
<span class="wallet-addr" :title="account.address">{{ shortAddr(account.address) }}</span>
|
|
59
|
+
<button type="button" class="wallet-disconnect" @click="disconnect">Disconnect</button>
|
|
60
|
+
</div>
|
|
61
|
+
<WalletModal v-else />
|
|
62
|
+
<p class="sidebar-copyright">© {{ new Date().getFullYear() }} Meddleware</p>
|
|
63
|
+
</template>
|
|
75
64
|
</AppSidebar>
|
|
76
65
|
|
|
77
66
|
<main class="app-shell__main">
|
|
@@ -99,8 +88,6 @@ function shortAddr(addr: string): string {
|
|
|
99
88
|
}
|
|
100
89
|
|
|
101
90
|
.app-shell__main {
|
|
102
|
-
/* Inline tool views can exceed the viewport — scroll the main area internally
|
|
103
|
-
(the shell itself stays fixed at 100vh). */
|
|
104
91
|
overflow-y: auto;
|
|
105
92
|
height: 100%;
|
|
106
93
|
}
|
|
@@ -109,24 +96,44 @@ function shortAddr(addr: string): string {
|
|
|
109
96
|
color: var(--gold);
|
|
110
97
|
}
|
|
111
98
|
|
|
99
|
+
/* ── Sidebar wallet foot ───────────────────────────────── */
|
|
100
|
+
.wallet-connected {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: space-between;
|
|
104
|
+
gap: 0.5rem;
|
|
105
|
+
margin-bottom: 0.75rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
112
108
|
.wallet-addr {
|
|
113
109
|
font-family: monospace;
|
|
114
|
-
font-size: 0.
|
|
110
|
+
font-size: 0.8rem;
|
|
115
111
|
color: var(--muted);
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
text-overflow: ellipsis;
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
.wallet-
|
|
117
|
+
.wallet-disconnect {
|
|
119
118
|
background: none;
|
|
120
|
-
border:
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
border: none;
|
|
120
|
+
padding: 0;
|
|
121
|
+
color: var(--muted);
|
|
122
|
+
font-size: 0.8rem;
|
|
123
123
|
cursor: pointer;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
text-decoration: underline;
|
|
126
|
+
text-underline-offset: 2px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.wallet-disconnect:hover {
|
|
124
130
|
color: var(--text);
|
|
125
|
-
font-size: 0.85rem;
|
|
126
131
|
}
|
|
127
132
|
|
|
128
|
-
.
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
.sidebar-copyright {
|
|
134
|
+
font-size: 0.75rem;
|
|
135
|
+
color: var(--muted);
|
|
136
|
+
margin: 0;
|
|
137
|
+
opacity: 0.6;
|
|
131
138
|
}
|
|
132
139
|
</style>
|