From eac71ae1d7f7d1ee4c06c4060979b7b292c0e57e Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 23 Apr 2022 19:17:15 +0900 Subject: fix: Fix settings page (#8508) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix settings page * nanka iroiro * clean up * clean up * インデックスに戻ってもタイトルが残ってしまうのを修正 --- packages/client/src/pages/settings/index.vue | 103 +++++++++++++++++---------- 1 file changed, 65 insertions(+), 38 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 44c3be62fe..e6670ea930 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -2,19 +2,22 @@
-
{{ $ts.settings }}
+
+ {{ $ts.settings }} + +
{{ childInfo.title }}
- - -- cgit v1.2.3-freya From 9230334a319c93d1604576778ed39c9de9d510ce Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 4 May 2022 05:25:19 +0200 Subject: Refactor settings/notifications to use Composition API (#8587) * refactor(client): refactor settings/notifications to use Composition API * fix(client): use async/await for API methods --- .../client/src/pages/settings/notifications.vue | 86 ++++++++++------------ 1 file changed, 37 insertions(+), 49 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/notifications.vue b/packages/client/src/pages/settings/notifications.vue index 334216ff33..6fe2ac55a4 100644 --- a/packages/client/src/pages/settings/notifications.vue +++ b/packages/client/src/pages/settings/notifications.vue @@ -1,71 +1,59 @@ -- cgit v1.2.3-freya From d075ead80a7bbec84de2129b6579b9410e0b1154 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 5 May 2022 11:21:38 +0200 Subject: fix(client): fix duplicate token request dialog in plugin install (#8612) --- .../client/src/pages/settings/plugin.install.vue | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/plugin.install.vue b/packages/client/src/pages/settings/plugin.install.vue index 5cf427d18f..6ece531462 100644 --- a/packages/client/src/pages/settings/plugin.install.vue +++ b/packages/client/src/pages/settings/plugin.install.vue @@ -79,7 +79,7 @@ async function install() { } const token = permissions == null || permissions.length === 0 ? null : await new Promise((res, rej) => { - os.popup(import('@/components/token-generate-window.vue'), { + os.popup(defineAsyncComponent(() => import('@/components/token-generate-window.vue')), { title: i18n.ts.tokenRequested, information: i18n.ts.pluginTokenRequestedDescription, initialName: name, @@ -92,7 +92,6 @@ async function install() { name: name, permission: permissions, }); - res(token); } }, 'closed'); @@ -109,25 +108,6 @@ async function install() { os.success(); - const token = permissions == null || permissions.length === 0 ? null : await new Promise((res, rej) => { - os.popup(defineAsyncComponent(() => import('@/components/token-generate-window.vue')), { - title: i18n.ts.tokenRequested, - information: i18n.ts.pluginTokenRequestedDescription, - initialName: name, - initialPermissions: permissions - }, { - done: async result => { - const { name, permissions } = result; - const { token } = await os.api('miauth/gen-token', { - session: null, - name: name, - permission: permissions, - }); - res(token); - } - }, 'closed'); - }); - nextTick(() => { unisonReload(); }); -- cgit v1.2.3-freya From bd620a8c7782d485d4385cc95af744edef5986c9 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 5 May 2022 15:41:10 +0200 Subject: refactor(client): refactor 2FA settings to Composition API (#8599) --- packages/client/src/pages/settings/2fa.vue | 317 ++++++++++++++--------------- 1 file changed, 153 insertions(+), 164 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/2fa.vue b/packages/client/src/pages/settings/2fa.vue index 10599d99ff..9ebf5101cd 100644 --- a/packages/client/src/pages/settings/2fa.vue +++ b/packages/client/src/pages/settings/2fa.vue @@ -1,49 +1,49 @@ -
  • {{ $ts._2fa.step2 }}
  • -
  • {{ $ts._2fa.step3 }}
    - - {{ $ts.done }} +
  • {{ i18n.ts._2fa.step2 }}
  • +
  • {{ i18n.ts._2fa.step3 }}
    + + {{ i18n.ts.done }}
  • - {{ $ts._2fa.step4 }} + {{ i18n.ts._2fa.step4 }}
    - -- cgit v1.2.3-freya From a6c138600f46aacdb8d9aecb17c6821ff1ce784a Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 5 May 2022 15:51:05 +0200 Subject: Refactor settings/sounds to use Composition API (#8594) * refactor(client): refactor settings/sounds to use Composition API * Apply review suggestion from @Johann150 Co-authored-by: Johann150 * chore(client): remove old sound reference Co-authored-by: Johann150 --- packages/client/src/pages/settings/sounds.vue | 162 ++++++++++++-------------- 1 file changed, 74 insertions(+), 88 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/sounds.vue b/packages/client/src/pages/settings/sounds.vue index 490a1b5514..d01e87c1f8 100644 --- a/packages/client/src/pages/settings/sounds.vue +++ b/packages/client/src/pages/settings/sounds.vue @@ -1,24 +1,24 @@ - -- cgit v1.2.3-freya From e5a8773bfeaf06a0085fbf8c44524637213acb94 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 5 May 2022 15:51:29 +0200 Subject: refactor(client): refactor settings/deck to use Composition API (#8598) --- packages/client/src/pages/settings/deck.vue | 106 ++++++++++++---------------- 1 file changed, 44 insertions(+), 62 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/deck.vue b/packages/client/src/pages/settings/deck.vue index 46b90d3d1a..2d868aa0a7 100644 --- a/packages/client/src/pages/settings/deck.vue +++ b/packages/client/src/pages/settings/deck.vue @@ -1,36 +1,36 @@ - -- cgit v1.2.3-freya From f3628946af19ac84ce500dccdb04e58b36f85cea Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 5 May 2022 15:51:58 +0200 Subject: refactor(client): refactor settings/word-mute to use Composition API (#8597) --- packages/client/src/pages/settings/word-mute.vue | 190 ++++++++++------------- 1 file changed, 83 insertions(+), 107 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/word-mute.vue b/packages/client/src/pages/settings/word-mute.vue index c11707b6cf..97a15da5b5 100644 --- a/packages/client/src/pages/settings/word-mute.vue +++ b/packages/client/src/pages/settings/word-mute.vue @@ -1,35 +1,35 @@ - -- cgit v1.2.3-freya From 3ea351d8a2f50f68dc695317062ba7f471ad7542 Mon Sep 17 00:00:00 2001 From: futchitwo <74236683+futchitwo@users.noreply.github.com> Date: Thu, 5 May 2022 22:52:33 +0900 Subject: Enhance(MFM): Allow speed changes in all animated MFMs (#8551) * MFM: Allow speed changes in all animated MFMs * Feature(MFM): Add speed property to cheat sheet * Use template literal Oops! * Remove unnecessary template string Co-authored-by: Johann150 Co-authored-by: Johann150 --- packages/client/src/components/mfm.ts | 12 ++++++++---- packages/client/src/pages/mfm-cheat-sheet.vue | 16 ++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index 37076652fd..6ac410762d 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -91,7 +91,8 @@ export default defineComponent({ let style; switch (token.props.name) { case 'tada': { - style = `font-size: 150%;` + (this.$store.state.animatedMfm ? 'animation: tada 1s linear infinite both;' : ''); + const speed = validTime(token.props.args.speed) || '1s'; + style = 'font-size: 150%;' + (this.$store.state.animatedMfm ? `animation: tada ${speed} linear infinite both;` : ''); break; } case 'jelly': { @@ -123,11 +124,13 @@ export default defineComponent({ break; } case 'jump': { - style = this.$store.state.animatedMfm ? 'animation: mfm-jump 0.75s linear infinite;' : ''; + const speed = validTime(token.props.args.speed) || '0.75s'; + style = this.$store.state.animatedMfm ? `animation: mfm-jump ${speed} linear infinite;` : ''; break; } case 'bounce': { - style = this.$store.state.animatedMfm ? 'animation: mfm-bounce 0.75s linear infinite; transform-origin: center bottom;' : ''; + const speed = validTime(token.props.args.speed) || '0.75s'; + style = this.$store.state.animatedMfm ? `animation: mfm-bounce ${speed} linear infinite; transform-origin: center bottom;` : ''; break; } case 'flip': { @@ -168,7 +171,8 @@ export default defineComponent({ }, genEl(token.children)); } case 'rainbow': { - style = this.$store.state.animatedMfm ? 'animation: mfm-rainbow 1s linear infinite;' : ''; + const speed = validTime(token.props.args.speed) || '1s'; + style = this.$store.state.animatedMfm ? `animation: mfm-rainbow ${speed} linear infinite;` : ''; break; } case 'sparkle': { diff --git a/packages/client/src/pages/mfm-cheat-sheet.vue b/packages/client/src/pages/mfm-cheat-sheet.vue index 83ae5741c3..aa35ec2158 100644 --- a/packages/client/src/pages/mfm-cheat-sheet.vue +++ b/packages/client/src/pages/mfm-cheat-sheet.vue @@ -325,20 +325,20 @@ export default defineComponent({ preview_inlineMath: '\\(x= \\frac{-b\' \\pm \\sqrt{(b\')^2-ac}}{a}\\)', preview_quote: `> ${this.$ts._mfm.dummy}`, preview_search: `${this.$ts._mfm.dummy} 検索`, - preview_jelly: `$[jelly 🍮]`, - preview_tada: `$[tada 🍮]`, - preview_jump: `$[jump 🍮]`, - preview_bounce: `$[bounce 🍮]`, - preview_shake: `$[shake 🍮]`, - preview_twitch: `$[twitch 🍮]`, - preview_spin: `$[spin 🍮] $[spin.left 🍮] $[spin.alternate 🍮]\n$[spin.x 🍮] $[spin.x,left 🍮] $[spin.x,alternate 🍮]\n$[spin.y 🍮] $[spin.y,left 🍮] $[spin.y,alternate 🍮]`, + preview_jelly: `$[jelly 🍮] $[jelly.speed=5s 🍮]`, + preview_tada: `$[tada 🍮] $[tada.speed=5s 🍮]`, + preview_jump: `$[jump 🍮] $[jump.speed=5s 🍮]`, + preview_bounce: `$[bounce 🍮] $[bounce.speed=5s 🍮]`, + preview_shake: `$[shake 🍮] $[shake.speed=5s 🍮]`, + preview_twitch: `$[twitch 🍮] $[twitch.speed=5s 🍮]`, + preview_spin: `$[spin 🍮] $[spin.left 🍮] $[spin.alternate 🍮]\n$[spin.x 🍮] $[spin.x,left 🍮] $[spin.x,alternate 🍮]\n$[spin.y 🍮] $[spin.y,left 🍮] $[spin.y,alternate 🍮]\n\n$[spin.speed=5s 🍮]`, preview_flip: `$[flip ${this.$ts._mfm.dummy}]\n$[flip.v ${this.$ts._mfm.dummy}]\n$[flip.h,v ${this.$ts._mfm.dummy}]`, preview_font: `$[font.serif ${this.$ts._mfm.dummy}]\n$[font.monospace ${this.$ts._mfm.dummy}]\n$[font.cursive ${this.$ts._mfm.dummy}]\n$[font.fantasy ${this.$ts._mfm.dummy}]`, preview_x2: `$[x2 🍮]`, preview_x3: `$[x3 🍮]`, preview_x4: `$[x4 🍮]`, preview_blur: `$[blur ${this.$ts._mfm.dummy}]`, - preview_rainbow: `$[rainbow 🍮]`, + preview_rainbow: `$[rainbow 🍮] $[rainbow.speed=5s 🍮]`, preview_sparkle: `$[sparkle 🍮]`, preview_rotate: `$[rotate 🍮]`, } -- cgit v1.2.3-freya From ad860905c6043c4dfabed8b2c43029cb215a1741 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 5 May 2022 15:53:08 +0200 Subject: refactor(client): refactor settings/theme/manage to use Composition API (#8596) --- .../client/src/pages/settings/theme.manage.vue | 95 +++++++++------------- 1 file changed, 38 insertions(+), 57 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/theme.manage.vue b/packages/client/src/pages/settings/theme.manage.vue index 2eb16bb701..7da439f9c0 100644 --- a/packages/client/src/pages/settings/theme.manage.vue +++ b/packages/client/src/pages/settings/theme.manage.vue @@ -1,32 +1,32 @@ - -- cgit v1.2.3-freya From 9fc5e8688f99545086e9226cf3179486efd9255e Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 12 May 2022 19:31:26 +0200 Subject: fix(client): add setup attribute to notification page (#8648) --- packages/client/src/pages/settings/notifications.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/settings/notifications.vue b/packages/client/src/pages/settings/notifications.vue index 6fe2ac55a4..b8fff95a8d 100644 --- a/packages/client/src/pages/settings/notifications.vue +++ b/packages/client/src/pages/settings/notifications.vue @@ -9,7 +9,7 @@ - -- cgit v1.2.3-freya From 9f07bd8f46ce325ac422e2562eb7be603f2910c5 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 14 May 2022 14:34:07 +0200 Subject: refactor(client): refactor admin/announcements to use Composition API (#8650) --- packages/client/src/pages/admin/announcements.vue | 148 ++++++++++------------ 1 file changed, 67 insertions(+), 81 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/admin/announcements.vue b/packages/client/src/pages/admin/announcements.vue index a0d720bb29..97774975de 100644 --- a/packages/client/src/pages/admin/announcements.vue +++ b/packages/client/src/pages/admin/announcements.vue @@ -3,112 +3,98 @@
    - + - + - + -

    {{ $t('nUsersRead', { n: announcement.reads }) }}

    +

    {{ i18n.t('nUsersRead', { n: announcement.reads }) }}

    - {{ $ts.save }} - {{ $ts.remove }} + {{ i18n.ts.save }} + {{ i18n.ts.remove }}
    - -- cgit v1.2.3-freya From 5de77405ea8a4d325eb036134880ba1272be26de Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 14 May 2022 14:34:50 +0200 Subject: Refactor admin/security to use Composition API (#8652) * refactor(client): refactor admin/security to use Composition API * Apply review suggestions from @Johann150 Co-authored-by: Johann150 Co-authored-by: Johann150 --- packages/client/src/pages/admin/bot-protection.vue | 89 ++++++++-------------- packages/client/src/pages/admin/security.vue | 71 +++++++---------- 2 files changed, 59 insertions(+), 101 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/admin/bot-protection.vue b/packages/client/src/pages/admin/bot-protection.vue index 5e0cdd96a5..4675b2bc08 100644 --- a/packages/client/src/pages/admin/bot-protection.vue +++ b/packages/client/src/pages/admin/bot-protection.vue @@ -43,8 +43,8 @@ - diff --git a/packages/client/src/pages/admin/security.vue b/packages/client/src/pages/admin/security.vue index d1c979b3e0..6b8f70cca5 100644 --- a/packages/client/src/pages/admin/security.vue +++ b/packages/client/src/pages/admin/security.vue @@ -4,10 +4,10 @@
    - + - + @@ -21,7 +21,7 @@ - {{ $ts.save }} + {{ i18n.ts.save }}
    @@ -29,8 +29,8 @@
    - -- cgit v1.2.3-freya From 577f63c4f4d56b7d6fda6ca042821e7a0667d521 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 14 May 2022 14:35:08 +0200 Subject: Refactor admin/database to use Composition API (#8654) * refactor(client): refactor admin/database to use Composition API * Apply review suggestion from @Johann150 Co-authored-by: Johann150 Co-authored-by: Johann150 --- packages/client/src/pages/admin/database.vue | 31 ++++++++-------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/admin/database.vue b/packages/client/src/pages/admin/database.vue index 3a835eeafa..d3519922b1 100644 --- a/packages/client/src/pages/admin/database.vue +++ b/packages/client/src/pages/admin/database.vue @@ -9,36 +9,23 @@ - -- cgit v1.2.3-freya From 3f9b7e8b1d7a430abd3858b8e976c86eb9a6301b Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 14 May 2022 14:36:12 +0200 Subject: Refactor admin/email-settings to use Composition API (#8656) * refactor(client): refactor admin/email-settings to use Composition API * Update packages/client/src/pages/admin/email-settings.vue Co-authored-by: Johann150 Co-authored-by: syuilo Co-authored-by: Johann150 --- packages/client/src/pages/admin/email-settings.vue | 161 ++++++++++----------- 1 file changed, 73 insertions(+), 88 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/admin/email-settings.vue b/packages/client/src/pages/admin/email-settings.vue index 7df0b6db1c..aa13043193 100644 --- a/packages/client/src/pages/admin/email-settings.vue +++ b/packages/client/src/pages/admin/email-settings.vue @@ -3,37 +3,37 @@
    - - + + @@ -42,8 +42,8 @@ - -- cgit v1.2.3-freya From 657dc1599596f39a254fe6b37a2c4c631282409b Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 14 May 2022 16:24:45 +0200 Subject: fix(client): remove unexpected token (#8672) --- packages/client/src/pages/admin/bot-protection.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/pages/admin/bot-protection.vue b/packages/client/src/pages/admin/bot-protection.vue index 4675b2bc08..30fee5015a 100644 --- a/packages/client/src/pages/admin/bot-protection.vue +++ b/packages/client/src/pages/admin/bot-protection.vue @@ -56,7 +56,7 @@ import { fetchInstance } from '@/instance'; const MkCaptcha = defineAsyncComponent(() => import('@/components/captcha.vue')); -let provider: = $ref(null); +let provider = $ref(null); let hcaptchaSiteKey: string | null = $ref(null); let hcaptchaSecretKey: string | null = $ref(null); let recaptchaSiteKey: string | null = $ref(null); -- cgit v1.2.3-freya From d62a55b46f7308ed04971cbfba5572b0d0feea97 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 15 May 2022 15:20:01 +0200 Subject: Refactor emoji-edit-dialog to use Composition API (#8657) * refactor(client): refactor emoji-edit-dialog to use Composition API * fix(client): fix editing emoji not updating emoji list * Apply review suggestions from @Johann150 Co-authored-by: Johann150 * fix(client): use cached category info instead of making a request * fix(client): use updateItem in emoji pagination when editing * fix(client): reimplement removeItem in MkPagination * Apply review suggestion from @Johann150 Co-authored-by: Johann150 Co-authored-by: Johann150 --- packages/client/src/components/ui/pagination.vue | 6 ++ .../client/src/pages/admin/emoji-edit-dialog.vue | 116 +++++++++------------ packages/client/src/pages/admin/emojis.vue | 8 +- 3 files changed, 61 insertions(+), 69 deletions(-) (limited to 'packages/client/src/pages') diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue index ac6f59c332..9dd18785bc 100644 --- a/packages/client/src/components/ui/pagination.vue +++ b/packages/client/src/components/ui/pagination.vue @@ -244,6 +244,11 @@ const append = (item: Item): void => { items.value.push(item); }; +const removeItem = (finder: (item: Item) => boolean) => { + const i = items.value.findIndex(finder); + items.value.splice(i, 1); +}; + const updateItem = (id: Item['id'], replacer: (old: Item) => Item): void => { const i = items.value.findIndex(item => item.id === id); items.value[i] = replacer(items.value[i]); @@ -276,6 +281,7 @@ defineExpose({ fetchMoreAhead, prepend, append, + removeItem, updateItem, }); diff --git a/packages/client/src/pages/admin/emoji-edit-dialog.vue b/packages/client/src/pages/admin/emoji-edit-dialog.vue index 2e3903426e..d482fa49e6 100644 --- a/packages/client/src/pages/admin/emoji-edit-dialog.vue +++ b/packages/client/src/pages/admin/emoji-edit-dialog.vue @@ -27,85 +27,71 @@ - diff --git a/packages/client/src/components/ui/modal-window.vue b/packages/client/src/components/ui/modal-window.vue index 6de29c83fa..d2b2ccff7a 100644 --- a/packages/client/src/components/ui/modal-window.vue +++ b/packages/client/src/components/ui/modal-window.vue @@ -1,7 +1,7 @@ - diff --git a/packages/client/src/components/ui/modal.vue b/packages/client/src/components/ui/modal.vue index 010262da2f..d6a29ec4b7 100644 --- a/packages/client/src/components/ui/modal.vue +++ b/packages/client/src/components/ui/modal.vue @@ -1,5 +1,5 @@