refactor: ♻️ donation link logic, add link to /about, fix typo
This commit is contained in:
parent
04224bfc66
commit
acb6edef3c
|
@ -1219,7 +1219,7 @@ _aboutMisskey:
|
||||||
donate: "Donate to Calckey"
|
donate: "Donate to Calckey"
|
||||||
donateTitle: "Enjoying Calckey?"
|
donateTitle: "Enjoying Calckey?"
|
||||||
pleaseDonateToCalckey: "Please consider donating to Calckey to support its development."
|
pleaseDonateToCalckey: "Please consider donating to Calckey to support its development."
|
||||||
pleaseDonateToHost: "Please also consider donating to your honme server, {host}, to help support its operation costs."
|
pleaseDonateToHost: "Please also consider donating to your home server, {host}, to help support its operation costs."
|
||||||
donateHost: "Donate to {host}"
|
donateHost: "Donate to {host}"
|
||||||
morePatrons: "We also appreciate the support of many other helpers not listed here.
|
morePatrons: "We also appreciate the support of many other helpers not listed here.
|
||||||
Thank you! 🥰"
|
Thank you! 🥰"
|
||||||
|
|
|
@ -177,6 +177,9 @@ export const paramDef = {
|
||||||
postImports: { type: "boolean" },
|
postImports: { type: "boolean" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
enableServerMachineStats: { type: "boolean" },
|
||||||
|
enableIdenticonGeneration: { type: "boolean" },
|
||||||
|
donationLink: { type: "string", nullable: true },
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -568,6 +571,21 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
set.experimentalFeatures = ps.experimentalFeatures || undefined;
|
set.experimentalFeatures = ps.experimentalFeatures || undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ps.enableServerMachineStats !== undefined) {
|
||||||
|
set.enableServerMachineStats = ps.enableServerMachineStats;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps.enableIdenticonGeneration !== undefined) {
|
||||||
|
set.enableIdenticonGeneration = ps.enableIdenticonGeneration;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps.donationLink !== undefined) {
|
||||||
|
set.donationLink = ps.donationLink;
|
||||||
|
if (set.donationLink && !/^https?:\/\//i.test(set.donationLink)) {
|
||||||
|
set.donationLink = `https://${set.donationLink}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await db.transaction(async (transactionalEntityManager) => {
|
await db.transaction(async (transactionalEntityManager) => {
|
||||||
const metas = await transactionalEntityManager.find(Meta, {
|
const metas = await transactionalEntityManager.find(Meta, {
|
||||||
order: {
|
order: {
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="_flexList">
|
<div class="_flexList">
|
||||||
<MkButton primary @click="openCalckeyDonation">{{
|
<MkButton primary @click="openExternal('https://opencollective.com/calckey')">{{
|
||||||
i18n.ts._aboutMisskey.donate
|
i18n.ts._aboutMisskey.donate
|
||||||
}}</MkButton>
|
}}</MkButton>
|
||||||
<MkButton v-if="instance.donationLink" primary @click="openExternalDonation">{{
|
<MkButton v-if="instance.donationLink" primary @click="openExternal(instance.donationLink)">{{
|
||||||
i18n.t("_aboutMisskey.donateHost", {
|
i18n.t("_aboutMisskey.donateHost", {
|
||||||
host: hostname,
|
host: hostname,
|
||||||
})
|
})
|
||||||
|
@ -63,15 +63,7 @@ function neverShow() {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function openCalckeyDonation() {
|
function openExternal(link) {
|
||||||
window.open("https://opencollective.com/calckey", "_blank");
|
|
||||||
}
|
|
||||||
|
|
||||||
function openExternalDonation() {
|
|
||||||
let link = instance.donationLink;
|
|
||||||
if (!/^https?:\/\//i.test(link)) {
|
|
||||||
link = `http://${link}`;
|
|
||||||
}
|
|
||||||
window.open(link, "_blank");
|
window.open(link, "_blank");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -93,6 +93,21 @@
|
||||||
external
|
external
|
||||||
>{{ i18n.ts.tos }}</FormLink
|
>{{ i18n.ts.tos }}</FormLink
|
||||||
>
|
>
|
||||||
|
<FormLink
|
||||||
|
v-if="$instance.donationLink"
|
||||||
|
:to="$instance.donationLink"
|
||||||
|
external
|
||||||
|
>
|
||||||
|
<template #icon
|
||||||
|
><i class="ph-money ph-bold ph-lg"></i
|
||||||
|
></template>
|
||||||
|
{{
|
||||||
|
i18n.t("_aboutMisskey.donateHost", {
|
||||||
|
host: $instance.name || host,
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
<template #suffix>Donate</template>
|
||||||
|
</FormLink>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
|
||||||
<FormSuspense :p="initStats">
|
<FormSuspense :p="initStats">
|
||||||
|
|
Loading…
Reference in New Issue