Fix support entry (#79)
Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
1 parent
1f9440ca58
commit
906d5cc10f
4 files changed
+43
-27
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"type": "patch",
|
||||||
|
"comment": "fix site config for support",
|
||||||
|
"packageName": "@acedatacloud/nexior",
|
||||||
|
"email": "office@acedata.cloud",
|
||||||
|
"dependentChangeType": "patch"
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="middle" />
|
<div class="middle" />
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="link">
|
<div v-if="showSupport" class="link">
|
||||||
<help-entry>
|
<help-entry>
|
||||||
<template #main>
|
<template #main>
|
||||||
<el-button class="button">
|
<el-button class="button">
|
||||||
@@ -204,6 +204,9 @@ export default defineComponent({
|
|||||||
showSite() {
|
showSite() {
|
||||||
return this.$store?.state?.site?.admins?.includes(this.$store.getters.user?.id);
|
return this.$store?.state?.site?.admins?.includes(this.$store.getters.user?.id);
|
||||||
},
|
},
|
||||||
|
showSupport() {
|
||||||
|
return this.$store?.state?.site?.features?.support?.enabled;
|
||||||
|
},
|
||||||
showDistribution() {
|
showDistribution() {
|
||||||
return (
|
return (
|
||||||
// if forcedInviterId is set, only the forced inviter can see the distribution menu
|
// if forcedInviterId is set, only the forced inviter can see the distribution menu
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ export default defineComponent({
|
|||||||
user() {
|
user() {
|
||||||
return this.$store.getters.user;
|
return this.$store.getters.user;
|
||||||
},
|
},
|
||||||
|
showSupport() {
|
||||||
|
return this.$store?.state?.site?.features?.support?.enabled;
|
||||||
|
},
|
||||||
showSite() {
|
showSite() {
|
||||||
return this.$store?.state?.site?.admins?.includes(this.$store.getters.user?.id);
|
return this.$store?.state?.site?.admins?.includes(this.$store.getters.user?.id);
|
||||||
},
|
},
|
||||||
@@ -144,14 +147,18 @@ export default defineComponent({
|
|||||||
href: getBaseUrlPlatform(),
|
href: getBaseUrlPlatform(),
|
||||||
icon: 'fa-solid fa-laptop-code'
|
icon: 'fa-solid fa-laptop-code'
|
||||||
},
|
},
|
||||||
{
|
...(this.showSupport
|
||||||
key: 'support',
|
? [
|
||||||
text: this.$t('common.nav.support'),
|
{
|
||||||
callback: () => {
|
key: 'support',
|
||||||
this.operating.help = true;
|
text: this.$t('common.nav.support'),
|
||||||
},
|
callback: () => {
|
||||||
icon: 'fa-solid fa-question'
|
this.operating.help = true;
|
||||||
},
|
},
|
||||||
|
icon: 'fa-solid fa-question'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
key: 'logout',
|
key: 'logout',
|
||||||
text: this.$t('common.nav.logOut'),
|
text: this.$t('common.nav.logOut'),
|
||||||
|
|||||||
+17
-18
@@ -180,12 +180,11 @@
|
|||||||
>
|
>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-if="site?.features?.[feature]?.enabled !== undefined"
|
:model-value="site.features[feature]?.enabled || false"
|
||||||
v-model="site.features[feature].enabled"
|
|
||||||
inline-prompt
|
inline-prompt
|
||||||
:active-text="$t('site.button.enabled')"
|
:active-text="$t('site.button.enabled')"
|
||||||
:inactive-text="$t('site.button.disabled')"
|
:inactive-text="$t('site.button.disabled')"
|
||||||
@change="
|
@update:model-value="
|
||||||
onSave({
|
onSave({
|
||||||
features: {
|
features: {
|
||||||
...site.features,
|
...site.features,
|
||||||
@@ -201,21 +200,21 @@
|
|||||||
<span class="block tip w-full">
|
<span class="block tip w-full">
|
||||||
{{ $t('site.message.features' + feature.charAt(0).toUpperCase() + feature.slice(1)) }}
|
{{ $t('site.message.features' + feature.charAt(0).toUpperCase() + feature.slice(1)) }}
|
||||||
</span>
|
</span>
|
||||||
<div v-if="feature === 'support'" v-show="site.features[feature].enabled">
|
<div v-if="feature === 'support'" v-show="site.features[feature]?.enabled">
|
||||||
<el-form-item label="WeChat">
|
<el-form-item label="WeChat">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="site.features[feature].wechat.enabled"
|
:model-value="site.features[feature]?.wechat?.enabled || false"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
:active-text="$t('site.button.enabled')"
|
:active-text="$t('site.button.enabled')"
|
||||||
:inactive-text="$t('site.button.disabled')"
|
:inactive-text="$t('site.button.disabled')"
|
||||||
@change="
|
@update:model-value="
|
||||||
onSave({
|
onSave({
|
||||||
features: {
|
features: {
|
||||||
...site.features,
|
...site.features,
|
||||||
[feature]: {
|
[feature]: {
|
||||||
...site.features[feature],
|
...site.features[feature],
|
||||||
wechat: {
|
wechat: {
|
||||||
...site.features[feature].wechat,
|
...site.features[feature]?.wechat,
|
||||||
enabled: $event
|
enabled: $event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,11 +223,11 @@
|
|||||||
"
|
"
|
||||||
></el-switch>
|
></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="site.features[feature].wechat.enabled" :label="$t('site.field.qr')">
|
<el-form-item v-show="site.features[feature]?.wechat?.enabled" :label="$t('site.field.qr')">
|
||||||
<span class="block w-full">
|
<span class="block w-full">
|
||||||
<el-image :src="site.features[feature].wechat?.qr" />
|
<el-image :src="site.features[feature]?.wechat?.qr" />
|
||||||
<edit-image
|
<edit-image
|
||||||
:model-value="site.features[feature].wechat.qr"
|
:model-value="site.features[feature]?.wechat?.qr"
|
||||||
:title="$t('site.title.editQR')"
|
:title="$t('site.title.editQR')"
|
||||||
:tip="$t('site.message.editQRTip')"
|
:tip="$t('site.message.editQRTip')"
|
||||||
@confirm="
|
@confirm="
|
||||||
@@ -238,7 +237,7 @@
|
|||||||
[feature]: {
|
[feature]: {
|
||||||
...site.features[feature],
|
...site.features[feature],
|
||||||
wechat: {
|
wechat: {
|
||||||
...site.features[feature].wechat,
|
...site.features[feature]?.wechat,
|
||||||
qr: $event
|
qr: $event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,18 +249,18 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Discord">
|
<el-form-item label="Discord">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="site.features[feature].discord.enabled"
|
:model-value="site.features[feature]?.discord?.enabled || false"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
:active-text="$t('site.button.enabled')"
|
:active-text="$t('site.button.enabled')"
|
||||||
:inactive-text="$t('site.button.disabled')"
|
:inactive-text="$t('site.button.disabled')"
|
||||||
@change="
|
@update:model-value="
|
||||||
onSave({
|
onSave({
|
||||||
features: {
|
features: {
|
||||||
...site.features,
|
...site.features,
|
||||||
[feature]: {
|
[feature]: {
|
||||||
...site.features[feature],
|
...site.features[feature],
|
||||||
discord: {
|
discord: {
|
||||||
...site.features[feature].discord,
|
...site.features[feature]?.discord,
|
||||||
enabled: $event
|
enabled: $event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,11 +269,11 @@
|
|||||||
"
|
"
|
||||||
></el-switch>
|
></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="site.features[feature].discord.enabled" :label="$t('site.field.url')">
|
<el-form-item v-show="site.features[feature]?.discord?.enabled" :label="$t('site.field.url')">
|
||||||
<span class="block w-full">
|
<span class="block w-full">
|
||||||
{{ site.features[feature].discord?.url }}
|
{{ site.features[feature]?.discord?.url }}
|
||||||
<edit-text
|
<edit-text
|
||||||
:model-value="site.features[feature].discord?.url"
|
:model-value="site.features[feature]?.discord?.url"
|
||||||
:title="$t('site.title.editUrl')"
|
:title="$t('site.title.editUrl')"
|
||||||
:placeholder="$t('site.placeholder.editUrl')"
|
:placeholder="$t('site.placeholder.editUrl')"
|
||||||
@confirm="
|
@confirm="
|
||||||
@@ -284,7 +283,7 @@
|
|||||||
[feature]: {
|
[feature]: {
|
||||||
...site.features[feature],
|
...site.features[feature],
|
||||||
discord: {
|
discord: {
|
||||||
...site.features[feature].discord,
|
...site.features[feature]?.discord,
|
||||||
url: $event
|
url: $event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user