This commit is contained in:
syuilo 2021-02-07 02:08:32 +09:00
parent 871d2bad17
commit 5743d87a43

View file

@ -1,26 +1,32 @@
<template> <template>
<section class="_section"> <FormBase>
<div class="_content" v-if="enableTwitterIntegration"> <div class="_formItem" v-if="enableTwitterIntegration">
<header><Fa :icon="faTwitter"/> Twitter</header> <div class="_formLabel"><Fa :icon="faTwitter"/> Twitter</div>
<p v-if="integrations.twitter">{{ $ts.connectedTo }}: <a :href="`https://twitter.com/${integrations.twitter.screenName}`" rel="nofollow noopener" target="_blank">@{{ integrations.twitter.screenName }}</a></p> <div class="_formPanel" style="padding: 16px;">
<MkButton v-if="integrations.twitter" @click="disconnectTwitter">{{ $ts.disconnectSerice }}</MkButton> <p v-if="integrations.twitter">{{ $ts.connectedTo }}: <a :href="`https://twitter.com/${integrations.twitter.screenName}`" rel="nofollow noopener" target="_blank">@{{ integrations.twitter.screenName }}</a></p>
<MkButton v-else @click="connectTwitter">{{ $ts.connectSerice }}</MkButton> <MkButton v-if="integrations.twitter" @click="disconnectTwitter" danger>{{ $ts.disconnectSerice }}</MkButton>
<MkButton v-else @click="connectTwitter" primary>{{ $ts.connectSerice }}</MkButton>
</div>
</div> </div>
<div class="_content" v-if="enableDiscordIntegration"> <div class="_formItem" v-if="enableDiscordIntegration">
<header><Fa :icon="faDiscord"/> Discord</header> <div class="_formLabel"><Fa :icon="faDiscord"/> Discord</div>
<p v-if="integrations.discord">{{ $ts.connectedTo }}: <a :href="`https://discord.com/users/${integrations.discord.id}`" rel="nofollow noopener" target="_blank">@{{ integrations.discord.username }}#{{ integrations.discord.discriminator }}</a></p> <div class="_formPanel" style="padding: 16px;">
<MkButton v-if="integrations.discord" @click="disconnectDiscord">{{ $ts.disconnectSerice }}</MkButton> <p v-if="integrations.discord">{{ $ts.connectedTo }}: <a :href="`https://discord.com/users/${integrations.discord.id}`" rel="nofollow noopener" target="_blank">@{{ integrations.discord.username }}#{{ integrations.discord.discriminator }}</a></p>
<MkButton v-else @click="connectDiscord">{{ $ts.connectSerice }}</MkButton> <MkButton v-if="integrations.discord" @click="disconnectDiscord" danger>{{ $ts.disconnectSerice }}</MkButton>
<MkButton v-else @click="connectDiscord" primary>{{ $ts.connectSerice }}</MkButton>
</div>
</div> </div>
<div class="_content" v-if="enableGithubIntegration"> <div class="_formItem" v-if="enableGithubIntegration">
<header><Fa :icon="faGithub"/> GitHub</header> <div class="_formLabel"><Fa :icon="faGithub"/> GitHub</div>
<p v-if="integrations.github">{{ $ts.connectedTo }}: <a :href="`https://github.com/${integrations.github.login}`" rel="nofollow noopener" target="_blank">@{{ integrations.github.login }}</a></p> <div class="_formPanel" style="padding: 16px;">
<MkButton v-if="integrations.github" @click="disconnectGithub">{{ $ts.disconnectSerice }}</MkButton> <p v-if="integrations.github">{{ $ts.connectedTo }}: <a :href="`https://github.com/${integrations.github.login}`" rel="nofollow noopener" target="_blank">@{{ integrations.github.login }}</a></p>
<MkButton v-else @click="connectGithub">{{ $ts.connectSerice }}</MkButton> <MkButton v-if="integrations.github" @click="disconnectGithub" danger>{{ $ts.disconnectSerice }}</MkButton>
<MkButton v-else @click="connectGithub" primary>{{ $ts.connectSerice }}</MkButton>
</div>
</div> </div>
</section> </FormBase>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -28,11 +34,13 @@ import { defineComponent } from 'vue';
import { faShareAlt } from '@fortawesome/free-solid-svg-icons'; import { faShareAlt } from '@fortawesome/free-solid-svg-icons';
import { faTwitter, faDiscord, faGithub } from '@fortawesome/free-brands-svg-icons'; import { faTwitter, faDiscord, faGithub } from '@fortawesome/free-brands-svg-icons';
import { apiUrl } from '@/config'; import { apiUrl } from '@/config';
import FormBase from '@/components/form/base.vue';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
FormBase,
MkButton MkButton
}, },