From 22bf57d79443f046bc881feb91e443ed5254b398 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 25 Nov 2020 21:31:34 +0900 Subject: [PATCH] nanka iroiro (#6853) * wip * Update maps.ts * wip * wip * wip * wip * Update base.vue * wip * wip * wip * wip * Update link.vue * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update privacy.vue * wip * wip * wip * wip * Update range.vue * wip * wip * wip * wip * Update profile.vue * wip * Update a.vue * Update index.vue * wip * Update sidebar.vue * wip * wip * Update account-info.vue * Update a.vue * wip * wip * Update sounds.vue * wip * wip * wip * wip * wip * wip * wip * wip * Update account-info.vue * Update account-info.vue * wip * wip * wip * Update d-persimmon.json5 * wip --- locales/ja-JP.yml | 51 +- .../1605585339718-instance-pinned-pages.ts | 2 +- migration/1605965516823-instance-images.ts | 16 + migration/1606191203881-no-crawle.ts | 16 + src/client/assets/sounds/syuilo/kick.mp3 | 3 + src/client/assets/sounds/syuilo/snare.mp3 | 3 + src/client/cold-storage.ts | 34 + src/client/components/form-dialog.vue | 63 +- src/client/components/form/base.vue | 56 ++ src/client/components/form/button.vue | 81 +++ src/client/components/form/form.scss | 34 + src/client/components/form/group.vue | 42 ++ src/client/components/form/input.vue | 306 +++++++++ src/client/components/form/key-value-view.vue | 30 + src/client/components/form/link.vue | 90 +++ src/client/components/form/pagination.vue | 42 ++ src/client/components/form/radios.vue | 106 ++++ src/client/components/form/range.vue | 122 ++++ src/client/components/form/select.vue | 147 +++++ src/client/components/form/switch.vue | 132 ++++ src/client/components/form/textarea.vue | 136 ++++ src/client/components/form/tuple.vue | 36 ++ src/client/components/media-image.vue | 2 +- src/client/components/media-video.vue | 2 +- .../components/taskmanager.api-window.vue | 5 +- src/client/components/taskmanager.vue | 3 +- src/client/components/timeline.vue | 3 +- src/client/components/ui/range.vue | 4 +- src/client/components/ui/switch.vue | 6 +- src/client/components/ui/textarea.vue | 3 +- src/client/init.ts | 11 +- src/client/os.ts | 10 +- src/client/pages/announcements.vue | 2 +- src/client/pages/instance/settings.vue | 8 + src/client/pages/messaging/messaging-room.vue | 3 +- src/client/pages/reversi/game.board.vue | 13 +- .../settings/{security.2fa.vue => 2fa.vue} | 13 + src/client/pages/settings/account-info.vue | 185 ++++++ src/client/pages/settings/api.vue | 27 +- src/client/pages/{ => settings}/apps.vue | 60 +- src/client/pages/settings/deck.vue | 90 +++ src/client/pages/settings/email-address.vue | 71 +++ src/client/pages/settings/email.vue | 52 ++ src/client/pages/settings/general.vue | 211 +++---- src/client/pages/settings/index.vue | 149 ++--- src/client/pages/settings/notifications.vue | 30 +- src/client/pages/settings/other.vue | 53 +- src/client/pages/settings/privacy.vue | 56 +- src/client/pages/settings/profile.vue | 240 +++++--- src/client/pages/settings/reaction.vue | 69 +-- src/client/pages/settings/security.vue | 85 ++- src/client/pages/settings/sidebar.vue | 56 +- src/client/pages/settings/sounds.vue | 208 +++---- src/client/pages/settings/theme.install.vue | 106 ++++ src/client/pages/settings/theme.manage.vue | 103 ++++ src/client/pages/settings/theme.vue | 581 ++++++++---------- src/client/pages/settings/word-mute.vue | 48 +- src/client/pages/user/follow-list.vue | 2 +- src/client/pages/user/index.activity.vue | 18 +- src/client/pages/user/index.photos.vue | 42 +- src/client/pages/user/index.vue | 570 ++++++++--------- src/client/pages/welcome.entrance.vue | 28 - src/client/router.ts | 3 +- src/client/scripts/sound.ts | 24 + src/client/scripts/theme.ts | 13 +- src/client/store.ts | 10 +- src/client/style.scss | 6 +- src/client/themes/_dark.json5 | 1 + src/client/themes/_light.json5 | 1 + src/client/themes/d-battery-saver.json5 | 18 - src/client/themes/d-black.json5 | 24 +- src/client/themes/d-blue.json5 | 29 - .../themes/{d-red.json5 => d-dark.json5} | 14 +- src/client/themes/d-green.json5 | 29 - src/client/themes/d-persimmon.json5 | 12 +- src/client/themes/l-apricot.json5 | 2 +- src/client/themes/l-blue.json5 | 21 - src/client/themes/l-green.json5 | 21 - .../themes/{l-white.json5 => l-light.json5} | 2 +- src/client/themes/l-red.json5 | 21 - src/client/ui/_common_/common.vue | 5 +- src/client/ui/visitor.vue | 202 +----- src/client/ui/visitor/a.vue | 357 +++++++++++ src/client/ui/visitor/b.vue | 372 +++++++++++ src/client/widgets/digital-clock.vue | 3 +- src/games/reversi/maps.ts | 16 + src/models/entities/meta.ts | 14 +- src/models/entities/note-reaction.ts | 2 + src/models/entities/user-profile.ts | 6 + src/models/repositories/drive-file.ts | 8 +- src/models/repositories/user.ts | 1 + src/server/api/endpoints/admin/update-meta.ts | 16 + src/server/api/endpoints/drive.ts | 2 +- src/server/api/endpoints/i/update.ts | 8 + src/server/api/endpoints/meta.ts | 2 + src/server/api/endpoints/users/stats.ts | 144 +++++ src/server/index.ts | 10 +- src/server/web/index.ts | 6 + src/server/web/views/clip.pug | 3 + src/server/web/views/note.pug | 6 +- src/server/web/views/page.pug | 3 + src/server/web/views/user.pug | 6 +- src/services/chart/charts/classes/drive.ts | 4 +- src/services/chart/charts/classes/instance.ts | 2 +- .../chart/charts/classes/per-user-drive.ts | 2 +- src/services/drive/add-file.ts | 2 +- 106 files changed, 4495 insertions(+), 1734 deletions(-) create mode 100644 migration/1605965516823-instance-images.ts create mode 100644 migration/1606191203881-no-crawle.ts create mode 100644 src/client/assets/sounds/syuilo/kick.mp3 create mode 100644 src/client/assets/sounds/syuilo/snare.mp3 create mode 100644 src/client/cold-storage.ts create mode 100644 src/client/components/form/base.vue create mode 100644 src/client/components/form/button.vue create mode 100644 src/client/components/form/form.scss create mode 100644 src/client/components/form/group.vue create mode 100644 src/client/components/form/input.vue create mode 100644 src/client/components/form/key-value-view.vue create mode 100644 src/client/components/form/link.vue create mode 100644 src/client/components/form/pagination.vue create mode 100644 src/client/components/form/radios.vue create mode 100644 src/client/components/form/range.vue create mode 100644 src/client/components/form/select.vue create mode 100644 src/client/components/form/switch.vue create mode 100644 src/client/components/form/textarea.vue create mode 100644 src/client/components/form/tuple.vue rename src/client/pages/settings/{security.2fa.vue => 2fa.vue} (96%) create mode 100644 src/client/pages/settings/account-info.vue rename src/client/pages/{ => settings}/apps.vue (63%) create mode 100644 src/client/pages/settings/deck.vue create mode 100644 src/client/pages/settings/email-address.vue create mode 100644 src/client/pages/settings/email.vue create mode 100644 src/client/pages/settings/theme.install.vue create mode 100644 src/client/pages/settings/theme.manage.vue create mode 100644 src/client/scripts/sound.ts delete mode 100644 src/client/themes/d-battery-saver.json5 delete mode 100644 src/client/themes/d-blue.json5 rename src/client/themes/{d-red.json5 => d-dark.json5} (65%) delete mode 100644 src/client/themes/d-green.json5 delete mode 100644 src/client/themes/l-blue.json5 delete mode 100644 src/client/themes/l-green.json5 rename src/client/themes/{l-white.json5 => l-light.json5} (95%) delete mode 100644 src/client/themes/l-red.json5 create mode 100644 src/client/ui/visitor/a.vue create mode 100644 src/client/ui/visitor/b.vue create mode 100644 src/server/api/endpoints/users/stats.ts diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 8a4d346bc..e99d9b535 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -127,6 +127,7 @@ cacheRemoteFilesDescription: "この設定を無効にすると、リモート flagAsBot: "Botとして設定" flagAsBotDescription: "このアカウントがプログラムによって運用される場合は、このフラグをオンにします。オンにすると、反応の連鎖を防ぐためのフラグとして他の開発者に役立ったり、Misskeyのシステム上での扱いがBotに合ったものになります。" flagAsCat: "Catとして設定" +flagAsCatDescription: "このアカウントが猫であることを示す場合は、このフラグをオンにします。" autoAcceptFollowed: "フォロー中ユーザーからのフォロリクを自動承認" addAcount: "アカウント追加" loginFailed: "ログインに失敗しました" @@ -440,6 +441,7 @@ useOsNativeEmojis: "OSネイティブの絵文字を使用" youHaveNoGroups: "グループがありません" joinOrCreateGroup: "既存のグループに招待してもらうか、新しくグループを作成してください。" noHistory: "履歴はありません" +signinHistory: "ログイン履歴" disableAnimatedMfm: "動きのあるMFMを無効にする" doing: "やっています" category: "カテゴリ" @@ -492,6 +494,7 @@ none: "なし" showInPage: "ページで表示" popout: "ポップアウト" volume: "音量" +masterVolume: "マスター音量" details: "詳細" chooseEmoji: "絵文字を選択" unableToProcess: "操作を完了できません" @@ -564,7 +567,8 @@ useStarForReactionFallback: "リアクション絵文字が不明な場合、代 emailConfig: "メールサーバー設定" enableEmail: "メール配信機能を有効化する" emailConfigInfo: "メールアドレスの確認やパスワードリセットの際に使います" -email: "メールアドレス" +email: "メール" +emailAddress: "メールアドレス" smtpConfig: "SMTP サーバーの設定" smtpHost: "ホスト" smtpPort: "ポート" @@ -596,6 +600,7 @@ regenerateLoginTokenDescription: "ログインに使用される内部トーク setMultipleBySeparatingWithSpace: "スペースで区切って複数設定できます。" fileIdOrUrl: "ファイルIDまたはURL" chatOpenBehavior: "チャットを開くときの動作" +behavior: "動作" sample: "サンプル" abuseReports: "通報" reportAbuse: "通報" @@ -619,6 +624,42 @@ createNew: "新規作成" optional: "任意" createNewClip: "新しいクリップを作成" public: "パブリック" +i18nInfo: "Misskeyは有志によって様々な言語に翻訳されています。{link}で翻訳に協力できます。" +manageAccessTokens: "アクセストークンの管理" +accountInfo: "アカウント情報" +notesCount: "ノートの数" +repliesCount: "返信した数" +renotesCount: "Renoteした数" +repliedCount: "返信された数" +renotedCount: "Renoteされた数" +followingCount: "フォロー数" +followersCount: "フォロワー数" +sentReactionsCount: "リアクションした数" +receivedReactionsCount: "リアクションされた数" +pollVotesCount: "アンケートに投票した数" +pollVotedCount: "アンケートに投票された数" +yes: "はい" +no: "いいえ" +driveFilesCount: "ドライブのファイル数" +driveUsage: "ドライブ使用量" +noCrawle: "クローラーによるインデックスを拒否" +noCrawleDescription: "検索エンジンにあなたのユーザーページ、ノート、Pagesなどのコンテンツを登録(インデックス)しないよう要請します。" +lockedAccountInfo: "フォローを承認制にしても、ノートの公開範囲を「フォロワー」にしない限り、誰でもあなたのノートを見ることができます。" +alwaysMarkSensitive: "デフォルトでメディアを閲覧注意にする" +loadRawImages: "添付画像のサムネイルをオリジナル画質にする" +disableShowingAnimatedImages: "アニメーション画像を再生しない" +verificationEmailSent: "確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。" +notSet: "未設定" +emailVerified: "メールアドレスが確認されました" +noteFavoritesCount: "お気に入りノートの数" +pageLikesCount: "Pageにいいねした数" +pageLikedCount: "Pageにいいねされた数" +reversiCount: "リバーシの対局数" + +_nsfw: + respect: "閲覧注意のメディアは隠す" + ignore: "閲覧注意のメディアを隠さない" + force: "常にメディアを隠す" _mfm: cheatSheet: "MFMチートシート" @@ -745,6 +786,8 @@ _theme: manage: "テーマの管理" code: "テーマコード" installed: "{name}をインストールしました" + installedThemes: "インストールされたテーマ" + builtinThemes: "標準のテーマ" alreadyInstalled: "そのテーマは既にインストールされています" invalid: "テーマの形式が間違っています" make: "テーマを作る" @@ -820,6 +863,8 @@ _sfx: chatBg: "チャット(バックグラウンド)" antenna: "アンテナ受信" channel: "チャンネル通知" + reversiPutBlack: "リバーシ: 黒が打ったとき" + reversiPutWhite: "リバーシ: 白が打ったとき" _ago: unknown: "謎" @@ -999,7 +1044,9 @@ _profile: username: "ユーザー名" description: "自己紹介" youCanIncludeHashtags: "ハッシュタグを含めることができます。" - metadata: "補足情報" + metadata: "追加情報" + metadataEdit: "追加情報を編集" + metadataDescription: "プロフィールに表として4つまでの追加情報を表示することができます。" metadataLabel: "ラベル" metadataContent: "内容" diff --git a/migration/1605585339718-instance-pinned-pages.ts b/migration/1605585339718-instance-pinned-pages.ts index 2f0ebab23..f59346130 100644 --- a/migration/1605585339718-instance-pinned-pages.ts +++ b/migration/1605585339718-instance-pinned-pages.ts @@ -4,7 +4,7 @@ export class instancePinnedPages1605585339718 implements MigrationInterface { name = 'instancePinnedPages1605585339718' public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedPages" character varying(512) array NOT NULL DEFAULT '{"/announcements", "/featured", "/channels", "/pages", "/explore", "/games/reversi", "/about-misskey"}'::varchar[]`); + await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedPages" character varying(512) array NOT NULL DEFAULT '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}'::varchar[]`); } public async down(queryRunner: QueryRunner): Promise { diff --git a/migration/1605965516823-instance-images.ts b/migration/1605965516823-instance-images.ts new file mode 100644 index 000000000..bf8d40856 --- /dev/null +++ b/migration/1605965516823-instance-images.ts @@ -0,0 +1,16 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class instanceImages1605965516823 implements MigrationInterface { + name = 'instanceImages1605965516823' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" ADD "backgroundImageUrl" character varying(512)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "logoImageUrl" character varying(512)`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "logoImageUrl"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "backgroundImageUrl"`); + } + +} diff --git a/migration/1606191203881-no-crawle.ts b/migration/1606191203881-no-crawle.ts new file mode 100644 index 000000000..accc8f8fe --- /dev/null +++ b/migration/1606191203881-no-crawle.ts @@ -0,0 +1,16 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class noCrawle1606191203881 implements MigrationInterface { + name = 'noCrawle1606191203881' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "noCrawle" boolean NOT NULL DEFAULT false`); + await queryRunner.query(`COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "noCrawle"`); + } + +} diff --git a/src/client/assets/sounds/syuilo/kick.mp3 b/src/client/assets/sounds/syuilo/kick.mp3 new file mode 100644 index 000000000..7c2d02582 --- /dev/null +++ b/src/client/assets/sounds/syuilo/kick.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf29c3b4d76d2c548ac28fc91772524d33aea65f45fecb9c7d97b6adfb436060 +size 15672 diff --git a/src/client/assets/sounds/syuilo/snare.mp3 b/src/client/assets/sounds/syuilo/snare.mp3 new file mode 100644 index 000000000..c1e86f062 --- /dev/null +++ b/src/client/assets/sounds/syuilo/snare.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7802a1f89d72a036c7a3bab4a115dca50302ba47d06e9c8a6379550553484d54 +size 26121 diff --git a/src/client/cold-storage.ts b/src/client/cold-storage.ts new file mode 100644 index 000000000..1bee2313f --- /dev/null +++ b/src/client/cold-storage.ts @@ -0,0 +1,34 @@ +// 常にメモリにロードしておく必要がないような設定情報を保管するストレージ + +const PREFIX = 'miux:'; + +export const defaultDeviceSettings = { + sound_masterVolume: 0.3, + sound_note: { type: 'syuilo/down', volume: 1 }, + sound_noteMy: { type: 'syuilo/up', volume: 1 }, + sound_notification: { type: 'syuilo/pope2', volume: 1 }, + sound_chat: { type: 'syuilo/pope1', volume: 1 }, + sound_chatBg: { type: 'syuilo/waon', volume: 1 }, + sound_antenna: { type: 'syuilo/triple', volume: 1 }, + sound_channel: { type: 'syuilo/square-pico', volume: 1 }, + sound_reversiPutBlack: { type: 'syuilo/kick', volume: 0.3 }, + sound_reversiPutWhite: { type: 'syuilo/snare', volume: 0.3 }, +}; + +export const device = { + get(key: T): typeof defaultDeviceSettings[T] { + // TODO: indexedDBにする + // ただしその際はnullチェックではなくキー存在チェックにしないとダメ + // (indexedDBはnullを保存できるため、ユーザーが意図してnullを格納した可能性がある) + const value = localStorage.getItem(PREFIX + key); + if (value == null) { + return defaultDeviceSettings[key]; + } else { + return JSON.parse(value); + } + }, + + set(key: keyof typeof defaultDeviceSettings, value: any): any { + localStorage.setItem(PREFIX + key, JSON.stringify(value)); + }, +}; diff --git a/src/client/components/form-dialog.vue b/src/client/components/form-dialog.vue index 0dc02258a..add6b230d 100644 --- a/src/client/components/form-dialog.vue +++ b/src/client/components/form-dialog.vue @@ -1,6 +1,6 @@ -
-
@@ -67,7 +67,6 @@ export default defineComponent({ font-size: 0.9em; tab-size: 2; white-space: pre; - font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; } } diff --git a/src/client/components/taskmanager.vue b/src/client/components/taskmanager.vue index 92c56442c..1ed8c8bd5 100644 --- a/src/client/components/taskmanager.vue +++ b/src/client/components/taskmanager.vue @@ -3,7 +3,7 @@ -
+
@@ -150,7 +150,6 @@ export default defineComponent({ display: flex; flex-direction: column; height: 100%; - font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; > .content { flex: 1; diff --git a/src/client/components/timeline.vue b/src/client/components/timeline.vue index 930f47b1a..df9424d8e 100644 --- a/src/client/components/timeline.vue +++ b/src/client/components/timeline.vue @@ -6,6 +6,7 @@ import { defineComponent } from 'vue'; import XNotes from './notes.vue'; import * as os from '@/os'; +import * as sound from '@/scripts/sound'; export default defineComponent({ components: { @@ -65,7 +66,7 @@ export default defineComponent({ this.$emit('note'); if (this.sound) { - os.sound(note.userId === this.$store.state.i.id ? 'noteMy' : 'note'); + sound.play(note.userId === this.$store.state.i.id ? 'noteMy' : 'note'); } }; diff --git a/src/client/components/ui/range.vue b/src/client/components/ui/range.vue index c6e585cf5..4cfe66a8f 100644 --- a/src/client/components/ui/range.vue +++ b/src/client/components/ui/range.vue @@ -1,7 +1,7 @@