feat: prepare for naddr fix
This commit is contained in:
parent
28a251748a
commit
0226fc3f79
4 changed files with 43 additions and 20 deletions
|
|
@ -15,7 +15,7 @@
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="q-gutter-y-md">
|
<div class="q-gutter-y-md">
|
||||||
|
|
||||||
<q-tab-panels v-model="tab">
|
<q-tab-panels v-model="tab">
|
||||||
<q-tab-panel name="merchants">
|
<q-tab-panel name="merchants">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -85,20 +85,22 @@
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="marketplace">
|
<q-tab-panel name="marketplace">
|
||||||
<div class="q-mb-md"> <strong>Information</strong></div>
|
<div class="q-mb-md"> <strong>Information</strong></div>
|
||||||
<q-input outlined v-model="info.name" type="text" label="Marketplace Name" class="q-mb-md">
|
<q-input @change="updateUiConfig" outlined v-model="configData.name" type="text" label="Marketplace Name"
|
||||||
|
class="q-mb-md">
|
||||||
</q-input>
|
</q-input>
|
||||||
|
<q-input @change="updateUiConfig" outlined v-model="configData.about" type="textarea" rows="3"
|
||||||
|
label="Marketplace Description" class="q-mb-lg"></q-input>
|
||||||
|
|
||||||
<q-input outlined v-model="info.description" type="textarea" rows="3" label="Marketplace Description"
|
|
||||||
class="q-mb-lg"></q-input>
|
|
||||||
<div class="q-mb-md q-mt-lg">
|
<div class="q-mb-md q-mt-lg">
|
||||||
<strong>UI Configurations</strong>
|
<strong>UI Configurations</strong>
|
||||||
</div>
|
</div>
|
||||||
<q-input outlined v-model="info.theme" type="text" label="Theme" class="q-mb-md">
|
|
||||||
|
<q-input @change="updateUiConfig" outlined v-model="configData.ui.picture" type="text" label="Logo" class="q-mb-md">
|
||||||
</q-input>
|
</q-input>
|
||||||
<q-input outlined v-model="info.logo" type="text" label="Logo" class="q-mb-md">
|
<q-input @change="updateUiConfig" outlined v-model="configData.ui.banner" type="text" label="Banner" class="q-mb-md">
|
||||||
</q-input>
|
|
||||||
<q-input outlined v-model="info.banner" type="text" label="Banner" class="q-mb-md">
|
|
||||||
</q-input>
|
</q-input>
|
||||||
|
<q-select @change="updateUiConfig" filled v-model="configData.ui.theme" hint="Choose marketplace theme"
|
||||||
|
:options="themeOptions" label="Marketplace Theme"></q-select>
|
||||||
|
|
||||||
|
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
@ -111,8 +113,8 @@
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<q-btn flat label="Copy Naddr" color="green"></q-btn>
|
<q-btn rounded label="Copy Naddr" color="green"></q-btn>
|
||||||
<q-btn flat label="Update" color="primary"></q-btn>
|
<q-btn rounded label="Update" class="q-ml-lg" color="primary"></q-btn>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-card-section></q-card-section>
|
<q-card-section></q-card-section>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ async function marketConfig(path) {
|
||||||
const template = await loadTemplateAsync(path)
|
const template = await loadTemplateAsync(path)
|
||||||
Vue.component('market-config', {
|
Vue.component('market-config', {
|
||||||
name: 'market-config',
|
name: 'market-config',
|
||||||
props: ['merchants', 'relays'],
|
props: ['merchants', 'relays', 'config'],
|
||||||
template,
|
template,
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
|
|
@ -12,13 +12,27 @@ async function marketConfig(path) {
|
||||||
profiles: new Map(),
|
profiles: new Map(),
|
||||||
merchantPubkey: null,
|
merchantPubkey: null,
|
||||||
relayUrl: null,
|
relayUrl: null,
|
||||||
info: {
|
configData: {
|
||||||
|
identifier: null,
|
||||||
name: null,
|
name: null,
|
||||||
description: null,
|
about: null,
|
||||||
theme: null,
|
ui: {
|
||||||
logo: null,
|
picture: null,
|
||||||
banner: null
|
banner: null,
|
||||||
}
|
theme: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
themeOptions: [
|
||||||
|
'classic',
|
||||||
|
'bitcoin',
|
||||||
|
'flamingo',
|
||||||
|
'cyber',
|
||||||
|
'freedom',
|
||||||
|
'mint',
|
||||||
|
'autumn',
|
||||||
|
'monochrome',
|
||||||
|
'salvador'
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -67,9 +81,13 @@ async function marketConfig(path) {
|
||||||
removeRelay: async function (relay) {
|
removeRelay: async function (relay) {
|
||||||
this.$emit('remove-relay', relay)
|
this.$emit('remove-relay', relay)
|
||||||
},
|
},
|
||||||
|
updateUiConfig: function () {
|
||||||
|
console.log('### this.info', this.configData)
|
||||||
|
this.$emit('ui-config-update', this.configData)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created: async function () {
|
created: async function () {
|
||||||
|
this.configData = { ...this.configData, ...this.config }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -345,6 +345,9 @@ const market = async () => {
|
||||||
}
|
}
|
||||||
this.configDialog.show = true
|
this.configDialog.show = true
|
||||||
},
|
},
|
||||||
|
updateUiConfig(configData) {
|
||||||
|
console.log('### updateUiConfig', configData)
|
||||||
|
},
|
||||||
async sendConfig() {
|
async sendConfig() {
|
||||||
let { name, about, ui } = this.configDialog.data
|
let { name, about, ui } = this.configDialog.data
|
||||||
let merchants = Array.from(this.pubkeys)
|
let merchants = Array.from(this.pubkeys)
|
||||||
|
|
|
||||||
|
|
@ -265,8 +265,8 @@
|
||||||
<q-separator class="q-mt-sm q-mb-md"></q-separator>
|
<q-separator class="q-mt-sm q-mb-md"></q-separator>
|
||||||
|
|
||||||
<market-config v-if="activePage === 'market-config'" :merchants="merchants" @add-merchant="addMerchant"
|
<market-config v-if="activePage === 'market-config'" :merchants="merchants" @add-merchant="addMerchant"
|
||||||
@remove-merchant="removeMerchant" :relays="relays" @add-relay="addRelay"
|
@remove-merchant="removeMerchant" :relays="relays" @add-relay="addRelay" @remove-relay="removeRelay"
|
||||||
@remove-relay="removeRelay"></market-config>
|
:config="configDialog" @ui-config-update="updateUiConfig"></market-config>
|
||||||
|
|
||||||
<user-config v-else-if="activePage === 'user-config'"></user-config>
|
<user-config v-else-if="activePage === 'user-config'"></user-config>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue