クライアントの設定コンポーネントを整理
* デスクトップとモバイルで統一 * いくつかの設定を廃止
This commit is contained in:
parent
d83efecc94
commit
ea1818284b
26 changed files with 737 additions and 1206 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<mk-window ref="window" is-modal width="700px" height="550px" @closed="destroyDom">
|
||||
<template #header :class="$style.header"><fa icon="cog"/>{{ $t('settings') }}</template>
|
||||
<template #header :class="$style.header"><fa icon="cog"/>{{ $t('@.settings') }}</template>
|
||||
<x-settings :initial-page="initialPage" @done="close"/>
|
||||
</mk-window>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
<template>
|
||||
<div class="2fa">
|
||||
<p style="margin-top:0;">{{ $t('intro') }}<a :href="$t('url')" target="_blank">{{ $t('detail') }}</a></p>
|
||||
<ui-info warn>{{ $t('caution') }}</ui-info>
|
||||
<p v-if="!data && !$store.state.i.twoFactorEnabled"><ui-button @click="register">{{ $t('register') }}</ui-button></p>
|
||||
<template v-if="$store.state.i.twoFactorEnabled">
|
||||
<p>{{ $t('already-registered') }}</p>
|
||||
<ui-button @click="unregister">{{ $t('unregister') }}</ui-button>
|
||||
</template>
|
||||
<div v-if="data && !$store.state.i.twoFactorEnabled">
|
||||
<ol>
|
||||
<li>{{ $t('authenticator') }}<a href="https://support.google.com/accounts/answer/1066447" target="_blank">{{ $t('howtoinstall') }}</a></li>
|
||||
<li>{{ $t('scan') }}<br><img :src="data.qr"></li>
|
||||
<li>{{ $t('done') }}<br>
|
||||
<ui-input v-model="token">{{ $t('token') }}</ui-input>
|
||||
<ui-button primary @click="submit">{{ $t('submit') }}</ui-button>
|
||||
</li>
|
||||
</ol>
|
||||
<ui-info>{{ $t('info') }}</ui-info>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../../i18n';
|
||||
|
||||
export default Vue.extend({
|
||||
i18n: i18n('desktop/views/components/settings.2fa.vue'),
|
||||
data() {
|
||||
return {
|
||||
data: null,
|
||||
token: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
register() {
|
||||
this.$root.dialog({
|
||||
title: this.$t('enter-password'),
|
||||
input: {
|
||||
type: 'password'
|
||||
}
|
||||
}).then(({ canceled, result: password }) => {
|
||||
if (canceled) return;
|
||||
this.$root.api('i/2fa/register', {
|
||||
password: password
|
||||
}).then(data => {
|
||||
this.data = data;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
unregister() {
|
||||
this.$root.dialog({
|
||||
title: this.$t('enter-password'),
|
||||
input: {
|
||||
type: 'password'
|
||||
}
|
||||
}).then(({ canceled, result: password }) => {
|
||||
if (canceled) return;
|
||||
this.$root.api('i/2fa/unregister', {
|
||||
password: password
|
||||
}).then(() => {
|
||||
this.$notify(this.$t('unregistered'));
|
||||
this.$store.state.i.twoFactorEnabled = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
submit() {
|
||||
this.$root.api('i/2fa/done', {
|
||||
token: this.token
|
||||
}).then(() => {
|
||||
this.$notify(this.$t('success'));
|
||||
this.$store.state.i.twoFactorEnabled = true;
|
||||
}).catch(() => {
|
||||
this.$notify(this.$t('failed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<template>
|
||||
<div class="root">
|
||||
<ui-info v-if="!fetching && apps.length == 0">{{ $t('no-apps') }}</ui-info>
|
||||
<div class="apps" v-if="apps.length != 0">
|
||||
<div v-for="app in apps">
|
||||
<p><b>{{ app.name }}</b></p>
|
||||
<p>{{ app.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../../i18n';
|
||||
export default Vue.extend({
|
||||
i18n: i18n('desktop/views/components/settings.apps.vue'),
|
||||
data() {
|
||||
return {
|
||||
fetching: true,
|
||||
apps: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$root.api('i/authorized_apps').then(apps => {
|
||||
this.apps = apps;
|
||||
this.fetching = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.root
|
||||
> .apps
|
||||
> div
|
||||
padding 16px 0 0 0
|
||||
border-bottom solid 1px #eee
|
||||
</style>
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
<template>
|
||||
<div class="root">
|
||||
<div class="signins" v-if="signins.length != 0">
|
||||
<div v-for="signin in signins">
|
||||
<header @click="signin._show = !signin._show">
|
||||
<template v-if="signin.success"><fa icon="check"/></template>
|
||||
<template v-else><fa icon="times"/></template>
|
||||
<span class="ip">{{ signin.ip }}</span>
|
||||
<mk-time :time="signin.createdAt"/>
|
||||
</header>
|
||||
<div class="headers" v-show="signin._show">
|
||||
<!-- TODO -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
fetching: true,
|
||||
signins: [],
|
||||
connection: null
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$root.api('i/signin_history').then(signins => {
|
||||
this.signins = signins;
|
||||
this.fetching = false;
|
||||
});
|
||||
|
||||
this.connection = this.$root.stream.useSharedConnection('main');
|
||||
|
||||
this.connection.on('signin', this.onSignin);
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.connection.dispose();
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSignin(signin) {
|
||||
this.signins.unshift(signin);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.root
|
||||
> .signins
|
||||
> div
|
||||
border-bottom solid 1px #eee
|
||||
|
||||
> header
|
||||
display flex
|
||||
padding 8px 0
|
||||
line-height 32px
|
||||
cursor pointer
|
||||
|
||||
> [data-icon]
|
||||
margin-right 8px
|
||||
text-align left
|
||||
|
||||
&.check
|
||||
color #0fda82
|
||||
|
||||
&.times
|
||||
color #ff3100
|
||||
|
||||
> .ip
|
||||
display inline-block
|
||||
text-align left
|
||||
padding 8px
|
||||
line-height 16px
|
||||
font-family monospace
|
||||
font-size 14px
|
||||
color #444
|
||||
background #f8f8f8
|
||||
border-radius 4px
|
||||
|
||||
> .mk-time
|
||||
margin-left auto
|
||||
text-align right
|
||||
color #777
|
||||
|
||||
> .headers
|
||||
overflow auto
|
||||
margin 0 0 16px 0
|
||||
max-height 100px
|
||||
white-space pre-wrap
|
||||
word-break break-all
|
||||
|
||||
</style>
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<template>
|
||||
<div class="vfcitkilproprqtbnpoertpsziierwzi">
|
||||
<div v-for="timeline in timelines" class="timeline" :key="timeline.id">
|
||||
<ui-input v-model="timeline.title" @change="save">
|
||||
<span>{{ $t('title') }}</span>
|
||||
</ui-input>
|
||||
<ui-textarea :value="timeline.query ? timeline.query.map(tags => tags.join(' ')).join('\n') : ''" :pre="true" @input="onQueryChange(timeline, $event)">
|
||||
<span>{{ $t('query') }}</span>
|
||||
</ui-textarea>
|
||||
</div>
|
||||
<ui-button class="add" @click="add">{{ $t('add') }}</ui-button>
|
||||
<ui-button class="save" @click="save">{{ $t('save') }}</ui-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../../i18n';
|
||||
import * as uuid from 'uuid';
|
||||
|
||||
export default Vue.extend({
|
||||
i18n: i18n('desktop/views/components/settings.tags.vue'),
|
||||
data() {
|
||||
return {
|
||||
timelines: this.$store.state.settings.tagTimelines
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
add() {
|
||||
this.timelines.push({
|
||||
id: uuid(),
|
||||
title: '',
|
||||
query: ''
|
||||
});
|
||||
},
|
||||
|
||||
save() {
|
||||
const timelines = this.timelines
|
||||
.filter(timeline => timeline.title)
|
||||
.map(timeline => {
|
||||
if (!(timeline.query && timeline.query[0] && timeline.query[0][0])) {
|
||||
timeline.query = timeline.title.split('\n').map(tags => tags.split(' '));
|
||||
}
|
||||
return timeline;
|
||||
});
|
||||
|
||||
this.$store.dispatch('settings/set', { key: 'tagTimelines', value: timelines });
|
||||
},
|
||||
|
||||
onQueryChange(timeline, value) {
|
||||
timeline.query = value.split('\n').map(tags => tags.split(' '));
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.vfcitkilproprqtbnpoertpsziierwzi
|
||||
> .timeline
|
||||
padding-bottom 16px
|
||||
border-bottom solid 1px rgba(#000, 0.1)
|
||||
|
||||
> .add
|
||||
margin-top 16px
|
||||
|
||||
</style>
|
||||
|
|
@ -1,267 +1,20 @@
|
|||
<template>
|
||||
<div class="mk-settings">
|
||||
<div class="nav" :class="{ inWindow }">
|
||||
<p :class="{ active: page == 'profile' }" @mousedown="page = 'profile'"><fa icon="user" fixed-width/>{{ $t('profile') }}</p>
|
||||
<p :class="{ active: page == 'theme' }" @mousedown="page = 'theme'"><fa icon="palette" fixed-width/>{{ $t('theme') }}</p>
|
||||
<p :class="{ active: page == 'web' }" @mousedown="page = 'web'"><fa icon="desktop" fixed-width/>Web</p>
|
||||
<p :class="{ active: page == 'notification' }" @mousedown="page = 'notification'"><fa :icon="['far', 'bell']" fixed-width/>{{ $t('notification') }}</p>
|
||||
<p :class="{ active: page == 'profile' }" @mousedown="page = 'profile'"><fa icon="user" fixed-width/>{{ $t('@._settings.profile') }}</p>
|
||||
<p :class="{ active: page == 'appearance' }" @mousedown="page = 'appearance'"><fa icon="palette" fixed-width/>{{ $t('@._settings.appearance') }}</p>
|
||||
<p :class="{ active: page == 'behavior' }" @mousedown="page = 'behavior'"><fa icon="desktop" fixed-width/>{{ $t('@._settings.behavior') }}</p>
|
||||
<p :class="{ active: page == 'notification' }" @mousedown="page = 'notification'"><fa :icon="['far', 'bell']" fixed-width/>{{ $t('@._settings.notification') }}</p>
|
||||
<p :class="{ active: page == 'drive' }" @mousedown="page = 'drive'"><fa icon="cloud" fixed-width/>{{ $t('@.drive') }}</p>
|
||||
<p :class="{ active: page == 'hashtags' }" @mousedown="page = 'hashtags'"><fa icon="hashtag" fixed-width/>{{ $t('tags') }}</p>
|
||||
<p :class="{ active: page == 'muteAndBlock' }" @mousedown="page = 'muteAndBlock'"><fa icon="ban" fixed-width/>{{ $t('mute-and-block') }}</p>
|
||||
<p :class="{ active: page == 'apps' }" @mousedown="page = 'apps'"><fa icon="puzzle-piece" fixed-width/>{{ $t('apps') }}</p>
|
||||
<p :class="{ active: page == 'security' }" @mousedown="page = 'security'"><fa icon="unlock-alt" fixed-width/>{{ $t('security') }}</p>
|
||||
<p :class="{ active: page == 'hashtags' }" @mousedown="page = 'hashtags'"><fa icon="hashtag" fixed-width/>{{ $t('@._settings.tags') }}</p>
|
||||
<p :class="{ active: page == 'muteAndBlock' }" @mousedown="page = 'muteAndBlock'"><fa icon="ban" fixed-width/>{{ $t('@._settings.mute-and-block') }}</p>
|
||||
<p :class="{ active: page == 'apps' }" @mousedown="page = 'apps'"><fa icon="puzzle-piece" fixed-width/>{{ $t('@._settings.apps') }}</p>
|
||||
<p :class="{ active: page == 'security' }" @mousedown="page = 'security'"><fa icon="unlock-alt" fixed-width/>{{ $t('@._settings.security') }}</p>
|
||||
<p :class="{ active: page == 'api' }" @mousedown="page = 'api'"><fa icon="key" fixed-width/>API</p>
|
||||
<p :class="{ active: page == 'other' }" @mousedown="page = 'other'"><fa icon="cogs" fixed-width/>{{ $t('other') }}</p>
|
||||
<p :class="{ active: page == 'other' }" @mousedown="page = 'other'"><fa icon="cogs" fixed-width/>{{ $t('@._settings.other') }}</p>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="profile" v-show="page == 'profile'">
|
||||
<x-profile-editor/>
|
||||
<x-integration-settings/>
|
||||
</div>
|
||||
|
||||
<x-theme class="theme" v-show="page == 'theme'"/>
|
||||
|
||||
<ui-card class="web" v-show="page == 'web'">
|
||||
<template #title><fa icon="sliders-h"/> {{ $t('behaviour') }}</template>
|
||||
|
||||
<section>
|
||||
<ui-switch v-model="fetchOnScroll">{{ $t('fetch-on-scroll') }}
|
||||
<template #desc>{{ $t('fetch-on-scroll-desc') }}</template>
|
||||
</ui-switch>
|
||||
<ui-switch v-model="autoPopout">{{ $t('auto-popout') }}
|
||||
<template #desc>{{ $t('auto-popout-desc') }}</template>
|
||||
</ui-switch>
|
||||
<ui-switch v-model="keepCw">{{ $t('keep-cw') }}
|
||||
<template #desc>{{ $t('keep-cw-desc') }}</template>
|
||||
</ui-switch>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>{{ $t('timeline') }}</header>
|
||||
<ui-switch v-model="showMyRenotes">{{ $t('show-my-renotes') }}</ui-switch>
|
||||
<ui-switch v-model="showRenotedMyNotes">{{ $t('show-renoted-my-notes') }}</ui-switch>
|
||||
<ui-switch v-model="showLocalRenotes">{{ $t('show-local-renotes') }}</ui-switch>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>{{ $t('note-visibility') }}</header>
|
||||
<ui-switch v-model="rememberNoteVisibility">{{ $t('remember-note-visibility') }}</ui-switch>
|
||||
<section>
|
||||
<header>{{ $t('default-note-visibility') }}</header>
|
||||
<ui-select v-model="defaultNoteVisibility">
|
||||
<option value="public">{{ $t('@.note-visibility.public') }}</option>
|
||||
<option value="home">{{ $t('@.note-visibility.home') }}</option>
|
||||
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
||||
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
||||
<option value="local-public">{{ $t('@.note-visibility.local-public') }}</option>
|
||||
<option value="local-home">{{ $t('@.note-visibility.local-home') }}</option>
|
||||
<option value="local-followers">{{ $t('@.note-visibility.local-followers') }}</option>
|
||||
</ui-select>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>{{ $t('web-search-engine') }}</header>
|
||||
<ui-input v-model="webSearchEngine">{{ $t('web-search-engine') }}<template #desc>{{ $t('web-search-engine-desc') }}</template></ui-input>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="web" v-show="page == 'web'">
|
||||
<template #title><fa icon="desktop"/> {{ $t('display') }}</template>
|
||||
|
||||
<section>
|
||||
<ui-switch v-model="showPostFormOnTopOfTl">{{ $t('post-form-on-timeline') }}</ui-switch>
|
||||
<ui-button @click="customizeHome">{{ $t('@.customize-home') }}</ui-button>
|
||||
</section>
|
||||
<section>
|
||||
<header>{{ $t('wallpaper') }}</header>
|
||||
<ui-horizon-group class="fit-bottom">
|
||||
<ui-button @click="updateWallpaper">{{ $t('choose-wallpaper') }}</ui-button>
|
||||
<ui-button @click="deleteWallpaper">{{ $t('delete-wallpaper') }}</ui-button>
|
||||
</ui-horizon-group>
|
||||
</section>
|
||||
<section>
|
||||
<header>{{ $t('navbar-position') }}</header>
|
||||
<ui-radio v-model="navbar" value="top">{{ $t('navbar-position-top') }}</ui-radio>
|
||||
<ui-radio v-model="navbar" value="left">{{ $t('navbar-position-left') }}</ui-radio>
|
||||
<ui-radio v-model="navbar" value="right">{{ $t('navbar-position-right') }}</ui-radio>
|
||||
</section>
|
||||
<section>
|
||||
<ui-switch v-model="darkmode">{{ $t('@.dark-mode') }}</ui-switch>
|
||||
<ui-switch v-model="useShadow">{{ $t('@.use-shadow') }}</ui-switch>
|
||||
<ui-switch v-model="roundedCorners">{{ $t('@.rounded-corners') }}</ui-switch>
|
||||
<ui-switch v-model="circleIcons">{{ $t('@.circle-icons') }}</ui-switch>
|
||||
<section>
|
||||
<header>{{ $t('@.line-width') }}</header>
|
||||
<ui-radio v-model="lineWidth" :value="0.5">{{ $t('@.line-width-thin') }}</ui-radio>
|
||||
<ui-radio v-model="lineWidth" :value="1">{{ $t('@.line-width-normal') }}</ui-radio>
|
||||
<ui-radio v-model="lineWidth" :value="2">{{ $t('@.line-width-thick') }}</ui-radio>
|
||||
</section>
|
||||
<section>
|
||||
<header>{{ $t('@.font-size') }}</header>
|
||||
<ui-radio v-model="fontSize" :value="-2">{{ $t('@.font-size-x-small') }}</ui-radio>
|
||||
<ui-radio v-model="fontSize" :value="-1">{{ $t('@.font-size-small') }}</ui-radio>
|
||||
<ui-radio v-model="fontSize" :value="0">{{ $t('@.font-size-medium') }}</ui-radio>
|
||||
<ui-radio v-model="fontSize" :value="1">{{ $t('@.font-size-large') }}</ui-radio>
|
||||
<ui-radio v-model="fontSize" :value="2">{{ $t('@.font-size-x-large') }}</ui-radio>
|
||||
</section>
|
||||
<ui-switch v-model="reduceMotion">{{ $t('@.reduce-motion') }}</ui-switch>
|
||||
<ui-switch v-model="contrastedAcct">{{ $t('@.contrasted-acct') }}</ui-switch>
|
||||
<ui-switch v-model="showFullAcct">{{ $t('@.show-full-acct') }}</ui-switch>
|
||||
<ui-switch v-model="showVia">{{ $t('@.show-via') }}</ui-switch>
|
||||
<ui-switch v-model="useOsDefaultEmojis">{{ $t('@.use-os-default-emojis') }}</ui-switch>
|
||||
<ui-switch v-model="iLikeSushi">{{ $t('@.i-like-sushi') }}</ui-switch>
|
||||
</section>
|
||||
<section>
|
||||
<ui-switch v-model="suggestRecentHashtags">{{ $t('@.suggest-recent-hashtags') }}</ui-switch>
|
||||
<ui-switch v-model="showClockOnHeader">{{ $t('show-clock-on-header') }}</ui-switch>
|
||||
<ui-switch v-model="alwaysShowNsfw">{{ $t('@.always-show-nsfw') }}</ui-switch>
|
||||
<ui-switch v-model="showReplyTarget">{{ $t('show-reply-target') }}</ui-switch>
|
||||
<ui-switch v-model="showMaps">{{ $t('show-maps') }}</ui-switch>
|
||||
<ui-switch v-model="disableAnimatedMfm">{{ $t('@.disable-animated-mfm') }}</ui-switch>
|
||||
<ui-switch v-model="disableShowingAnimatedImages">{{ $t('@.disable-showing-animated-images') }}</ui-switch>
|
||||
<ui-switch v-model="remainDeletedNote">{{ $t('remain-deleted-note') }}</ui-switch>
|
||||
</section>
|
||||
<section>
|
||||
<header>{{ $t('@.deck-column-align') }}</header>
|
||||
<ui-radio v-model="deckColumnAlign" value="center">{{ $t('@.deck-column-align-center') }}</ui-radio>
|
||||
<ui-radio v-model="deckColumnAlign" value="left">{{ $t('@.deck-column-align-left') }}</ui-radio>
|
||||
<ui-radio v-model="deckColumnAlign" value="flexible">{{ $t('@.deck-column-align-flexible') }}</ui-radio>
|
||||
</section>
|
||||
<section>
|
||||
<header>{{ $t('@.deck-column-width') }}</header>
|
||||
<ui-radio v-model="deckColumnWidth" value="narrow">{{ $t('@.deck-column-width-narrow') }}</ui-radio>
|
||||
<ui-radio v-model="deckColumnWidth" value="narrower">{{ $t('@.deck-column-width-narrower') }}</ui-radio>
|
||||
<ui-radio v-model="deckColumnWidth" value="normal">{{ $t('@.deck-column-width-normal') }}</ui-radio>
|
||||
<ui-radio v-model="deckColumnWidth" value="wider">{{ $t('@.deck-column-width-wider') }}</ui-radio>
|
||||
<ui-radio v-model="deckColumnWidth" value="wide">{{ $t('@.deck-column-width-wide') }}</ui-radio>
|
||||
</section>
|
||||
<section>
|
||||
<ui-switch v-model="games_reversi_showBoardLabels">{{ $t('@.show-reversi-board-labels') }}</ui-switch>
|
||||
<ui-switch v-model="games_reversi_useAvatarStones">{{ $t('@.use-avatar-reversi-stones') }}</ui-switch>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="web" v-show="page == 'web'">
|
||||
<template #title><fa icon="volume-up"/> {{ $t('sound') }}</template>
|
||||
|
||||
<section>
|
||||
<ui-switch v-model="enableSounds">{{ $t('enable-sounds') }}
|
||||
<template #desc>{{ $t('enable-sounds-desc') }}</template>
|
||||
</ui-switch>
|
||||
<label>{{ $t('volume') }}</label>
|
||||
<input type="range"
|
||||
v-model="soundVolume"
|
||||
:disabled="!enableSounds"
|
||||
max="1"
|
||||
step="0.1"
|
||||
/>
|
||||
<ui-button @click="soundTest"><fa icon="volume-up"/> {{ $t('test') }}</ui-button>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<x-language-settings v-show="page == 'web'"/>
|
||||
|
||||
<ui-card class="web" v-show="page == 'web'">
|
||||
<template #title><fa :icon="['far', 'trash-alt']"/> {{ $t('cache') }}</template>
|
||||
<section>
|
||||
<ui-button @click="clean">{{ $t('clean-cache') }}</ui-button>
|
||||
<div class="none ui info warn">
|
||||
<p><fa icon="exclamation-triangle"/>{{ $t('cache-warn') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<x-notification-settings v-show="page == 'notification'"/>
|
||||
|
||||
<div class="drive" v-if="page == 'drive'">
|
||||
<x-drive-settings/>
|
||||
</div>
|
||||
|
||||
<ui-card class="hashtags" v-show="page == 'hashtags'">
|
||||
<template #title><fa icon="hashtag"/> {{ $t('tags') }}</template>
|
||||
<section>
|
||||
<x-tags/>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<div class="muteAndBlock" v-show="page == 'muteAndBlock'">
|
||||
<x-mute-and-block/>
|
||||
</div>
|
||||
|
||||
<ui-card class="apps" v-show="page == 'apps'">
|
||||
<template #title><fa icon="puzzle-piece"/> {{ $t('apps') }}</template>
|
||||
<section>
|
||||
<x-apps/>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="password" v-show="page == 'security'">
|
||||
<template #title><fa icon="unlock-alt"/> {{ $t('password') }}</template>
|
||||
<section>
|
||||
<x-password-settings/>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="2fa" v-show="page == 'security'">
|
||||
<template #title><fa icon="mobile-alt"/> {{ $t('@.2fa') }}</template>
|
||||
<section>
|
||||
<x-2fa/>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="signin" v-show="page == 'security'">
|
||||
<template #title><fa icon="sign-in-alt"/> {{ $t('signin') }}</template>
|
||||
<section>
|
||||
<x-signins/>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<div class="api" v-show="page == 'api'">
|
||||
<x-api-settings/>
|
||||
</div>
|
||||
|
||||
<ui-card class="other" v-show="page == 'other'">
|
||||
<template #title><fa icon="info-circle"/> {{ $t('about') }}</template>
|
||||
<section>
|
||||
<p v-if="meta">{{ $t('operator') }}: <i><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></i></p>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="other" v-show="page == 'other'">
|
||||
<template #title><fa icon="sync-alt"/> {{ $t('update') }}</template>
|
||||
<section>
|
||||
<p>
|
||||
<span>{{ $t('version') }} <i>{{ version }}</i></span>
|
||||
<template v-if="latestVersion !== undefined">
|
||||
<br>
|
||||
<span>{{ $t('latest-version') }} <i>{{ latestVersion ? latestVersion : version }}</i></span>
|
||||
</template>
|
||||
</p>
|
||||
<button class="ui button block" @click="checkForUpdate" :disabled="checkingForUpdate">
|
||||
<template v-if="checkingForUpdate">{{ $t('update-checking') }}<mk-ellipsis/></template>
|
||||
<template v-else>{{ $t('do-update') }}</template>
|
||||
</button>
|
||||
<details>
|
||||
<summary>{{ $t('update-settings') }}</summary>
|
||||
<ui-switch v-model="preventUpdate">
|
||||
{{ $t('prevent-update') }}<template #desc>{{ $t('prevent-update-desc') }}</template>
|
||||
</ui-switch>
|
||||
</details>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card class="other" v-show="page == 'other'">
|
||||
<template #title><fa icon="cogs"/> {{ $t('advanced-settings') }}</template>
|
||||
<section>
|
||||
<ui-switch v-model="debug">
|
||||
{{ $t('debug-mode') }}<template #desc>{{ $t('debug-mode-desc') }}</template>
|
||||
</ui-switch>
|
||||
<ui-switch v-model="enableExperimentalFeatures">
|
||||
{{ $t('experimental') }}<template #desc>{{ $t('experimental-desc') }}</template>
|
||||
</ui-switch>
|
||||
</section>
|
||||
</ui-card>
|
||||
<x-settings :page="page"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -269,39 +22,12 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../../i18n';
|
||||
import X2fa from './settings.2fa.vue';
|
||||
import XApps from './settings.apps.vue';
|
||||
import XSignins from './settings.signins.vue';
|
||||
import XTags from './settings.tags.vue';
|
||||
import XIntegrationSettings from '../../../common/views/components/integration-settings.vue';
|
||||
import XTheme from '../../../common/views/components/theme.vue';
|
||||
import XDriveSettings from '../../../common/views/components/drive-settings.vue';
|
||||
import XMuteAndBlock from '../../../common/views/components/mute-and-block.vue';
|
||||
import XPasswordSettings from '../../../common/views/components/password-settings.vue';
|
||||
import XProfileEditor from '../../../common/views/components/profile-editor.vue';
|
||||
import XApiSettings from '../../../common/views/components/api-settings.vue';
|
||||
import XLanguageSettings from '../../../common/views/components/language-settings.vue';
|
||||
import XNotificationSettings from '../../../common/views/components/notification-settings.vue';
|
||||
|
||||
import { url, version } from '../../../config';
|
||||
import checkForUpdate from '../../../common/scripts/check-for-update';
|
||||
import XSettings from '../../../common/views/components/settings/settings.vue';
|
||||
|
||||
export default Vue.extend({
|
||||
i18n: i18n('desktop/views/components/settings.vue'),
|
||||
i18n: i18n(),
|
||||
components: {
|
||||
X2fa,
|
||||
XApps,
|
||||
XSignins,
|
||||
XTags,
|
||||
XIntegrationSettings,
|
||||
XTheme,
|
||||
XDriveSettings,
|
||||
XMuteAndBlock,
|
||||
XPasswordSettings,
|
||||
XProfileEditor,
|
||||
XApiSettings,
|
||||
XLanguageSettings,
|
||||
XNotificationSettings,
|
||||
XSettings,
|
||||
},
|
||||
props: {
|
||||
initialPage: {
|
||||
|
|
@ -317,287 +43,8 @@ export default Vue.extend({
|
|||
data() {
|
||||
return {
|
||||
page: this.initialPage || 'profile',
|
||||
meta: null,
|
||||
version,
|
||||
latestVersion: undefined,
|
||||
checkingForUpdate: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
useOsDefaultEmojis: {
|
||||
get() { return this.$store.state.device.useOsDefaultEmojis; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'useOsDefaultEmojis', value }); }
|
||||
},
|
||||
|
||||
reduceMotion: {
|
||||
get() { return this.$store.state.device.reduceMotion; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'reduceMotion', value }); }
|
||||
},
|
||||
|
||||
autoPopout: {
|
||||
get() { return this.$store.state.device.autoPopout; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'autoPopout', value }); }
|
||||
},
|
||||
|
||||
keepCw: {
|
||||
get() { return this.$store.state.settings.keepCw; },
|
||||
set(value) { this.$store.commit('settings/set', { key: 'keepCw', value }); }
|
||||
},
|
||||
|
||||
darkmode: {
|
||||
get() { return this.$store.state.device.darkmode; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'darkmode', value }); }
|
||||
},
|
||||
|
||||
navbar: {
|
||||
get() { return this.$store.state.device.navbar; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'navbar', value }); }
|
||||
},
|
||||
|
||||
deckColumnAlign: {
|
||||
get() { return this.$store.state.device.deckColumnAlign; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'deckColumnAlign', value }); }
|
||||
},
|
||||
|
||||
deckColumnWidth: {
|
||||
get() { return this.$store.state.device.deckColumnWidth; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'deckColumnWidth', value }); }
|
||||
},
|
||||
|
||||
enableSounds: {
|
||||
get() { return this.$store.state.device.enableSounds; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'enableSounds', value }); }
|
||||
},
|
||||
|
||||
soundVolume: {
|
||||
get() { return this.$store.state.device.soundVolume; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'soundVolume', value }); }
|
||||
},
|
||||
|
||||
preventUpdate: {
|
||||
get() { return this.$store.state.device.preventUpdate; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'preventUpdate', value }); }
|
||||
},
|
||||
|
||||
debug: {
|
||||
get() { return this.$store.state.device.debug; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'debug', value }); }
|
||||
},
|
||||
|
||||
enableExperimentalFeatures: {
|
||||
get() { return this.$store.state.device.enableExperimentalFeatures; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'enableExperimentalFeatures', value }); }
|
||||
},
|
||||
|
||||
alwaysShowNsfw: {
|
||||
get() { return this.$store.state.device.alwaysShowNsfw; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'alwaysShowNsfw', value }); }
|
||||
},
|
||||
|
||||
useShadow: {
|
||||
get() { return this.$store.state.device.useShadow; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'useShadow', value }); }
|
||||
},
|
||||
|
||||
roundedCorners: {
|
||||
get() { return this.$store.state.device.roundedCorners; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'roundedCorners', value }); }
|
||||
},
|
||||
|
||||
lineWidth: {
|
||||
get() { return this.$store.state.device.lineWidth; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'lineWidth', value }); }
|
||||
},
|
||||
|
||||
fontSize: {
|
||||
get() { return this.$store.state.device.fontSize; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'fontSize', value }); }
|
||||
},
|
||||
|
||||
fetchOnScroll: {
|
||||
get() { return this.$store.state.settings.fetchOnScroll; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'fetchOnScroll', value }); }
|
||||
},
|
||||
|
||||
rememberNoteVisibility: {
|
||||
get() { return this.$store.state.settings.rememberNoteVisibility; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'rememberNoteVisibility', value }); }
|
||||
},
|
||||
|
||||
defaultNoteVisibility: {
|
||||
get() { return this.$store.state.settings.defaultNoteVisibility; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'defaultNoteVisibility', value }); }
|
||||
},
|
||||
|
||||
webSearchEngine: {
|
||||
get() { return this.$store.state.settings.webSearchEngine; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'webSearchEngine', value }); }
|
||||
},
|
||||
|
||||
showReplyTarget: {
|
||||
get() { return this.$store.state.settings.showReplyTarget; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showReplyTarget', value }); }
|
||||
},
|
||||
|
||||
showMyRenotes: {
|
||||
get() { return this.$store.state.settings.showMyRenotes; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showMyRenotes', value }); }
|
||||
},
|
||||
|
||||
showRenotedMyNotes: {
|
||||
get() { return this.$store.state.settings.showRenotedMyNotes; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showRenotedMyNotes', value }); }
|
||||
},
|
||||
|
||||
showLocalRenotes: {
|
||||
get() { return this.$store.state.settings.showLocalRenotes; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showLocalRenotes', value }); }
|
||||
},
|
||||
|
||||
showPostFormOnTopOfTl: {
|
||||
get() { return this.$store.state.settings.showPostFormOnTopOfTl; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showPostFormOnTopOfTl', value }); }
|
||||
},
|
||||
|
||||
suggestRecentHashtags: {
|
||||
get() { return this.$store.state.settings.suggestRecentHashtags; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'suggestRecentHashtags', value }); }
|
||||
},
|
||||
|
||||
showClockOnHeader: {
|
||||
get() { return this.$store.state.settings.showClockOnHeader; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showClockOnHeader', value }); }
|
||||
},
|
||||
|
||||
showMaps: {
|
||||
get() { return this.$store.state.settings.showMaps; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showMaps', value }); }
|
||||
},
|
||||
|
||||
circleIcons: {
|
||||
get() { return this.$store.state.settings.circleIcons; },
|
||||
set(value) {
|
||||
this.$store.dispatch('settings/set', { key: 'circleIcons', value });
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
|
||||
contrastedAcct: {
|
||||
get() { return this.$store.state.settings.contrastedAcct; },
|
||||
set(value) {
|
||||
this.$store.dispatch('settings/set', { key: 'contrastedAcct', value });
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
|
||||
showFullAcct: {
|
||||
get() { return this.$store.state.settings.showFullAcct; },
|
||||
set(value) {
|
||||
this.$store.dispatch('settings/set', { key: 'showFullAcct', value });
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
|
||||
showVia: {
|
||||
get() { return this.$store.state.settings.showVia; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'showVia', value }); }
|
||||
},
|
||||
|
||||
iLikeSushi: {
|
||||
get() { return this.$store.state.settings.iLikeSushi; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'iLikeSushi', value }); }
|
||||
},
|
||||
|
||||
games_reversi_showBoardLabels: {
|
||||
get() { return this.$store.state.settings.games.reversi.showBoardLabels; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'games.reversi.showBoardLabels', value }); }
|
||||
},
|
||||
|
||||
games_reversi_useAvatarStones: {
|
||||
get() { return this.$store.state.settings.games.reversi.useAvatarStones; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'games.reversi.useAvatarStones', value }); }
|
||||
},
|
||||
|
||||
disableAnimatedMfm: {
|
||||
get() { return this.$store.state.settings.disableAnimatedMfm; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'disableAnimatedMfm', value }); }
|
||||
},
|
||||
|
||||
disableShowingAnimatedImages: {
|
||||
get() { return this.$store.state.device.disableShowingAnimatedImages; },
|
||||
set(value) { this.$store.commit('device/set', { key: 'disableShowingAnimatedImages', value }); }
|
||||
},
|
||||
|
||||
remainDeletedNote: {
|
||||
get() { return this.$store.state.settings.remainDeletedNote; },
|
||||
set(value) { this.$store.dispatch('settings/set', { key: 'remainDeletedNote', value }); }
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$root.getMeta().then(meta => {
|
||||
this.meta = meta;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
reload() {
|
||||
this.$root.dialog({
|
||||
type: 'warning',
|
||||
text: this.$t('@.reload-to-apply-the-setting'),
|
||||
showCancelButton: true
|
||||
}).then(({ canceled }) => {
|
||||
if (!canceled) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
},
|
||||
customizeHome() {
|
||||
location.href = '/?customize';
|
||||
},
|
||||
updateWallpaper() {
|
||||
this.$chooseDriveFile({
|
||||
multiple: false
|
||||
}).then(file => {
|
||||
this.$root.api('i/update', {
|
||||
wallpaperId: file.id
|
||||
});
|
||||
});
|
||||
},
|
||||
deleteWallpaper() {
|
||||
this.$root.api('i/update', {
|
||||
wallpaperId: null
|
||||
});
|
||||
},
|
||||
checkForUpdate() {
|
||||
this.checkingForUpdate = true;
|
||||
checkForUpdate(this.$root, true, true).then(newer => {
|
||||
this.checkingForUpdate = false;
|
||||
this.latestVersion = newer;
|
||||
if (newer == null) {
|
||||
this.$root.dialog({
|
||||
title: this.$t('no-updates'),
|
||||
text: this.$t('no-updates-desc')
|
||||
});
|
||||
} else {
|
||||
this.$root.dialog({
|
||||
title: this.$t('update-available'),
|
||||
text: this.$t('update-available-desc')
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
clean() {
|
||||
localStorage.clear();
|
||||
this.$root.dialog({
|
||||
title: this.$t('cache-cleared'),
|
||||
text: this.$t('cache-cleared-desc')
|
||||
});
|
||||
},
|
||||
soundTest() {
|
||||
const sound = new Audio(`${url}/assets/message.mp3`);
|
||||
sound.volume = this.$store.state.device.soundVolume;
|
||||
sound.play();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -642,8 +89,4 @@ export default Vue.extend({
|
|||
overflow auto
|
||||
background var(--bg)
|
||||
|
||||
> section
|
||||
margin 32px
|
||||
color var(--text)
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<li>
|
||||
<router-link to="/i/favorites">
|
||||
<i><fa icon="star"/></i>
|
||||
<span>{{ $t('favorites') }}</span>
|
||||
<span>{{ $t('@.favorites') }}</span>
|
||||
<i><fa icon="angle-right"/></i>
|
||||
</router-link>
|
||||
</li>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<li>
|
||||
<router-link to="/i/settings">
|
||||
<i><fa icon="cog"/></i>
|
||||
<span>{{ $t('settings') }}</span>
|
||||
<span>{{ $t('@.settings') }}</span>
|
||||
<i><fa icon="angle-right"/></i>
|
||||
</router-link>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -89,12 +89,6 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
preventMount: false
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
isFlexible(): boolean {
|
||||
return this.height == 'auto';
|
||||
|
|
@ -105,21 +99,11 @@ export default Vue.extend({
|
|||
},
|
||||
|
||||
created() {
|
||||
if (this.$store.state.device.autoPopout && this.popoutUrl) {
|
||||
this.popout();
|
||||
this.preventMount = true;
|
||||
} else {
|
||||
// ウィンドウをウィンドウシステムに登録
|
||||
this.$root.os.windows.add(this);
|
||||
}
|
||||
// ウィンドウをウィンドウシステムに登録
|
||||
this.$root.os.windows.add(this);
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (this.preventMount) {
|
||||
this.destroyDom();
|
||||
return;
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
const main = this.$refs.main as any;
|
||||
main.style.top = '15%';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue