@meddleware/access-gate-ui 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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/access-gate-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Operator console for creating and managing on-chain Sui access gates — create gates, configure settings, airdrop NFTs, and freeze gates via a wallet-connected SPA.",
|
|
5
5
|
"author": "Meddleware <dev@meddleware.co.uk>",
|
|
6
6
|
"license": "0BSD",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@meddleware/design-tokens": "^0.1.2",
|
|
41
|
-
"@meddleware/ui": "^0.1.
|
|
41
|
+
"@meddleware/ui": "^0.1.11",
|
|
42
42
|
"@meddleware/nft-gate-client": "^0.0.6",
|
|
43
43
|
"@meddleware/wallet-adapter": "^0.0.5",
|
|
44
44
|
"@mysten/sui": "^2.30.0",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// Gate loading is driven by watching the connected account, so it works whether the connection
|
|
8
8
|
// is made from this app's own header (standalone) or the dashboard's shared control (embedded).
|
|
9
9
|
import { ref, watch } from 'vue'
|
|
10
|
-
import { UiNotice } from '@meddleware/ui'
|
|
10
|
+
import { AppTabNav, UiNotice, type AppTab } from '@meddleware/ui'
|
|
11
11
|
import { WalletGuard } from '@meddleware/wallet-adapter'
|
|
12
12
|
import type { OwnedGate } from '@meddleware/nft-gate-client'
|
|
13
13
|
import { NETWORK } from '../config.js'
|
|
@@ -16,8 +16,16 @@ import { useWallet } from '../wallet.js'
|
|
|
16
16
|
import CreateGateForm from './CreateGateForm.vue'
|
|
17
17
|
import GateList from './GateList.vue'
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const TABS: AppTab[] = [
|
|
20
|
+
{ id: 'gates', label: 'My gates' },
|
|
21
|
+
{ id: 'create', label: 'Create gate' },
|
|
22
|
+
]
|
|
23
|
+
const activeTab = ref<string>('gates')
|
|
24
|
+
|
|
25
|
+
function onTabChange(id: string): void {
|
|
26
|
+
activeTab.value = id
|
|
27
|
+
if (id === 'gates') void reloadGates()
|
|
28
|
+
}
|
|
21
29
|
|
|
22
30
|
const { account } = useWallet()
|
|
23
31
|
|
|
@@ -66,14 +74,7 @@ function onCreated(): void {
|
|
|
66
74
|
</UiNotice>
|
|
67
75
|
|
|
68
76
|
<WalletGuard v-else message="Connect a Sui wallet to create and manage your access gates.">
|
|
69
|
-
<
|
|
70
|
-
<button type="button" class="tab" :class="{ active: activeTab === 'gates' }" @click="activeTab = 'gates'; reloadGates()">
|
|
71
|
-
My gates
|
|
72
|
-
</button>
|
|
73
|
-
<button type="button" class="tab" :class="{ active: activeTab === 'create' }" @click="activeTab = 'create'">
|
|
74
|
-
Create gate
|
|
75
|
-
</button>
|
|
76
|
-
</nav>
|
|
77
|
+
<AppTabNav :tabs="TABS" :model-value="activeTab" aria-label="Sections" style="margin: 0 0 1rem" @update:model-value="onTabChange" />
|
|
77
78
|
|
|
78
79
|
<UiNotice v-if="loadError" type="error">{{ loadError }}</UiNotice>
|
|
79
80
|
|
|
@@ -100,27 +101,4 @@ function onCreated(): void {
|
|
|
100
101
|
margin: 0.25rem 0 1.25rem;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
.tabs {
|
|
104
|
-
display: flex;
|
|
105
|
-
gap: 0.25rem;
|
|
106
|
-
margin: 0 0 1rem;
|
|
107
|
-
border-bottom: 2px solid var(--border);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.tab {
|
|
111
|
-
background: none;
|
|
112
|
-
border: none;
|
|
113
|
-
border-bottom: 2px solid transparent;
|
|
114
|
-
padding: 0.5rem 1rem;
|
|
115
|
-
margin-bottom: -2px;
|
|
116
|
-
cursor: pointer;
|
|
117
|
-
font-size: 0.95rem;
|
|
118
|
-
color: var(--muted);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.tab.active {
|
|
122
|
-
border-bottom-color: var(--accent);
|
|
123
|
-
color: var(--text);
|
|
124
|
-
font-weight: 600;
|
|
125
|
-
}
|
|
126
104
|
</style>
|
|
@@ -68,9 +68,9 @@ async function submit(): Promise<void> {
|
|
|
68
68
|
</label>
|
|
69
69
|
|
|
70
70
|
<label class="field">
|
|
71
|
-
<span>Default
|
|
71
|
+
<span>Default credits</span>
|
|
72
72
|
<input v-model="defaultUses" type="number" min="0" step="1" />
|
|
73
|
-
<small>0 = unlimited pass; N =
|
|
73
|
+
<small>0 = unlimited pass; N = NFT granting N upload credits.</small>
|
|
74
74
|
</label>
|
|
75
75
|
|
|
76
76
|
<label class="check">
|
|
@@ -80,7 +80,7 @@ async function submit(): Promise<void> {
|
|
|
80
80
|
|
|
81
81
|
<label class="check">
|
|
82
82
|
<input v-model="autoBurnAtZero" type="checkbox" />
|
|
83
|
-
<span>Auto-burn
|
|
83
|
+
<span>Auto-burn NFTs at zero credits</span>
|
|
84
84
|
</label>
|
|
85
85
|
|
|
86
86
|
<label class="field">
|
|
@@ -34,7 +34,7 @@ function priceLabel(mist: bigint): string {
|
|
|
34
34
|
</div>
|
|
35
35
|
<div class="badges">
|
|
36
36
|
<span class="badge">{{ priceLabel(gate.priceMist) }}</span>
|
|
37
|
-
<span class="badge">{{ gate.defaultUses === 0n ? 'Unlimited' : `${gate.defaultUses}
|
|
37
|
+
<span class="badge">{{ gate.defaultUses === 0n ? 'Unlimited' : `${gate.defaultUses} credits` }}</span>
|
|
38
38
|
<span v-if="gate.soulbound" class="badge">Soulbound</span>
|
|
39
39
|
<span v-if="gate.paused" class="badge badge--warn">Paused</span>
|
|
40
40
|
<span v-if="gate.frozen" class="badge badge--warn">Frozen</span>
|
|
@@ -78,7 +78,7 @@ const ctx = () => adminContext(props.gate)
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div class="row">
|
|
81
|
-
<label>Default
|
|
81
|
+
<label>Default credits</label>
|
|
82
82
|
<input v-model="defaultUses" type="number" min="0" step="1" />
|
|
83
83
|
<UiButton variant="secondary" :disabled="busy !== null" @click="run('uses', () => buildSetDefaultUsesTx(ctx(), BigInt(defaultUses || '0')))">
|
|
84
84
|
{{ busy === 'uses' ? '…' : 'Update' }}
|