Compare commits

..

47 Commits

Author SHA1 Message Date
a0f10d7ca1 10.38.4 2018-11-04 18:38:04 +09:00
299b91edc4 [API] Improve admin/emoji/add 2018-11-04 18:37:12 +09:00
95c89ca6db RE: [Client] Fix bug 2018-11-04 18:36:19 +09:00
7fe0d71e7f [Client] Fix bug 2018-11-04 18:35:55 +09:00
fbbb506e86 🎨 2018-11-04 18:31:27 +09:00
ec80b06a45 Merge branch 'develop' of https://github.com/syuilo/misskey into develop 2018-11-04 18:24:20 +09:00
41e1619f1f [Client] Fix bug 2018-11-04 18:24:08 +09:00
ba6a9c6a93 Merge pull request #3092 from syuilo/l10n_develop
New Crowdin translations
2018-11-04 18:22:19 +09:00
18571c52fb Fix: emoji regex (#3093) 2018-11-04 17:36:37 +09:00
5d5dfeaa83 New translations ja-JP.yml (Japanese, Kansai) 2018-11-04 17:11:19 +09:00
3669d8c0f3 New translations ja-JP.yml (Japanese, Kansai) 2018-11-04 17:01:11 +09:00
69d72819c6 10.38.3 2018-11-04 15:18:37 +09:00
54dcc10250 Fix bug for Mastodon(?) 2018-11-04 15:17:52 +09:00
1edfce8f73 [Client] スマホ/タブレットからでも管理者ページを使えるように 2018-11-04 15:16:05 +09:00
675e573a8c 🎨 2018-11-04 14:23:28 +09:00
1080fa63a9 10.38.2 2018-11-04 11:09:31 +09:00
8047086988 Good bye package-lock 2018-11-04 11:08:46 +09:00
449b9f7fa0 [Client] Improve admin panel 2018-11-04 11:08:03 +09:00
b7a15bf6ca 絵文字を作成した/更新した時にupdateAtを更新するように 2018-11-04 10:42:16 +09:00
7c3873887d 10.38.1 2018-11-04 03:45:05 +09:00
247ea4cf12 Merge pull request #3083 from syuilo/l10n_develop
New Crowdin translations
2018-11-04 03:44:30 +09:00
0b7af5c669 [Client] Fix bug 2018-11-04 03:44:06 +09:00
2b62a4e2e5 New translations ja-JP.yml (English) 2018-11-04 03:42:45 +09:00
65bfa3c0d6 Fix: update_client_setting (#3086) 2018-11-04 03:33:37 +09:00
84db15694d Do not send needless emojis in note
投稿作成時に含まれている絵文字を保存しておくように

SEE: https://github.com/syuilo/misskey/pull/3085#issuecomment-435608434
2018-11-04 03:32:20 +09:00
746189ba37 New translations ja-JP.yml (Norwegian) 2018-11-04 03:23:44 +09:00
74e845b3ac New translations ja-JP.yml (Dutch) 2018-11-04 03:23:39 +09:00
90fe70540e New translations ja-JP.yml (Japanese, Kansai) 2018-11-04 03:23:36 +09:00
f28af75191 New translations ja-JP.yml (Spanish) 2018-11-04 03:23:31 +09:00
924bb2bc70 New translations ja-JP.yml (Russian) 2018-11-04 03:23:26 +09:00
19d60f3d51 New translations ja-JP.yml (Portuguese) 2018-11-04 03:23:22 +09:00
6903476868 New translations ja-JP.yml (Polish) 2018-11-04 03:23:16 +09:00
cf0dccc209 New translations ja-JP.yml (Korean) 2018-11-04 03:23:10 +09:00
cfd959129d New translations ja-JP.yml (Italian) 2018-11-04 03:23:06 +09:00
819287951c New translations ja-JP.yml (German) 2018-11-04 03:23:02 +09:00
e136193925 New translations ja-JP.yml (French) 2018-11-04 03:22:57 +09:00
8c631864d9 New translations ja-JP.yml (English) 2018-11-04 03:22:53 +09:00
d7d0f6ae2e New translations ja-JP.yml (Chinese Simplified) 2018-11-04 03:22:47 +09:00
b83b3fb9d1 New translations ja-JP.yml (Catalan) 2018-11-04 03:22:43 +09:00
dfce5bc0af [Client] Improve Emoji management page of admin panel 2018-11-04 03:18:57 +09:00
3487ddabea [API] Implement some Emoji APIs 2018-11-04 03:18:32 +09:00
2dbff75e7a New translations ja-JP.yml (French) 2018-11-04 02:53:30 +09:00
02465ded9f New translations ja-JP.yml (French) 2018-11-04 02:41:50 +09:00
ffcd387945 New translations ja-JP.yml (French) 2018-11-04 02:31:36 +09:00
4806346707 New translations ja-JP.yml (French) 2018-11-04 02:21:09 +09:00
31c3f6abf7 Fix: welcome-timeline (#3084) 2018-11-04 01:49:08 +09:00
83e47fdd60 New translations ja-JP.yml (English) 2018-11-04 01:21:56 +09:00
48 changed files with 674 additions and 17570 deletions

1
.npmrc
View File

@ -1 +1,2 @@
save-exact = true
package-lock = false

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1010,11 +1010,15 @@ admin/views/emoji.vue:
add-emoji:
title: "Add emoji"
name: "Emoji name"
name-desc: "a~z 0~9 _ の文字が使えます。"
name-desc: "You can use the characters a~z 0~9 _"
aliases: "Aliases"
aliases-desc: "スペースで区切って複数設定できます。"
aliases-desc: "You can add more than one, separated by spaces."
url: "Image URL"
add: "Add"
emojis:
title: "Emojis"
update: "Update"
remove: "Remove"
admin/views/announcements.vue:
announcements: "Announcements"
save: "Save"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -445,7 +445,7 @@ common/views/components/profile-editor.vue:
is-cat: "Ce compte est un Chat"
is-bot: "Ce compte est un Bot"
is-locked: "Demandes dabonnements requièrent lapprobation"
careful-bot: "Botからのフォローだけ承認制にする"
careful-bot: "Les demandes dabonnements venant de Bots requièrent lapprobation"
advanced: "Avancé"
privacy: "Vie privée"
save: "Mettre à jour le profil"
@ -502,7 +502,7 @@ common/views/widgets/tips.vue:
tips-line14: "ホームのカスタマイズ中、ウィジェットを右クリックしてデザインを変更できます"
tips-line17: "Vous pouvez mettre un texte en surbrillance en le mettant entre ** **"
tips-line19: "Plusieurs fenêtres peuvent être détachées en dehors du navigateur."
tips-line20: "カレンダーウィジェットのパーセンテージは、経過の割合を示しています"
tips-line20: "Pourcentage sur le widget calendrier qui indique le pourcentage de temps passé"
tips-line21: "Vous pouvez aussi utiliser l'API pour développer des Bots."
tips-line23: "Mayu est mignone avec ses sourcils."
tips-line24: "Misskey a vu le jour en 2014"
@ -549,7 +549,7 @@ desktop/views/components/charts.vue:
drive: "Drive"
network: "Réseau"
charts:
federation-instances: "インスタンスの増減"
federation-instances: "Nombre dinstances : augmentation/diminution"
federation-instances-total: "Nombre total dinstances"
notes: "投稿の増減 (統合)"
local-notes: "投稿の増減 (ローカル)"
@ -782,7 +782,7 @@ desktop/views/components/settings.vue:
timeline: "Chronologie"
show-my-renotes: "Afficher mes republications dans le fil"
show-renoted-my-notes: "Afficher mes republications dans les fils"
show-local-renotes: "ローカルの投稿のRenoteをタイムラインに表示する"
show-local-renotes: "Afficher les partages locaux sur les fils"
show-maps: "Afficher la carte"
deck-column-align: "デッキのカラムの位置"
deck-column-align-center: "Centrer"
@ -866,22 +866,22 @@ common/views/components/api-settings.vue:
desktop/views/components/settings.apps.vue:
no-apps: "Aucune application autorisée"
common/views/components/drive-settings.vue:
max: "容量"
max: "Maximale"
in-use: "utilisé"
stats: "Statistiques"
common/views/components/mute-and-block.vue:
mute-and-block: "ミュートとブロック"
mute: "ミュート"
block: "ブロック"
no-muted-users: "ミュートしているユーザーはいません"
no-blocked-users: "ブロックしているユーザーはいません"
mute-and-block: "Silencer / Bloquer"
mute: "Mettre en sourdine"
block: "En cours blocage"
no-muted-users: "Aucun utilisateur·rice nest mis·e en sourdine"
no-blocked-users: "Aucun utilisateur·rice nest bloqué·e"
common/views/components/password-settings.vue:
reset: "パスワードを変更する"
enter-current-password: "現在のパスワードを入力してください"
enter-new-password: "新しいパスワードを入力してください"
enter-new-password-again: "もう一度新しいパスワードを入力してください"
not-match: "新しいパスワードが一致しません"
changed: "パスワードを変更しました"
reset: "Modifier le mot de passe"
enter-current-password: "Entrez votre mot de passe actuel"
enter-new-password: "Saisissez le nouveau mot de passe"
enter-new-password-again: "Entrez à nouveau le nouveau mot de passe"
not-match: "Les nouveaux mots de passe ne sont pas identiques"
changed: "Mot de passe modifié avec succès"
desktop/views/components/sub-note-content.vue:
private: "cette publication est privée"
deleted: "cette publication a été supprimée"
@ -948,82 +948,86 @@ desktop/views/components/window.vue:
popout: "ポップアウト"
close: "Fermer"
admin/views/index.vue:
dashboard: "ダッシュボード"
instance: "インスタンス"
emoji: "カスタム絵文字"
users: "ユーザー"
update: "更新"
announcements: "お知らせ"
hashtags: "ハッシュタグ"
back-to-misskey: "Misskeyに戻る"
dashboard: "Tableau de bord"
instance: "Instance"
emoji: "Emoji"
users: "Utilisateur·rice·s"
update: "Mise à jour"
announcements: "Annonces"
hashtags: "Hashtags"
back-to-misskey: "Retour vers Misskey"
admin/views/dashboard.vue:
dashboard: "ダッシュボード"
accounts: "アカウント"
notes: "投稿"
drive: "ドライブ"
instances: "インスタンス"
this-instance: "このインスタンス"
federated: "連合"
invite: "招待"
banner-url: "Banner URL"
disableRegistration: "Disable new user registration"
disableLocalTimeline: "Disable the local timeline"
dashboard: "Tableau de bord"
accounts: "Comptes"
notes: "Notes"
drive: "Lecteur"
instances: "Instances"
this-instance: "Cette instance"
federated: "Fédérées"
invite: "Inviter"
banner-url: "URL de la bannière"
disableRegistration: "Désactiver lenregistrement de nouveaux utilisateur·rice·s"
disableLocalTimeline: "Désactiver le fil local"
admin/views/charts.vue:
title: "チャート"
per-day: "1日ごと"
per-hour: "1時間ごと"
federation: "フェデレーション"
notes: "投稿"
users: "ユーザー"
drive: "ドライブ"
network: "ネットワーク"
title: "Graph"
per-day: "par jour"
per-hour: "par heure"
federation: "Fédération"
notes: "Publications"
users: "Utilisateur·rice·s"
drive: "Lecteur"
network: "Réseau"
charts:
federation-instances: "インスタンスの増減"
federation-instances-total: "インスタンスの積算"
federation-instances: "Nombre dinstances : augmentation/diminution"
federation-instances-total: "Nombre total dinstances"
notes: "投稿の増減 (統合)"
local-notes: "投稿の増減 (ローカル)"
remote-notes: "投稿の増減 (リモート)"
notes-total: "投稿の積算"
users: "ユーザーの増減"
users-total: "ユーザーの積算"
notes-total: "Total des publications"
users: "Nombre dutilisateur·rice·s : augmentation/diminution"
users-total: "Nombre total des utilisateur·rice·s"
drive: "ドライブ使用量の増減"
drive-total: "ドライブ使用量の積算"
drive-total: "Utilisation totale du lecteur"
drive-files: "ドライブのファイル数の増減"
drive-files-total: "ドライブのファイル数の積算"
network-requests: "リクエスト"
network-time: "応答時間"
network-usage: "通信量"
drive-files-total: "Nombre total de fichiers sur le lecteur"
network-requests: "Requêtes"
network-time: "Temps de réponse"
network-usage: "Traffic"
admin/views/users.vue:
suspend-user: "ユーザーの凍結"
suspend: "凍結"
suspended: "凍結しました"
unsuspend-user: "ユーザーの凍結の解除"
unsuspend: "凍結の解除"
unsuspended: "凍結を解除しました"
verify-user: "ユーザーの公式アカウント設定"
suspend-user: "Suspendre un·e utilisateur·rice"
suspend: "Suspendre"
suspended: "Suspendu·e avec succès."
unsuspend-user: "Lever la suspension dutilisateur·rice·s"
unsuspend: "Suspension levée"
unsuspended: "La suspension de lutilisateur·rice a été levée avec succès"
verify-user: "Paramètres de vérification du compte utilisateur"
verify: "公式アカウントにする"
verified: "公式アカウントにしました"
unverify-user: "ユーザーの公式アカウント解除"
unverify: "公式アカウントを解除する"
unverified: "公式アカウントを解除しました"
unverify: "Ôter la vérification du compte"
unverified: "Ce compte n'est plus vérifié"
admin/views/emoji.vue:
add-emoji:
title: "絵文字の登録"
name: "絵文字名"
title: "Ajouter un émoji"
name: "Nom de lémoji"
name-desc: "a~z 0~9 _ の文字が使えます。"
aliases: "エイリアス"
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
aliases: "Aliases"
aliases-desc: "Vous pouvez définir plus dun, séparés par des espaces."
url: "URL de limage"
add: "Ajouter"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"
remove: "削除"
add: "追加"
title: "タイトル"
text: "内容"
announcements: "Annonces"
save: "Enregistrer"
remove: "Supprimer"
add: "Ajouter"
title: "Titre"
text: "Contenu"
admin/views/hashtags.vue:
hided-tags: "Hidden Tags"
hided-tags: "Tags cachés"
desktop/views/pages/deck/deck.tl-column.vue:
is-media-only: "Les publications médias uniquement"
is-media-view: "Vue média"
@ -1370,7 +1374,7 @@ mobile/views/pages/settings.vue:
sound: "Sons"
enable-sounds: "Activer les sons"
mark-as-read-all-unread-notes: "Marquer toutes les publications comme lues"
password: "パスワード"
password: "Mot de Passe"
mobile/views/pages/user.vue:
follows-you: "Vous suit"
following: "Abonnements"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1142,6 +1142,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"

View File

@ -186,7 +186,7 @@ common:
stack-left: "左に重ねんで!"
pop-right: "右に出すで!"
dev: "アプリの作成あかんかったわ。もっぺんやってみて。"
ai-chan-kawaii: "藍ちゃかわいい"
ai-chan-kawaii: "藍ちゃめっさべっぴんさんや"
auth/views/form.vue:
share-access: "<i>{{ app.name }}</i>があんさんのアカウントにアクセスすんのを<b>許可</b>してもええか?"
permission-ask: "このアプリは次の権限を要求してんで:"
@ -744,7 +744,7 @@ desktop/views/components/settings.vue:
apps: "アプリ"
mute-and-block: "ミュート/ブロック"
blocking: "ブロック"
security: "守護神セキュリティ"
security: "セキュリティ"
signin: "こんな感じでサインインしたらしいで"
password: "パスワード"
2fa: "二段階認証"
@ -873,15 +873,15 @@ common/views/components/mute-and-block.vue:
mute-and-block: "ミュートとブロック"
mute: "ミュート"
block: "ブロック"
no-muted-users: "ミュートしているユーザーはいません"
no-blocked-users: "ブロックしているユーザーはいません"
no-muted-users: "ミュートしるユーザーはおらんで"
no-blocked-users: "ブロックしるユーザーはおらんで"
common/views/components/password-settings.vue:
reset: "パスワードを変更する"
enter-current-password: "現在のパスワードを入力してください"
enter-new-password: "新しいパスワードを入力してください"
enter-new-password-again: "もう一度新しいパスワードを入力してください"
not-match: "新しいパスワードが一致しません"
changed: "パスワードを変更しました"
reset: "パスワード変える"
enter-current-password: "のパスワードを入れてや"
enter-new-password: "こんどのパスワード入れてや"
enter-new-password-again: "もっぺん入れてや"
not-match: "パスワードがおうとらん"
changed: "パスワード変えたわ"
desktop/views/components/sub-note-content.vue:
private: "この投稿は見せられへんわ"
deleted: "この投稿なんか無くなってもうたわ"
@ -953,7 +953,7 @@ admin/views/index.vue:
emoji: "カスタム絵文字"
users: "ユーザー"
update: "更新"
announcements: "お知らせ"
announcements: "知っといてや"
hashtags: "ハッシュタグ"
back-to-misskey: "Misskeyに戻る"
admin/views/dashboard.vue:
@ -962,9 +962,9 @@ admin/views/dashboard.vue:
notes: "投稿"
drive: "ドライブ"
instances: "インスタンス"
this-instance: "のインスタンス"
this-instance: "ワイのインスタンス"
federated: "連合"
invite: "招待"
invite: "来てや"
banner-url: "Banner URL"
disableRegistration: "Disable new user registration"
disableLocalTimeline: "Disable the local timeline"
@ -980,7 +980,7 @@ admin/views/charts.vue:
charts:
federation-instances: "インスタンスの増減"
federation-instances-total: "インスタンスの積算"
notes: "投稿の増減 (統合)"
notes: "投稿の増減(統合)"
local-notes: "投稿の増減 (ローカル)"
remote-notes: "投稿の増減 (リモート)"
notes-total: "投稿の積算"
@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"
@ -1383,7 +1387,7 @@ mobile/views/pages/user.vue:
mute: "ミュート"
unmute: "ミュート解除"
block: "ブロック"
unblock: "ブロック解除"
unblock: "ブロックやめたる"
mobile/views/pages/user/home.vue:
recent-notes: "最近儲かりまっか?"
images: "画像"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

View File

@ -1015,6 +1015,10 @@ admin/views/emoji.vue:
aliases-desc: "スペースで区切って複数設定できます。"
url: "絵文字画像URL"
add: "追加"
emojis:
title: "絵文字一覧"
update: "更新"
remove: "削除"
admin/views/announcements.vue:
announcements: "お知らせ"
save: "保存"

17362
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "10.38.0",
"clientVersion": "1.0.11454",
"version": "10.38.4",
"clientVersion": "1.0.11501",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="cdeuzmsthagexbkpofbmatmugjuvogfb">
<ui-card>
<div slot="title">%fa:broadcast-tower% %i18n:@announcements%</div>
<section v-for="(announcement, i) in announcements" class="fit-top">
@ -9,10 +9,10 @@
<ui-textarea v-model="announcement.text">
<span>%i18n:@text%</span>
</ui-textarea>
<ui-button-group>
<ui-button inline @click="save">%fa:save R% %i18n:@save%</ui-button>
<ui-button inline @click="remove(i)">%fa:trash-alt R% %i18n:@remove%</ui-button>
</ui-button-group>
<ui-horizon-group>
<ui-button @click="save">%fa:save R% %i18n:@save%</ui-button>
<ui-button @click="remove(i)">%fa:trash-alt R% %i18n:@remove%</ui-button>
</ui-horizon-group>
</section>
<section>
<ui-button @click="add">%fa:plus% %i18n:@add%</ui-button>
@ -54,11 +54,18 @@ export default Vue.extend({
(this as any).api('admin/update-meta', {
broadcasts: this.announcements
}).then(() => {
(this as any).os.apis.dialog({ text: `Saved` });
//(this as any).os.apis.dialog({ text: `Saved` });
}).catch(e => {
(this as any).os.apis.dialog({ text: `Failed ${e}` });
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
}
}
});
</script>
<style lang="stylus" scoped>
.cdeuzmsthagexbkpofbmatmugjuvogfb
@media (min-width 500px)
padding 16px
</style>

View File

@ -34,8 +34,8 @@ export default Vue.extend({
mounted() {
this.connection = (this as any).os.stream.useSharedConnection('apLog');
this.connection.on('stats', this.onLog);
this.connection.on('statsLog', this.onLogs);
this.connection.on('log', this.onLog);
this.connection.on('logs', this.onLogs);
this.connection.send('requestLog', {
id: Math.random().toString().substr(2, 8),
length: 50
@ -63,11 +63,11 @@ export default Vue.extend({
<style lang="stylus" scoped>
.hyhctythnmwihguaaapnbrbszsjqxpio
display block
padding 16px
padding 12px 16px 16px 16px
height 250px
overflow auto
overflow hidden
box-shadow 0 2px 4px rgba(0, 0, 0, 0.1)
background var(--face)
background var(--adminDashboardCardBg)
border-radius 8px
> table
@ -76,10 +76,11 @@ export default Vue.extend({
overflow auto
border-spacing 0
border-collapse collapse
color #555
color var(--adminDashboardCardFg)
font-size 14px
thead
border-bottom solid 2px #eee
border-bottom solid 1px var(--adminDashboardCardDivider)
tr
th
@ -89,7 +90,7 @@ export default Vue.extend({
tbody
tr
&:nth-child(odd)
background #fbfbfb
background rgba(0, 0, 0, 0.025)
th, td
padding 8px 16px

View File

@ -39,6 +39,7 @@
<script lang="ts">
import Vue from 'vue';
import * as tinycolor from 'tinycolor2';
import * as ApexCharts from 'apexcharts';
const limit = 90;
@ -147,7 +148,7 @@ export default Vue.extend({
this.chartInstance.destroy();
}
this.chartInstance = new ApexCharts(this.$refs.chart, Object.assign({
this.chartInstance = new ApexCharts(this.$refs.chart, {
chart: {
type: 'area',
height: 300,
@ -168,17 +169,41 @@ export default Vue.extend({
},
grid: {
clipMarkers: false,
borderColor: 'rgba(0, 0, 0, 0.1)'
},
stroke: {
curve: 'straight',
width: 2
},
legend: {
labels: {
color: tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--text')).toRgbString()
},
},
xaxis: {
type: 'datetime'
type: 'datetime',
labels: {
style: {
colors: tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--text')).toRgbString()
}
},
axisBorder: {
color: 'rgba(0, 0, 0, 0.1)'
},
axisTicks: {
color: 'rgba(0, 0, 0, 0.1)'
},
},
yaxis: {
}
}, this.data));
labels: {
formatter: this.data.bytes ? v => Vue.filter('bytes')(v, 0) : v => Vue.filter('number')(v),
style: {
color: tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--text')).toRgbString()
}
}
},
series: this.data.series
});
this.chartInstance.render();
},
@ -286,6 +311,7 @@ export default Vue.extend({
driveChart(): any {
return {
bytes: true,
series: [{
name: 'All',
data: this.format(
@ -314,6 +340,7 @@ export default Vue.extend({
driveTotalChart(): any {
return {
bytes: true,
series: [{
name: 'Combined',
data: this.format(sum(this.stats.drive.local.totalSize, this.stats.drive.remote.totalSize))
@ -396,6 +423,7 @@ export default Vue.extend({
networkUsageChart(): any {
return {
bytes: true,
series: [{
name: 'Incoming',
data: this.format(this.stats.network.incomingBytes)
@ -424,8 +452,8 @@ export default Vue.extend({
margin 0 8px
padding 0 0 8px 0
font-size 1em
color #555
border-bottom solid 1px #eee
color var(--adminDashboardCardFg)
border-bottom solid 1px var(--adminDashboardCardDivider)
> b
margin-right 8px

View File

@ -79,6 +79,7 @@ export default Vue.extend({
},
grid: {
clipMarkers: false,
borderColor: 'rgba(0, 0, 0, 0.1)'
},
stroke: {
curve: 'straight',
@ -153,7 +154,7 @@ export default Vue.extend({
display flex
padding 0 8px
margin-bottom -16px
color #555
color var(--adminDashboardCardFg)
font-size 14px
> span
@ -167,4 +168,13 @@ export default Vue.extend({
> div
margin-bottom -10px
@media (max-width 1000px)
display block
margin-bottom 26px
> div
&:first-child
margin-right 0
margin-bottom 26px
</style>

View File

@ -124,17 +124,28 @@ export default Vue.extend({
<style lang="stylus" scoped>
.obdskegsannmntldydackcpzezagxqfy
padding 16px
@media (min-width 500px)
padding 32px
> header
display flex
margin-bottom 16px
padding-bottom 16px
border-bottom solid 1px #ccc
color #777
border-bottom solid 1px var(--adminDashboardHeaderBorder)
color var(--adminDashboardHeaderFg)
font-size 14px
white-space nowrap
@media (max-width 1000px)
display none
> p
display inline
display block
margin 0 32px 0 0
overflow hidden
text-overflow ellipsis
> b
&:after
@ -152,11 +163,10 @@ export default Vue.extend({
> div
flex 1
max-width 300px
margin-right 16px
color var(--text)
color var(--adminDashboardCardFg)
box-shadow 0 2px 4px rgba(0, 0, 0, 0.1)
background var(--face)
background var(--adminDashboardCardBg)
border-radius 8px
&:last-child
@ -192,7 +202,7 @@ export default Vue.extend({
> div:last-child
display flex
padding 6px 16px
border-top solid 1px #eee
border-top solid 1px var(--adminDashboardCardDivider)
> span
font-size 70%
@ -202,6 +212,21 @@ export default Vue.extend({
margin-left auto
cursor pointer
@media (max-width 900px)
display grid
grid-template-columns 1fr 1fr
grid-template-rows 1fr 1fr
gap 16px
> div
margin-right 0
@media (max-width 500px)
display block
> div:not(:last-child)
margin-bottom 16px
> .charts
margin-bottom 16px

View File

@ -1,22 +1,48 @@
<template>
<div>
<div class="tumhkfkmgtvzljezfvmgkeurkfncshbe">
<ui-card>
<div slot="title">%fa:plus% %i18n:@add-emoji.title%</div>
<section class="fit-top">
<ui-input v-model="name">
<span>%i18n:@add-emoji.name%</span>
<span slot="text">%i18n:@add-emoji.name-desc%</span>
</ui-input>
<ui-input v-model="aliases">
<span>%i18n:@add-emoji.aliases%</span>
<span slot="text">%i18n:@add-emoji.aliases-desc%</span>
</ui-input>
<ui-horizon-group inputs>
<ui-input v-model="name">
<span>%i18n:@add-emoji.name%</span>
<span slot="text">%i18n:@add-emoji.name-desc%</span>
</ui-input>
<ui-input v-model="aliases">
<span>%i18n:@add-emoji.aliases%</span>
<span slot="text">%i18n:@add-emoji.aliases-desc%</span>
</ui-input>
</ui-horizon-group>
<ui-input v-model="url">
<span>%i18n:@add-emoji.url%</span>
</ui-input>
<ui-button @click="add">%i18n:@add-emoji.add%</ui-button>
</section>
</ui-card>
<ui-card>
<div slot="title">%fa:grin R% %i18n:@emojis.title%</div>
<section v-for="emoji in emojis">
<img :src="emoji.url" :alt="emoji.name" style="width: 64px;"/>
<ui-horizon-group inputs>
<ui-input v-model="emoji.name">
<span>%i18n:@add-emoji.name%</span>
<span slot="text">%i18n:@add-emoji.name-desc%</span>
</ui-input>
<ui-input v-model="emoji.aliases">
<span>%i18n:@add-emoji.aliases%</span>
<span slot="text">%i18n:@add-emoji.aliases-desc%</span>
</ui-input>
</ui-horizon-group>
<ui-input v-model="emoji.url">
<span>%i18n:@add-emoji.url%</span>
</ui-input>
<ui-horizon-group>
<ui-button @click="updateEmoji(emoji)">%fa:save R% %i18n:@emojis.update%</ui-button>
<ui-button @click="removeEmoji(emoji)">%fa:trash-alt R% %i18n:@emojis.remove%</ui-button>
</ui-horizon-group>
</section>
</ui-card>
</div>
</template>
@ -29,20 +55,65 @@ export default Vue.extend({
name: '',
url: '',
aliases: '',
emojis: []
};
},
mounted() {
this.fetchEmojis();
},
methods: {
add() {
(this as any).api('admin/add-emoji', {
(this as any).api('admin/emoji/add', {
name: this.name,
url: this.url,
aliases: this.aliases.split(' ')
}).then(() => {
(this as any).os.apis.dialog({ text: `Added` });
//(this as any).os.apis.dialog({ text: `Added` });
this.fetchEmojis();
}).catch(e => {
(this as any).os.apis.dialog({ text: `Failed ${e}` });
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
},
fetchEmojis() {
(this as any).api('admin/emoji/list').then(emojis => {
emojis.forEach(e => e.aliases = (e.aliases || []).join(' '));
this.emojis = emojis;
});
},
updateEmoji(emoji) {
(this as any).api('admin/emoji/update', {
id: emoji.id,
name: emoji.name,
url: emoji.url,
aliases: emoji.aliases.split(' ')
}).then(() => {
//(this as any).os.apis.dialog({ text: `Updated` });
}).catch(e => {
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
},
removeEmoji(emoji) {
(this as any).api('admin/emoji/remove', {
id: emoji.id
}).then(() => {
//(this as any).os.apis.dialog({ text: `Removed` });
this.fetchEmojis();
}).catch(e => {
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
}
}
});
</script>
<style lang="stylus" scoped>
.tumhkfkmgtvzljezfvmgkeurkfncshbe
@media (min-width 500px)
padding 16px
</style>

View File

@ -29,9 +29,9 @@ export default Vue.extend({
(this as any).api('admin/update-meta', {
hidedTags: this.hidedTags.split('\n')
}).then(() => {
(this as any).os.apis.dialog({ text: `Saved` });
//(this as any).os.apis.dialog({ text: `Saved` });
}).catch(e => {
(this as any).os.apis.dialog({ text: `Failed ${e}` });
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
}
}

View File

@ -1,6 +1,15 @@
<template>
<div class="mk-admin">
<nav>
<div class="mk-admin" :class="{ isMobile }">
<header v-show="isMobile">
<button class="nav" @click="navOpend = true">%fa:bars%</button>
<span>MisskeyMyAdmin</span>
</header>
<div class="nav-backdrop"
v-if="navOpend && isMobile"
@click="navOpend = false"
@touchstart="navOpend = false"
></div>
<nav v-show="navOpend">
<div class="mi">
<img svg-inline src="../assets/header-icon.svg"/>
</div>
@ -49,6 +58,10 @@ import XAnnouncements from "./announcements.vue";
import XHashtags from "./hashtags.vue";
import XUsers from "./users.vue";
// Detect the user agent
const ua = navigator.userAgent.toLowerCase();
const isMobile = /mobile|iphone|ipad|android/.test(ua);
export default Vue.extend({
components: {
XDashboard,
@ -58,10 +71,15 @@ export default Vue.extend({
XHashtags,
XUsers
},
provide: {
isMobile
},
data() {
return {
page: 'dashboard',
version
version,
isMobile,
navOpend: !isMobile
};
},
methods: {
@ -74,12 +92,46 @@ export default Vue.extend({
<style lang="stylus">
.mk-admin
$headerHeight = 48px
display flex
height 100%
> header
position fixed
top 0
z-index 10000
width 100%
color var(--mobileHeaderFg)
background-color var(--mobileHeaderBg)
box-shadow 0 1px 0 rgba(#000, 0.075)
&, *
user-select none
> span
display block
line-height $headerHeight
text-align center
> .nav
display block
position absolute
top 0
left 0
z-index 10001
padding 0
width $headerHeight
font-size 1.4em
line-height $headerHeight
border-right solid 1px rgba(#000, 0.1)
> [data-fa]
transition all 0.2s ease
> nav
position fixed
z-index 10000
z-index 20001
top 0
left 0
width 250px
@ -187,9 +239,22 @@ export default Vue.extend({
border-bottom solid 16px transparent
border-left solid 16px transparent
> .nav-backdrop
position fixed
top 0
left 0
z-index 20000
width 100%
height 100%
background var(--mobileNavBackdrop)
> main
width 100%
padding 32px 32px 32px calc(32px + 250px)
padding 0 0 0 250px
max-width 1300px
&.isMobile
> main
padding $headerHeight 0 0 0
</style>

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="axbwjelsbymowqjyywpirzhdlszoncqs">
<ui-card>
<div slot="title">%i18n:@banner-url%</div>
<section class="fit-top">
@ -43,7 +43,7 @@ export default Vue.extend({
(this as any).api('admin/invite').then(x => {
this.inviteCode = x.code;
}).catch(e => {
(this as any).os.apis.dialog({ text: `Failed ${e}` });
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
},
updateMeta() {
@ -52,11 +52,18 @@ export default Vue.extend({
disableLocalTimeline: this.disableLocalTimeline,
bannerUrl: this.bannerUrl
}).then(() => {
(this as any).os.apis.dialog({ text: `Saved` });
//(this as any).os.apis.dialog({ text: `Saved` });
}).catch(e => {
(this as any).os.apis.dialog({ text: `Failed ${e}` });
//(this as any).os.apis.dialog({ text: `Failed ${e}` });
});
}
}
});
</script>
<style lang="stylus" scoped>
.axbwjelsbymowqjyywpirzhdlszoncqs
@media (min-width 500px)
padding 16px
</style>

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="ucnffhbtogqgscfmqcymwmmupoknpfsw">
<ui-card>
<div slot="title">%i18n:@verify-user%</div>
<section class="fit-top">
@ -67,11 +67,11 @@ export default Vue.extend({
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.verifyUsername));
await (this as any).os.api('admin/verify-user', { userId: user.id });
(this as any).os.apis.dialog({ text: '%i18n:@verified%' });
//(this as any).os.apis.dialog({ text: '%i18n:@verified%' });
};
await process().catch(e => {
(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
});
this.verifying = false;
@ -83,11 +83,11 @@ export default Vue.extend({
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.unverifyUsername));
await (this as any).os.api('admin/unverify-user', { userId: user.id });
(this as any).os.apis.dialog({ text: '%i18n:@unverified%' });
//(this as any).os.apis.dialog({ text: '%i18n:@unverified%' });
};
await process().catch(e => {
(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
});
this.unverifying = false;
@ -99,11 +99,11 @@ export default Vue.extend({
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.suspendUsername));
await (this as any).os.api('admin/suspend-user', { userId: user.id });
(this as any).os.apis.dialog({ text: '%i18n:@suspended%' });
//(this as any).os.apis.dialog({ text: '%i18n:@suspended%' });
};
await process().catch(e => {
(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
});
this.suspending = false;
@ -115,11 +115,11 @@ export default Vue.extend({
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.unsuspendUsername));
await (this as any).os.api('admin/unsuspend-user', { userId: user.id });
(this as any).os.apis.dialog({ text: '%i18n:@unsuspended%' });
//(this as any).os.apis.dialog({ text: '%i18n:@unsuspended%' });
};
await process().catch(e => {
(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
});
this.unsuspending = false;
@ -127,3 +127,10 @@ export default Vue.extend({
}
});
</script>
<style lang="stylus" scoped>
.ucnffhbtogqgscfmqcymwmmupoknpfsw
@media (min-width 500px)
padding 16px
</style>

View File

@ -42,7 +42,7 @@ import Reversi from './games/reversi/reversi.vue';
import welcomeTimeline from './welcome-timeline.vue';
import uiInput from './ui/input.vue';
import uiButton from './ui/button.vue';
import uiButtonGroup from './ui/button-group.vue';
import uiHorizonGroup from './ui/horizon-group.vue';
import uiCard from './ui/card.vue';
import uiForm from './ui/form.vue';
import uiTextarea from './ui/textarea.vue';
@ -95,7 +95,7 @@ Vue.component('mk-reversi', Reversi);
Vue.component('mk-welcome-timeline', welcomeTimeline);
Vue.component('ui-input', uiInput);
Vue.component('ui-button', uiButton);
Vue.component('ui-button-group', uiButtonGroup);
Vue.component('ui-horizon-group', uiHorizonGroup);
Vue.component('ui-card', uiCard);
Vue.component('ui-form', uiForm);
Vue.component('ui-textarea', uiTextarea);

View File

@ -1,21 +0,0 @@
<template>
<div class="pfzekjfwkwvadvlujpdnnxfggqgqjoze">
<slot></slot>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({});
</script>
<style lang="stylus" scoped>
.pfzekjfwkwvadvlujpdnnxfggqgqjoze
display flex
> *
flex 1
&:not(:last-child)
margin-right 16px
</style>

View File

@ -1,5 +1,10 @@
<template>
<component class="dmtdnykelhudezerjlfpbhgovrgnqqgr" :is="link ? 'a' : 'button'" :class="[styl, { inline, primary }]" :type="type" @click="$emit('click')">
<component class="dmtdnykelhudezerjlfpbhgovrgnqqgr"
:is="link ? 'a' : 'button'"
:class="[styl, { inline, primary }]"
:type="type"
@click="$emit('click')"
>
<slot></slot>
</component>
</template>
@ -7,6 +12,7 @@
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
inject: ['horizonGrouped'],
props: {
type: {
type: String,
@ -20,7 +26,9 @@ export default Vue.extend({
inline: {
type: Boolean,
required: false,
default: false
default(): boolean {
return this.horizonGrouped;
}
},
link: {
type: Boolean,

View File

@ -0,0 +1,35 @@
<template>
<div class="pfzekjfwkwvadvlujpdnnxfggqgqjoze" :class="{ inputs }">
<slot></slot>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
provide: {
horizonGrouped: true
},
props: {
inputs: {
type: Boolean,
required: false,
default: false
}
}
});
</script>
<style lang="stylus" scoped>
.pfzekjfwkwvadvlujpdnnxfggqgqjoze
display flex
&.inputs
margin 32px 0
> *
flex 1
&:not(:last-child)
margin-right 16px
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="ui-input" :class="[{ focused, filled }, styl]">
<div class="ui-input" :class="[{ focused, filled, inline }, styl]">
<div class="icon" ref="icon"><slot name="icon"></slot></div>
<div class="input">
<div class="password-meter" v-if="withPasswordMeter" v-show="passwordStrength != ''" :data-strength="passwordStrength">
@ -41,6 +41,7 @@ import Vue from 'vue';
const getPasswordStrength = require('syuilo-password-strength');
export default Vue.extend({
inject: ['horizonGrouped'],
props: {
value: {
required: false
@ -72,6 +73,13 @@ export default Vue.extend({
required: false,
default: false
},
inline: {
type: Boolean,
required: false,
default(): boolean {
return this.horizonGrouped;
}
},
styl: {
type: String,
required: false,
@ -337,4 +345,8 @@ root(fill)
&:not(.fill)
root(false)
&.inline
display inline-block
margin 0
</style>

View File

@ -14,7 +14,7 @@
</div>
</header>
<div class="text">
<misskey-flavored-markdown v-if="note.text" :text="note.text" :customEmojis="p.emojis"/>
<misskey-flavored-markdown v-if="note.text" :text="note.text" :customEmojis="note.emojis"/>
</div>
</div>
</div>

View File

@ -31,7 +31,7 @@
<p>%fa:cog%<span>%i18n:@settings%</span>%fa:angle-right%</p>
</li>
<li v-if="$store.state.i.isAdmin">
<router-link to="/admin">%fa:terminal%<span>%i18n:@admin%</span>%fa:angle-right%</router-link>
<a href="/admin">%fa:terminal%<span>%i18n:@admin%</span>%fa:angle-right%</a>
</li>
</ul>
<ul>

View File

@ -30,7 +30,7 @@
<ul>
<li><a @click="search">%fa:search%%i18n:@search%%fa:angle-right%</a></li>
<li><router-link to="/i/settings" :data-active="$route.name == 'settings'">%fa:cog%%i18n:@settings%%fa:angle-right%</router-link></li>
<li v-if="$store.getters.isSignedIn && $store.state.i.isAdmin"><router-link to="/admin">%fa:terminal%<span>%i18n:@admin%</span>%fa:angle-right%</router-link></li>
<li v-if="$store.getters.isSignedIn && $store.state.i.isAdmin"><a href="/admin">%fa:terminal%<span>%i18n:@admin%</span>%fa:angle-right%</a></li>
<li @click="dark"><p><template v-if="$store.state.device.darkmode">%fa:moon%</template><template v-else>%fa:R moon%</template><span>%i18n:@darkmode%</span></p></li>
</ul>
</div>

View File

@ -215,5 +215,11 @@
reversiGameEmptyCell: ':lighten<2<$secondary',
reversiGameEmptyCellMyTurn: ':lighten<5<$secondary',
reversiGameEmptyCellCanPut: ':lighten<4<$secondary',
adminDashboardHeaderFg: ':alpha<0.9<$text',
adminDashboardHeaderBorder: 'rgba(0, 0, 0, 0.3)',
adminDashboardCardBg: '$secondary',
adminDashboardCardFg: '$text',
adminDashboardCardDivider: 'rgba(0, 0, 0, 0.3)',
},
}

View File

@ -215,5 +215,11 @@
reversiGameEmptyCell: 'rgba(0, 0, 0, 0.06)',
reversiGameEmptyCellMyTurn: 'rgba(0, 0, 0, 0.12)',
reversiGameEmptyCellCanPut: 'rgba(0, 0, 0, 0.9)',
adminDashboardHeaderFg: ':alpha<0.9<$text',
adminDashboardHeaderBorder: 'rgba(0, 0, 0, 0.1)',
adminDashboardCardBg: '$secondary',
adminDashboardCardFg: '$text',
adminDashboardCardDivider: 'rgba(0, 0, 0, 0.082)',
},
}

View File

@ -9,7 +9,7 @@ export type TextElementEmoji = {
};
export default function(text: string) {
const match = text.match(/^:([a-zA-Z0-9+-_]+?):/);
const match = text.match(/^:([a-zA-Z0-9+_-]+):/);
if (!match) return null;
const emoji = match[0];
return {

View File

@ -1,3 +1,4 @@
import * as mongo from 'mongodb';
import db from '../db/mongodb';
const Emoji = db.get<IEmoji>('emoji');
@ -8,20 +9,10 @@ Emoji.createIndex(['name', 'host'], { unique: true });
export default Emoji;
export type IEmoji = {
_id: mongo.ObjectID;
name: string;
host: string;
url: string;
aliases?: string[];
updatedAt?: Date;
};
export const packEmojis = async (
host: string,
// MeiTODO: filter
) => {
return await Emoji.find({ host }, {
fields: {
_id: false
}
});
};

View File

@ -12,7 +12,7 @@ import { packMany as packFileMany, IDriveFile } from './drive-file';
import Favorite from './favorite';
import Following from './following';
import config from '../config';
import { packEmojis } from './emoji';
import Emoji from './emoji';
const Note = db.get<INote>('notes');
Note.createIndex('uri', { sparse: true, unique: true });
@ -50,6 +50,7 @@ export type INote = {
text: string;
tags: string[];
tagsLower: string[];
emojis: string[];
cw: string;
userId: mongo.ObjectID;
appId: mongo.ObjectID;
@ -231,7 +232,22 @@ export const pack = async (
// _note._userを消す前か、_note.userを解決した後でないとホストがわからない
if (_note._user) {
_note.emojis = packEmojis(_note._user.host);
const host = _note._user.host;
// 互換性のため。(古いMisskeyではNoteにemojisが無い)
if (_note.emojis == null) {
_note.emojis = Emoji.find({
host: host
}, {
fields: { _id: false }
});
} else {
_note.emojis = Emoji.find({
name: { $in: _note.emojis },
host: host
}, {
fields: { _id: false }
});
}
}
// Rename _id to id

View File

@ -4,7 +4,7 @@ import parse from '../../../mfm/parse';
export default function(note: INote) {
let html = toHtml(parse(note.text), note.mentionedRemoteUsers);
if (html == null) html = '';
if (html == null) html = '<p>.</p>';
return html;
}

View File

@ -1,6 +1,6 @@
import $ from 'cafy';
import Emoji from '../../../../models/emoji';
import define from '../../define';
import Emoji from '../../../../../models/emoji';
import define from '../../../define';
export const meta = {
desc: {
@ -27,12 +27,15 @@ export const meta = {
};
export default define(meta, (ps) => new Promise(async (res, rej) => {
await Emoji.insert({
const emoji = await Emoji.insert({
updatedAt: new Date(),
name: ps.name,
host: null,
aliases: ps.aliases,
url: ps.url
});
res();
res({
id: emoji._id
});
}));

View File

@ -0,0 +1,33 @@
import $ from 'cafy';
import Emoji from '../../../../../models/emoji';
import define from '../../../define';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を取得します。'
},
requireCredential: true,
requireAdmin: true,
params: {
host: {
validator: $.str.optional.nullable,
default: null as any
}
}
};
export default define(meta, (ps) => new Promise(async (res, rej) => {
const emojis = await Emoji.find({
host: ps.host
});
res(emojis.map(e => ({
id: e._id,
name: e.name,
aliases: e.aliases,
host: e.host,
url: e.url
})));
}));

View File

@ -0,0 +1,31 @@
import $ from 'cafy';
import Emoji from '../../../../../models/emoji';
import define from '../../../define';
import ID from '../../../../../misc/cafy-id';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を削除します。'
},
requireCredential: true,
requireAdmin: true,
params: {
id: {
validator: $.type(ID)
}
}
};
export default define(meta, (ps) => new Promise(async (res, rej) => {
const emoji = await Emoji.findOne({
_id: ps.id
});
if (emoji == null) return rej('emoji not found');
await Emoji.remove({ _id: emoji._id });
res();
}));

View File

@ -0,0 +1,50 @@
import $ from 'cafy';
import Emoji from '../../../../../models/emoji';
import define from '../../../define';
import ID from '../../../../../misc/cafy-id';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を更新します。'
},
requireCredential: true,
requireAdmin: true,
params: {
id: {
validator: $.type(ID)
},
name: {
validator: $.str
},
url: {
validator: $.str
},
aliases: {
validator: $.arr($.str)
}
}
};
export default define(meta, (ps) => new Promise(async (res, rej) => {
const emoji = await Emoji.findOne({
_id: ps.id
});
if (emoji == null) return rej('emoji not found');
await Emoji.update({ _id: emoji._id }, {
$set: {
updatedAt: new Date(),
name: ps.name,
aliases: ps.aliases,
url: ps.url
}
});
res();
}));

View File

@ -21,7 +21,7 @@ export const meta = {
export default define(meta, (ps, user) => new Promise(async (res, rej) => {
const x: any = {};
x[`clientSettings.${name}`] = ps.value;
x[`clientSettings.${ps.name}`] = ps.value;
await User.update(user._id, {
$set: x
@ -31,7 +31,7 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
// Publish event
publishMainStream(user._id, 'clientSettingUpdated', {
key: name,
key: ps.name,
value: ps.value
});
}));

View File

@ -30,6 +30,7 @@ import { erase, unique } from '../../prelude/array';
import insertNoteUnread from './unread';
import registerInstance from '../register-instance';
import Instance from '../../models/instance';
import { TextElementEmoji } from '../../mfm/parse/elements/emoji';
type NotificationType = 'reply' | 'renote' | 'quote' | 'mention';
@ -146,6 +147,8 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
const tags = extractHashtags(tokens);
const emojis = extractEmojis(tokens);
const mentionedUsers = await extractMentionedUsers(tokens);
if (data.reply && !user._id.equals(data.reply.userId) && !mentionedUsers.some(u => u._id.equals(data.reply.userId))) {
@ -160,7 +163,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
});
}
const note = await insertNote(user, data, tags, mentionedUsers);
const note = await insertNote(user, data, tags, emojis, mentionedUsers);
res(note);
@ -371,7 +374,7 @@ async function publish(user: IUser, note: INote, noteObj: any, reply: INote, ren
publishToUserLists(note, noteObj);
}
async function insertNote(user: IUser, data: Option, tags: string[], mentionedUsers: IUser[]) {
async function insertNote(user: IUser, data: Option, tags: string[], emojis: string[], mentionedUsers: IUser[]) {
const insert: any = {
createdAt: data.createdAt,
fileIds: data.files ? data.files.map(file => file._id) : [],
@ -382,6 +385,7 @@ async function insertNote(user: IUser, data: Option, tags: string[], mentionedUs
cw: data.cw == null ? null : data.cw,
tags,
tagsLower: tags.map(tag => tag.toLowerCase()),
emojis,
userId: user._id,
viaMobile: data.viaMobile,
geo: data.geo || null,
@ -449,6 +453,16 @@ function extractHashtags(tokens: ReturnType<typeof parse>): string[] {
return unique(hashtags);
}
function extractEmojis(tokens: ReturnType<typeof parse>): string[] {
// Extract emojis
const emojis = tokens
.filter(t => t.type == 'emoji')
.map(t => (t as TextElementEmoji).emoji)
.filter(emoji => emoji.length <= 100);
return unique(emojis);
}
function index(note: INote) {
if (note.text == null || config.elasticsearch == null) return;