refactor(client):

This commit is contained in:
syuilo 2022-07-20 22:24:26 +09:00
parent 9a1f5afde9
commit 50e3ca19bc
92 changed files with 793 additions and 756 deletions

View file

@ -1,39 +1,39 @@
<template>
<div class="_formRoot">
<FormSection>
<template #label>{{ $ts.emailAddress }}</template>
<template #label>{{ i18n.ts.emailAddress }}</template>
<FormInput v-model="emailAddress" type="email" manual-save>
<template #prefix><i class="fas fa-envelope"></i></template>
<template v-if="$i.email && !$i.emailVerified" #caption>{{ $ts.verificationEmailSent }}</template>
<template v-else-if="emailAddress === $i.email && $i.emailVerified" #caption><i class="fas fa-check" style="color: var(--success);"></i> {{ $ts.emailVerified }}</template>
<template v-if="$i.email && !$i.emailVerified" #caption>{{ i18n.ts.verificationEmailSent }}</template>
<template v-else-if="emailAddress === $i.email && $i.emailVerified" #caption><i class="fas fa-check" style="color: var(--success);"></i> {{ i18n.ts.emailVerified }}</template>
</FormInput>
</FormSection>
<FormSection>
<FormSwitch :model-value="$i.receiveAnnouncementEmail" @update:modelValue="onChangeReceiveAnnouncementEmail">
{{ $ts.receiveAnnouncementFromInstance }}
{{ i18n.ts.receiveAnnouncementFromInstance }}
</FormSwitch>
</FormSection>
<FormSection>
<template #label>{{ $ts.emailNotification }}</template>
<template #label>{{ i18n.ts.emailNotification }}</template>
<FormSwitch v-model="emailNotification_mention" class="_formBlock">
{{ $ts._notification._types.mention }}
{{ i18n.ts._notification._types.mention }}
</FormSwitch>
<FormSwitch v-model="emailNotification_reply" class="_formBlock">
{{ $ts._notification._types.reply }}
{{ i18n.ts._notification._types.reply }}
</FormSwitch>
<FormSwitch v-model="emailNotification_quote" class="_formBlock">
{{ $ts._notification._types.quote }}
{{ i18n.ts._notification._types.quote }}
</FormSwitch>
<FormSwitch v-model="emailNotification_follow" class="_formBlock">
{{ $ts._notification._types.follow }}
{{ i18n.ts._notification._types.follow }}
</FormSwitch>
<FormSwitch v-model="emailNotification_receiveFollowRequest" class="_formBlock">
{{ $ts._notification._types.receiveFollowRequest }}
{{ i18n.ts._notification._types.receiveFollowRequest }}
</FormSwitch>
<FormSwitch v-model="emailNotification_groupInvited" class="_formBlock">
{{ $ts._notification._types.groupInvited }}
{{ i18n.ts._notification._types.groupInvited }}
</FormSwitch>
</FormSection>
</div>

View file

@ -1,69 +1,69 @@
<template>
<div class="_formRoot">
<FormSection>
<template #label>{{ $ts._exportOrImport.allNotes }}</template>
<template #label>{{ i18n.ts._exportOrImport.allNotes }}</template>
<FormFolder>
<template #label>{{ $ts.export }}</template>
<template #label>{{ i18n.ts.export }}</template>
<template #icon><i class="fas fa-download"></i></template>
<MkButton primary :class="$style.button" inline @click="exportNotes()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
<MkButton primary :class="$style.button" inline @click="exportNotes()"><i class="fas fa-download"></i> {{ i18n.ts.export }}</MkButton>
</FormFolder>
</FormSection>
<FormSection>
<template #label>{{ $ts._exportOrImport.followingList }}</template>
<template #label>{{ i18n.ts._exportOrImport.followingList }}</template>
<FormFolder class="_formBlock">
<template #label>{{ $ts.export }}</template>
<template #label>{{ i18n.ts.export }}</template>
<template #icon><i class="fas fa-download"></i></template>
<FormSwitch v-model="excludeMutingUsers" class="_formBlock">
{{ $ts._exportOrImport.excludeMutingUsers }}
{{ i18n.ts._exportOrImport.excludeMutingUsers }}
</FormSwitch>
<FormSwitch v-model="excludeInactiveUsers" class="_formBlock">
{{ $ts._exportOrImport.excludeInactiveUsers }}
{{ i18n.ts._exportOrImport.excludeInactiveUsers }}
</FormSwitch>
<MkButton primary :class="$style.button" inline @click="exportFollowing()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
<MkButton primary :class="$style.button" inline @click="exportFollowing()"><i class="fas fa-download"></i> {{ i18n.ts.export }}</MkButton>
</FormFolder>
<FormFolder class="_formBlock">
<template #label>{{ $ts.import }}</template>
<template #label>{{ i18n.ts.import }}</template>
<template #icon><i class="fas fa-upload"></i></template>
<MkButton primary :class="$style.button" inline @click="importFollowing($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
<MkButton primary :class="$style.button" inline @click="importFollowing($event)"><i class="fas fa-upload"></i> {{ i18n.ts.import }}</MkButton>
</FormFolder>
</FormSection>
<FormSection>
<template #label>{{ $ts._exportOrImport.userLists }}</template>
<template #label>{{ i18n.ts._exportOrImport.userLists }}</template>
<FormFolder class="_formBlock">
<template #label>{{ $ts.export }}</template>
<template #label>{{ i18n.ts.export }}</template>
<template #icon><i class="fas fa-download"></i></template>
<MkButton primary :class="$style.button" inline @click="exportUserLists()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
<MkButton primary :class="$style.button" inline @click="exportUserLists()"><i class="fas fa-download"></i> {{ i18n.ts.export }}</MkButton>
</FormFolder>
<FormFolder class="_formBlock">
<template #label>{{ $ts.import }}</template>
<template #label>{{ i18n.ts.import }}</template>
<template #icon><i class="fas fa-upload"></i></template>
<MkButton primary :class="$style.button" inline @click="importUserLists($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
<MkButton primary :class="$style.button" inline @click="importUserLists($event)"><i class="fas fa-upload"></i> {{ i18n.ts.import }}</MkButton>
</FormFolder>
</FormSection>
<FormSection>
<template #label>{{ $ts._exportOrImport.muteList }}</template>
<template #label>{{ i18n.ts._exportOrImport.muteList }}</template>
<FormFolder class="_formBlock">
<template #label>{{ $ts.export }}</template>
<template #label>{{ i18n.ts.export }}</template>
<template #icon><i class="fas fa-download"></i></template>
<MkButton primary :class="$style.button" inline @click="exportMuting()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
<MkButton primary :class="$style.button" inline @click="exportMuting()"><i class="fas fa-download"></i> {{ i18n.ts.export }}</MkButton>
</FormFolder>
<FormFolder class="_formBlock">
<template #label>{{ $ts.import }}</template>
<template #label>{{ i18n.ts.import }}</template>
<template #icon><i class="fas fa-upload"></i></template>
<MkButton primary :class="$style.button" inline @click="importMuting($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
<MkButton primary :class="$style.button" inline @click="importMuting($event)"><i class="fas fa-upload"></i> {{ i18n.ts.import }}</MkButton>
</FormFolder>
</FormSection>
<FormSection>
<template #label>{{ $ts._exportOrImport.blockingList }}</template>
<template #label>{{ i18n.ts._exportOrImport.blockingList }}</template>
<FormFolder class="_formBlock">
<template #label>{{ $ts.export }}</template>
<template #label>{{ i18n.ts.export }}</template>
<template #icon><i class="fas fa-download"></i></template>
<MkButton primary :class="$style.button" inline @click="exportBlocking()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
<MkButton primary :class="$style.button" inline @click="exportBlocking()"><i class="fas fa-download"></i> {{ i18n.ts.export }}</MkButton>
</FormFolder>
<FormFolder class="_formBlock">
<template #label>{{ $ts.import }}</template>
<template #label>{{ i18n.ts.import }}</template>
<template #icon><i class="fas fa-upload"></i></template>
<MkButton primary :class="$style.button" inline @click="importBlocking($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
<MkButton primary :class="$style.button" inline @click="importBlocking($event)"><i class="fas fa-upload"></i> {{ i18n.ts.import }}</MkButton>
</FormFolder>
</FormSection>
</div>

View file

@ -6,7 +6,7 @@
<div class="body">
<div v-if="!narrow || currentPage?.route.name == null" class="nav">
<div class="baaadecd">
<MkInfo v-if="emailNotConfigured" warn class="info">{{ $ts.emailNotConfiguredWarning }} <MkA to="/settings/email" class="_link">{{ $ts.configure }}</MkA></MkInfo>
<MkInfo v-if="emailNotConfigured" warn class="info">{{ i18n.ts.emailNotConfiguredWarning }} <MkA to="/settings/email" class="_link">{{ i18n.ts.configure }}</MkA></MkInfo>
<MkSuperMenu :def="menuDef" :grid="currentPage?.route.name == null"></MkSuperMenu>
</div>
</div>

View file

@ -1,12 +1,12 @@
<template>
<div class="_formRoot">
<MkTab v-model="tab" style="margin-bottom: var(--margin);">
<option value="mute">{{ $ts.mutedUsers }}</option>
<option value="block">{{ $ts.blockedUsers }}</option>
<option value="mute">{{ i18n.ts.mutedUsers }}</option>
<option value="block">{{ i18n.ts.blockedUsers }}</option>
</MkTab>
<div v-if="tab === 'mute'">
<MkPagination :pagination="mutingPagination" class="muting">
<template #empty><FormInfo>{{ $ts.noUsers }}</FormInfo></template>
<template #empty><FormInfo>{{ i18n.ts.noUsers }}</FormInfo></template>
<template #default="{items}">
<FormLink v-for="mute in items" :key="mute.id" :to="userPage(mute.mutee)">
<MkAcct :user="mute.mutee"/>
@ -16,7 +16,7 @@
</div>
<div v-if="tab === 'block'">
<MkPagination :pagination="blockingPagination" class="blocking">
<template #empty><FormInfo>{{ $ts.noUsers }}</FormInfo></template>
<template #empty><FormInfo>{{ i18n.ts.noUsers }}</FormInfo></template>
<template #default="{items}">
<FormLink v-for="block in items" :key="block.id" :to="userPage(block.blockee)">
<MkAcct :user="block.blockee"/>

View file

@ -1,54 +1,54 @@
<template>
<div class="_formRoot">
<FormSwitch v-model="isLocked" class="_formBlock" @update:modelValue="save()">{{ $ts.makeFollowManuallyApprove }}<template #caption>{{ $ts.lockedAccountInfo }}</template></FormSwitch>
<FormSwitch v-if="isLocked" v-model="autoAcceptFollowed" class="_formBlock" @update:modelValue="save()">{{ $ts.autoAcceptFollowed }}</FormSwitch>
<FormSwitch v-model="isLocked" class="_formBlock" @update:modelValue="save()">{{ i18n.ts.makeFollowManuallyApprove }}<template #caption>{{ i18n.ts.lockedAccountInfo }}</template></FormSwitch>
<FormSwitch v-if="isLocked" v-model="autoAcceptFollowed" class="_formBlock" @update:modelValue="save()">{{ i18n.ts.autoAcceptFollowed }}</FormSwitch>
<FormSwitch v-model="publicReactions" class="_formBlock" @update:modelValue="save()">
{{ $ts.makeReactionsPublic }}
<template #caption>{{ $ts.makeReactionsPublicDescription }}</template>
{{ i18n.ts.makeReactionsPublic }}
<template #caption>{{ i18n.ts.makeReactionsPublicDescription }}</template>
</FormSwitch>
<FormSelect v-model="ffVisibility" class="_formBlock" @update:modelValue="save()">
<template #label>{{ $ts.ffVisibility }}</template>
<option value="public">{{ $ts._ffVisibility.public }}</option>
<option value="followers">{{ $ts._ffVisibility.followers }}</option>
<option value="private">{{ $ts._ffVisibility.private }}</option>
<template #caption>{{ $ts.ffVisibilityDescription }}</template>
<template #label>{{ i18n.ts.ffVisibility }}</template>
<option value="public">{{ i18n.ts._ffVisibility.public }}</option>
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
<template #caption>{{ i18n.ts.ffVisibilityDescription }}</template>
</FormSelect>
<FormSwitch v-model="hideOnlineStatus" class="_formBlock" @update:modelValue="save()">
{{ $ts.hideOnlineStatus }}
<template #caption>{{ $ts.hideOnlineStatusDescription }}</template>
{{ i18n.ts.hideOnlineStatus }}
<template #caption>{{ i18n.ts.hideOnlineStatusDescription }}</template>
</FormSwitch>
<FormSwitch v-model="noCrawle" class="_formBlock" @update:modelValue="save()">
{{ $ts.noCrawle }}
<template #caption>{{ $ts.noCrawleDescription }}</template>
{{ i18n.ts.noCrawle }}
<template #caption>{{ i18n.ts.noCrawleDescription }}</template>
</FormSwitch>
<FormSwitch v-model="isExplorable" class="_formBlock" @update:modelValue="save()">
{{ $ts.makeExplorable }}
<template #caption>{{ $ts.makeExplorableDescription }}</template>
{{ i18n.ts.makeExplorable }}
<template #caption>{{ i18n.ts.makeExplorableDescription }}</template>
</FormSwitch>
<FormSection>
<FormSwitch v-model="rememberNoteVisibility" class="_formBlock" @update:modelValue="save()">{{ $ts.rememberNoteVisibility }}</FormSwitch>
<FormSwitch v-model="rememberNoteVisibility" class="_formBlock" @update:modelValue="save()">{{ i18n.ts.rememberNoteVisibility }}</FormSwitch>
<FormFolder v-if="!rememberNoteVisibility" class="_formBlock">
<template #label>{{ $ts.defaultNoteVisibility }}</template>
<template v-if="defaultNoteVisibility === 'public'" #suffix>{{ $ts._visibility.public }}</template>
<template v-else-if="defaultNoteVisibility === 'home'" #suffix>{{ $ts._visibility.home }}</template>
<template v-else-if="defaultNoteVisibility === 'followers'" #suffix>{{ $ts._visibility.followers }}</template>
<template v-else-if="defaultNoteVisibility === 'specified'" #suffix>{{ $ts._visibility.specified }}</template>
<template #label>{{ i18n.ts.defaultNoteVisibility }}</template>
<template v-if="defaultNoteVisibility === 'public'" #suffix>{{ i18n.ts._visibility.public }}</template>
<template v-else-if="defaultNoteVisibility === 'home'" #suffix>{{ i18n.ts._visibility.home }}</template>
<template v-else-if="defaultNoteVisibility === 'followers'" #suffix>{{ i18n.ts._visibility.followers }}</template>
<template v-else-if="defaultNoteVisibility === 'specified'" #suffix>{{ i18n.ts._visibility.specified }}</template>
<FormSelect v-model="defaultNoteVisibility" class="_formBlock">
<option value="public">{{ $ts._visibility.public }}</option>
<option value="home">{{ $ts._visibility.home }}</option>
<option value="followers">{{ $ts._visibility.followers }}</option>
<option value="specified">{{ $ts._visibility.specified }}</option>
<option value="public">{{ i18n.ts._visibility.public }}</option>
<option value="home">{{ i18n.ts._visibility.home }}</option>
<option value="followers">{{ i18n.ts._visibility.followers }}</option>
<option value="specified">{{ i18n.ts._visibility.specified }}</option>
</FormSelect>
<FormSwitch v-model="defaultNoteLocalOnly" class="_formBlock">{{ $ts._visibility.localOnly }}</FormSwitch>
<FormSwitch v-model="defaultNoteLocalOnly" class="_formBlock">{{ i18n.ts._visibility.localOnly }}</FormSwitch>
</FormFolder>
</FormSection>
<FormSwitch v-model="keepCw" class="_formBlock" @update:modelValue="save()">{{ $ts.keepCw }}</FormSwitch>
<FormSwitch v-model="keepCw" class="_formBlock" @update:modelValue="save()">{{ i18n.ts.keepCw }}</FormSwitch>
</div>
</template>

View file

@ -1,7 +1,7 @@
<template>
<div class="_formRoot">
<FromSlot class="_formBlock">
<template #label>{{ $ts.reactionSettingDescription }}</template>
<template #label>{{ i18n.ts.reactionSettingDescription }}</template>
<div v-panel style="border-radius: 6px;">
<XDraggable v-model="reactions" class="zoaiodol" :item-key="item => item" animation="150" delay="100" delay-on-touch-only="true">
<template #item="{element}">
@ -14,17 +14,17 @@
</template>
</XDraggable>
</div>
<template #caption>{{ $ts.reactionSettingDescription2 }} <button class="_textButton" @click="preview">{{ $ts.preview }}</button></template>
<template #caption>{{ i18n.ts.reactionSettingDescription2 }} <button class="_textButton" @click="preview">{{ i18n.ts.preview }}</button></template>
</FromSlot>
<FormRadios v-model="reactionPickerSize" class="_formBlock">
<template #label>{{ $ts.size }}</template>
<option :value="1">{{ $ts.small }}</option>
<option :value="2">{{ $ts.medium }}</option>
<option :value="3">{{ $ts.large }}</option>
<template #label>{{ i18n.ts.size }}</template>
<option :value="1">{{ i18n.ts.small }}</option>
<option :value="2">{{ i18n.ts.medium }}</option>
<option :value="3">{{ i18n.ts.large }}</option>
</FormRadios>
<FormRadios v-model="reactionPickerWidth" class="_formBlock">
<template #label>{{ $ts.numberOfColumn }}</template>
<template #label>{{ i18n.ts.numberOfColumn }}</template>
<option :value="1">5</option>
<option :value="2">6</option>
<option :value="3">7</option>
@ -32,22 +32,22 @@
<option :value="5">9</option>
</FormRadios>
<FormRadios v-model="reactionPickerHeight" class="_formBlock">
<template #label>{{ $ts.height }}</template>
<option :value="1">{{ $ts.small }}</option>
<option :value="2">{{ $ts.medium }}</option>
<option :value="3">{{ $ts.large }}</option>
<option :value="4">{{ $ts.large }}+</option>
<template #label>{{ i18n.ts.height }}</template>
<option :value="1">{{ i18n.ts.small }}</option>
<option :value="2">{{ i18n.ts.medium }}</option>
<option :value="3">{{ i18n.ts.large }}</option>
<option :value="4">{{ i18n.ts.large }}+</option>
</FormRadios>
<FormSwitch v-model="reactionPickerUseDrawerForMobile" class="_formBlock">
{{ $ts.useDrawerReactionPickerForMobile }}
<template #caption>{{ $ts.needReloadToApply }}</template>
{{ i18n.ts.useDrawerReactionPickerForMobile }}
<template #caption>{{ i18n.ts.needReloadToApply }}</template>
</FormSwitch>
<FormSection>
<div style="display: flex; gap: var(--margin); flex-wrap: wrap;">
<FormButton inline @click="preview"><i class="fas fa-eye"></i> {{ $ts.preview }}</FormButton>
<FormButton inline danger @click="setDefault"><i class="fas fa-undo"></i> {{ $ts.default }}</FormButton>
<FormButton inline @click="preview"><i class="fas fa-eye"></i> {{ i18n.ts.preview }}</FormButton>
<FormButton inline danger @click="setDefault"><i class="fas fa-undo"></i> {{ i18n.ts.default }}</FormButton>
</div>
</FormSection>
</div>

View file

@ -5,8 +5,8 @@
<div class="toggleWrapper">
<input id="dn" v-model="darkMode" type="checkbox" class="dn"/>
<label for="dn" class="toggle">
<span class="before">{{ $ts.light }}</span>
<span class="after">{{ $ts.dark }}</span>
<span class="before">{{ i18n.ts.light }}</span>
<span class="after">{{ i18n.ts.dark }}</span>
<span class="toggle__handler">
<span class="crater crater--1"></span>
<span class="crater crater--2"></span>
@ -22,28 +22,28 @@
</div>
</div>
<div class="sync">
<FormSwitch v-model="syncDeviceDarkMode">{{ $ts.syncDeviceDarkMode }}</FormSwitch>
<FormSwitch v-model="syncDeviceDarkMode">{{ i18n.ts.syncDeviceDarkMode }}</FormSwitch>
</div>
</div>
<div class="selects _formBlock">
<FormSelect v-model="lightThemeId" large class="select">
<template #label>{{ $ts.themeForLightMode }}</template>
<template #label>{{ i18n.ts.themeForLightMode }}</template>
<template #prefix><i class="fas fa-sun"></i></template>
<optgroup :label="$ts.lightThemes">
<optgroup :label="i18n.ts.lightThemes">
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
</optgroup>
<optgroup :label="$ts.darkThemes">
<optgroup :label="i18n.ts.darkThemes">
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
</optgroup>
</FormSelect>
<FormSelect v-model="darkThemeId" large class="select">
<template #label>{{ $ts.themeForDarkMode }}</template>
<template #label>{{ i18n.ts.themeForDarkMode }}</template>
<template #prefix><i class="fas fa-moon"></i></template>
<optgroup :label="$ts.darkThemes">
<optgroup :label="i18n.ts.darkThemes">
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
</optgroup>
<optgroup :label="$ts.lightThemes">
<optgroup :label="i18n.ts.lightThemes">
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
</optgroup>
</FormSelect>
@ -51,15 +51,15 @@
<FormSection>
<div class="_formLinksGrid">
<FormLink to="/settings/theme/manage"><template #icon><i class="fas fa-folder-open"></i></template>{{ $ts._theme.manage }}<template #suffix>{{ themesCount }}</template></FormLink>
<FormLink to="https://assets.misskey.io/theme/list" external><template #icon><i class="fas fa-globe"></i></template>{{ $ts._theme.explore }}</FormLink>
<FormLink to="/settings/theme/install"><template #icon><i class="fas fa-download"></i></template>{{ $ts._theme.install }}</FormLink>
<FormLink to="/theme-editor"><template #icon><i class="fas fa-paint-roller"></i></template>{{ $ts._theme.make }}</FormLink>
<FormLink to="/settings/theme/manage"><template #icon><i class="fas fa-folder-open"></i></template>{{ i18n.ts._theme.manage }}<template #suffix>{{ themesCount }}</template></FormLink>
<FormLink to="https://assets.misskey.io/theme/list" external><template #icon><i class="fas fa-globe"></i></template>{{ i18n.ts._theme.explore }}</FormLink>
<FormLink to="/settings/theme/install"><template #icon><i class="fas fa-download"></i></template>{{ i18n.ts._theme.install }}</FormLink>
<FormLink to="/theme-editor"><template #icon><i class="fas fa-paint-roller"></i></template>{{ i18n.ts._theme.make }}</FormLink>
</div>
</FormSection>
<FormButton v-if="wallpaper == null" class="_formBlock" @click="setWallpaper">{{ $ts.setWallpaper }}</FormButton>
<FormButton v-else class="_formBlock" @click="wallpaper = null">{{ $ts.removeWallpaper }}</FormButton>
<FormButton v-if="wallpaper == null" class="_formBlock" @click="setWallpaper">{{ i18n.ts.setWallpaper }}</FormButton>
<FormButton v-else class="_formBlock" @click="wallpaper = null">{{ i18n.ts.removeWallpaper }}</FormButton>
</div>
</template>