Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
f44c2a3e4f | |||
1fad3cbaae | |||
40d2e3e97c | |||
2efabe612e | |||
3107cbd6b9 | |||
3a061ed1c3 | |||
d4f0e6461a | |||
3285687652 | |||
51c53f64d0 | |||
1d582f5ad2 | |||
8a62748e39 | |||
6db3d6dfb6 |
@ -83,17 +83,17 @@ common:
|
|||||||
pudding: "Pudding"
|
pudding: "Pudding"
|
||||||
note-visibility:
|
note-visibility:
|
||||||
public: "Public"
|
public: "Public"
|
||||||
home: "Accueil"
|
home: "Principal"
|
||||||
home-desc: "Publier sur le fil local uniquement"
|
home-desc: "Publier sur le fil principal uniquement"
|
||||||
followers: "Abonnés·es"
|
followers: "Abonnés·es"
|
||||||
followers-desc: "Publier à vos abonnés·es uniquement"
|
followers-desc: "Publier à vos abonnés·es uniquement"
|
||||||
specified: "Direct"
|
specified: "Direct"
|
||||||
specified-desc: "Publier aux utilisateurs·trices mentionnés·es"
|
specified-desc: "Publier uniquement aux utilisateurs·rices mentionnés·es"
|
||||||
private: "Privé"
|
private: "Privé"
|
||||||
note-placeholders:
|
note-placeholders:
|
||||||
a: "Que faites-vous maintenant ?"
|
a: "Que faites-vous maintenant ?"
|
||||||
b: "Quoi de neuf ?"
|
b: "Quoi de neuf ?"
|
||||||
c: "Qu'avez-vous en tête ?"
|
c: "Qu’avez-vous en tête ?"
|
||||||
d: "Désirez-vous publier quelques mots ?"
|
d: "Désirez-vous publier quelques mots ?"
|
||||||
e: "Écrivez ici"
|
e: "Écrivez ici"
|
||||||
f: "En attente de vos écrits"
|
f: "En attente de vos écrits"
|
||||||
@ -103,7 +103,7 @@ common:
|
|||||||
ok: "OK"
|
ok: "OK"
|
||||||
update-available-title: "Mise à jour disponible"
|
update-available-title: "Mise à jour disponible"
|
||||||
update-available: "Une nouvelle version de Misskey est disponible ({newer}, version actuelle: {current}). Veuillez recharger la page pour appliquer la mise à jour."
|
update-available: "Une nouvelle version de Misskey est disponible ({newer}, version actuelle: {current}). Veuillez recharger la page pour appliquer la mise à jour."
|
||||||
my-token-regenerated: "Votre token vient d'être généré, vous allez maintenant être déconnecté."
|
my-token-regenerated: "Votre jeton vient d’être généré, vous allez maintenant être déconnecté."
|
||||||
i-like-sushi: "Je préfère les sushis plutôt que le pudding"
|
i-like-sushi: "Je préfère les sushis plutôt que le pudding"
|
||||||
show-reversi-board-labels: "Afficher les étiquettes des lignes et colonnes dans Reversi"
|
show-reversi-board-labels: "Afficher les étiquettes des lignes et colonnes dans Reversi"
|
||||||
use-contrast-reversi-stones: "リバーシのアイコンにコントラストを付ける"
|
use-contrast-reversi-stones: "リバーシのアイコンにコントラストを付ける"
|
||||||
@ -120,7 +120,7 @@ common:
|
|||||||
my-turn: "C’est votre tour"
|
my-turn: "C’est votre tour"
|
||||||
opponent-turn: "Tour de l’adversaire"
|
opponent-turn: "Tour de l’adversaire"
|
||||||
turn-of: "C’est le tour de {}"
|
turn-of: "C’est le tour de {}"
|
||||||
past-turn-of: "C'est au tour de {}"
|
past-turn-of: "C’est au tour de {}"
|
||||||
won: "{} a gagné"
|
won: "{} a gagné"
|
||||||
black: "Noirs"
|
black: "Noirs"
|
||||||
white: "Blancs"
|
white: "Blancs"
|
||||||
@ -267,8 +267,8 @@ common/views/components/media-banner.vue:
|
|||||||
common/views/components/theme.vue:
|
common/views/components/theme.vue:
|
||||||
light-theme: "非ダークモード時に使用するテーマ"
|
light-theme: "非ダークモード時に使用するテーマ"
|
||||||
dark-theme: "ダークモード時に使用するテーマ"
|
dark-theme: "ダークモード時に使用するテーマ"
|
||||||
light-themes: "明るいテーマ"
|
light-themes: "Thème clair"
|
||||||
dark-themes: "暗いテーマ"
|
dark-themes: "Thème sombre"
|
||||||
install-a-theme: "Installer un thème"
|
install-a-theme: "Installer un thème"
|
||||||
theme-code: "Code du thème"
|
theme-code: "Code du thème"
|
||||||
install: "Installation"
|
install: "Installation"
|
||||||
@ -286,16 +286,16 @@ common/views/components/theme.vue:
|
|||||||
invalid-theme: "Thème n’est pas valide."
|
invalid-theme: "Thème n’est pas valide."
|
||||||
already-installed: "Le thème est déjà installé."
|
already-installed: "Le thème est déjà installé."
|
||||||
saved: "enregistré"
|
saved: "enregistré"
|
||||||
manage-themes: "テーマの管理"
|
manage-themes: "Gestion des thèmes"
|
||||||
builtin-themes: "標準テーマ"
|
builtin-themes: "Thèmes standards"
|
||||||
my-themes: "マイテーマ"
|
my-themes: "Mes thèmes"
|
||||||
installed-themes: "Thèmes installés"
|
installed-themes: "Thèmes installés"
|
||||||
select-theme: "Veuillez sélectionner un thème"
|
select-theme: "Veuillez sélectionner un thème"
|
||||||
uninstall: "Désinstaller"
|
uninstall: "Désinstaller"
|
||||||
uninstalled: "« {} » a été désinstallé"
|
uninstalled: "« {} » a été désinstallé"
|
||||||
author: "Auteur"
|
author: "Auteur"
|
||||||
desc: "Description"
|
desc: "Description"
|
||||||
export: "エクスポート"
|
export: "Exporter"
|
||||||
import: "Importer"
|
import: "Importer"
|
||||||
import-by-code: "Ou coller du code"
|
import-by-code: "Ou coller du code"
|
||||||
theme-name-required: "Nom du thème est obligatoire."
|
theme-name-required: "Nom du thème est obligatoire."
|
||||||
@ -329,8 +329,8 @@ common/views/components/nav.vue:
|
|||||||
wiki: "Wiki"
|
wiki: "Wiki"
|
||||||
donors: "Donateur·rice·s"
|
donors: "Donateur·rice·s"
|
||||||
repository: "Dépôt"
|
repository: "Dépôt"
|
||||||
develop: "Développeur·se·s"
|
develop: "Développeurs"
|
||||||
feedback: "Remarques"
|
feedback: "Suggestions"
|
||||||
common/views/components/note-menu.vue:
|
common/views/components/note-menu.vue:
|
||||||
detail: "Détails"
|
detail: "Détails"
|
||||||
copy-link: "Copier le lien"
|
copy-link: "Copier le lien"
|
||||||
@ -410,10 +410,10 @@ common/views/components/visibility-chooser.vue:
|
|||||||
followers: "Abonné·e·s"
|
followers: "Abonné·e·s"
|
||||||
followers-desc: "Publier à vos abonné·e·s uniquement"
|
followers-desc: "Publier à vos abonné·e·s uniquement"
|
||||||
specified: "Direct"
|
specified: "Direct"
|
||||||
specified-desc: "Publier aux utilisateur·rice·s mentionné·e·s"
|
specified-desc: "Publier uniquement aux utilisateurs·rices mentionné·e·s"
|
||||||
private: "Privé"
|
private: "Privé"
|
||||||
common/views/components/trends.vue:
|
common/views/components/trends.vue:
|
||||||
count: "{} utilisateurs·trices mentionnés·es"
|
count: "{} utilisateurs·rices mentionnés·es"
|
||||||
empty: "Aucune tendance"
|
empty: "Aucune tendance"
|
||||||
common/views/widgets/broadcast.vue:
|
common/views/widgets/broadcast.vue:
|
||||||
fetching: "Récupération"
|
fetching: "Récupération"
|
||||||
@ -514,7 +514,7 @@ desktop/views/components/charts.vue:
|
|||||||
notes: "投稿の増減 (統合)"
|
notes: "投稿の増減 (統合)"
|
||||||
local-notes: "投稿の増減 (ローカル)"
|
local-notes: "投稿の増減 (ローカル)"
|
||||||
remote-notes: "投稿の増減 (リモート)"
|
remote-notes: "投稿の増減 (リモート)"
|
||||||
notes-total: "投稿の積算"
|
notes-total: "Total des notes"
|
||||||
users: "Nombre d’utilisateurs·trices : augmentation/diminution"
|
users: "Nombre d’utilisateurs·trices : augmentation/diminution"
|
||||||
users-total: "ユーザーの積算"
|
users-total: "ユーザーの積算"
|
||||||
drive: "ドライブ使用量の増減"
|
drive: "ドライブ使用量の増減"
|
||||||
@ -858,7 +858,7 @@ desktop/views/components/timeline.vue:
|
|||||||
list-name: "Nom de la liste"
|
list-name: "Nom de la liste"
|
||||||
desktop/views/components/ui.header.vue:
|
desktop/views/components/ui.header.vue:
|
||||||
welcome-back: "Content de vous revoir !"
|
welcome-back: "Content de vous revoir !"
|
||||||
adjective: "さん"
|
adjective: "M."
|
||||||
desktop/views/components/ui.header.account.vue:
|
desktop/views/components/ui.header.account.vue:
|
||||||
profile: "Votre profil"
|
profile: "Votre profil"
|
||||||
drive: "Drive"
|
drive: "Drive"
|
||||||
@ -911,9 +911,9 @@ desktop/views/pages/admin/admin.vue:
|
|||||||
desktop/views/pages/admin/admin.dashboard.vue:
|
desktop/views/pages/admin/admin.dashboard.vue:
|
||||||
dashboard: "Tableau de bord"
|
dashboard: "Tableau de bord"
|
||||||
all-users: "Toutes les utilisateurrices"
|
all-users: "Toutes les utilisateurrices"
|
||||||
original-users: "Utilisateurrices sur cette instance"
|
original-users: "Utilisateur·rice·s sur cette instance"
|
||||||
all-notes: "Toutes les publications"
|
all-notes: "Toutes les publications"
|
||||||
original-notes: "Publication sur cette instance"
|
original-notes: "Publications sur cette instance"
|
||||||
invite: "Invitation"
|
invite: "Invitation"
|
||||||
desktop/views/pages/admin/admin.suspend-user.vue:
|
desktop/views/pages/admin/admin.suspend-user.vue:
|
||||||
suspend-user: "Suspendre un·e utilisateur·rice"
|
suspend-user: "Suspendre un·e utilisateur·rice"
|
||||||
@ -941,9 +941,9 @@ desktop/views/pages/deck/deck.note.vue:
|
|||||||
deleted: "cette publication a été supprimée"
|
deleted: "cette publication a été supprimée"
|
||||||
desktop/views/pages/stats/stats.vue:
|
desktop/views/pages/stats/stats.vue:
|
||||||
all-users: "Toutes les utilisateurrices"
|
all-users: "Toutes les utilisateurrices"
|
||||||
original-users: "Utilisateurrices sur cette instance"
|
original-users: "Utilisateur·rice·s sur cette instance"
|
||||||
all-notes: "Toutes les publications"
|
all-notes: "Toutes les publications"
|
||||||
original-notes: "Publication sur cette instance"
|
original-notes: "Publications sur cette instance"
|
||||||
desktop/views/pages/welcome.vue:
|
desktop/views/pages/welcome.vue:
|
||||||
about: "à propos"
|
about: "à propos"
|
||||||
gotit: "J'ai compris !"
|
gotit: "J'ai compris !"
|
||||||
@ -986,13 +986,13 @@ desktop/views/pages/user/user.followers-you-know.vue:
|
|||||||
loading: "Chargement en cours"
|
loading: "Chargement en cours"
|
||||||
no-users: "Pas d'utilisateurs"
|
no-users: "Pas d'utilisateurs"
|
||||||
desktop/views/pages/user/user.friends.vue:
|
desktop/views/pages/user/user.friends.vue:
|
||||||
title: "Personnes qui répondent le plus"
|
title: "Mentions fréquentes"
|
||||||
loading: "Chargement en cours"
|
loading: "Chargement en cours"
|
||||||
no-users: "Pas d'utilisateurs"
|
no-users: "Pas d'utilisateurs"
|
||||||
desktop/views/pages/user/user.vue:
|
desktop/views/pages/user/user.vue:
|
||||||
is-suspended: "Ce compte a été suspendu."
|
is-suspended: "Ce compte a été suspendu."
|
||||||
is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées"
|
is-remote: "Cet utilisateur n'est pas un utilisateur Misskey. Certaines informations peuvent ne pas refléter ce profil dans sa totalité."
|
||||||
view-remote: "Voir les informations détaillées"
|
view-remote: "Consulter le profil complet"
|
||||||
desktop/views/pages/user/user.home.vue:
|
desktop/views/pages/user/user.home.vue:
|
||||||
last-used-at: "Last used at"
|
last-used-at: "Last used at"
|
||||||
desktop/views/pages/user/user.photos.vue:
|
desktop/views/pages/user/user.photos.vue:
|
||||||
@ -1000,7 +1000,7 @@ desktop/views/pages/user/user.photos.vue:
|
|||||||
loading: "Chargement en cours"
|
loading: "Chargement en cours"
|
||||||
no-photos: "Pas de photos"
|
no-photos: "Pas de photos"
|
||||||
desktop/views/pages/user/user.profile.vue:
|
desktop/views/pages/user/user.profile.vue:
|
||||||
follows-you: "Vous suis"
|
follows-you: "Vous suit"
|
||||||
stalk: "Traquer"
|
stalk: "Traquer"
|
||||||
stalking: "ストーキングしています"
|
stalking: "ストーキングしています"
|
||||||
unstalk: "ストーク解除"
|
unstalk: "ストーク解除"
|
||||||
@ -1171,7 +1171,7 @@ mobile/views/pages/drive.vue:
|
|||||||
drive: "Drive"
|
drive: "Drive"
|
||||||
more: "Afficher plus ..."
|
more: "Afficher plus ..."
|
||||||
mobile/views/pages/signup.vue:
|
mobile/views/pages/signup.vue:
|
||||||
lets-start: "Commençons ! 📦"
|
lets-start: "Votre compte est prêt ! 📦"
|
||||||
mobile/views/pages/followers.vue:
|
mobile/views/pages/followers.vue:
|
||||||
followers-of: "Abonné·e·s de {}"
|
followers-of: "Abonné·e·s de {}"
|
||||||
mobile/views/pages/following.vue:
|
mobile/views/pages/following.vue:
|
||||||
@ -1286,7 +1286,7 @@ mobile/views/pages/settings.vue:
|
|||||||
sound: "Sons"
|
sound: "Sons"
|
||||||
enable-sounds: "Activer les sons"
|
enable-sounds: "Activer les sons"
|
||||||
mobile/views/pages/user.vue:
|
mobile/views/pages/user.vue:
|
||||||
follows-you: "vous suit"
|
follows-you: "Vous suit"
|
||||||
following: "Abonnements"
|
following: "Abonnements"
|
||||||
followers: "Abonné·e·s"
|
followers: "Abonné·e·s"
|
||||||
notes: "Notes"
|
notes: "Notes"
|
||||||
@ -1294,8 +1294,8 @@ mobile/views/pages/user.vue:
|
|||||||
timeline: "Fil d'actualité"
|
timeline: "Fil d'actualité"
|
||||||
media: "Media"
|
media: "Media"
|
||||||
is-suspended: "This account has been suspended."
|
is-suspended: "This account has been suspended."
|
||||||
is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées "
|
is-remote: "Ceci est le profil d’un utilisateur·rice distant·e. Certaines informations peuvent ne pas refléter ce profil dans sa totalité."
|
||||||
view-remote: "Voir les informations détaillées"
|
view-remote: "Consulter son profil complet"
|
||||||
mobile/views/pages/user/home.vue:
|
mobile/views/pages/user/home.vue:
|
||||||
recent-notes: "Notes récentes"
|
recent-notes: "Notes récentes"
|
||||||
images: "Images"
|
images: "Images"
|
||||||
@ -1319,7 +1319,7 @@ mobile/views/pages/user/home.photos.vue:
|
|||||||
no-photos: "Pas de photos"
|
no-photos: "Pas de photos"
|
||||||
docs:
|
docs:
|
||||||
edit-this-page-on-github: "Vous avez trouvé une erreur ou vous voulez contribuer à la documentation?"
|
edit-this-page-on-github: "Vous avez trouvé une erreur ou vous voulez contribuer à la documentation?"
|
||||||
edit-this-page-on-github-link: "Modifiez cette page sur github!"
|
edit-this-page-on-github-link: "Éditez cette page sur Github !"
|
||||||
api:
|
api:
|
||||||
entities:
|
entities:
|
||||||
properties: "Propriétés"
|
properties: "Propriétés"
|
||||||
|
14
package.json
14
package.json
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "10.5.0",
|
"version": "10.6.0",
|
||||||
"clientVersion": "1.0.10405",
|
"clientVersion": "1.0.10417",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
@ -48,7 +48,7 @@
|
|||||||
"@types/koa-bodyparser": "5.0.1",
|
"@types/koa-bodyparser": "5.0.1",
|
||||||
"@types/koa-compress": "2.0.8",
|
"@types/koa-compress": "2.0.8",
|
||||||
"@types/koa-favicon": "2.0.19",
|
"@types/koa-favicon": "2.0.19",
|
||||||
"@types/koa-logger": "3.1.0",
|
"@types/koa-logger": "3.1.1",
|
||||||
"@types/koa-mount": "3.0.1",
|
"@types/koa-mount": "3.0.1",
|
||||||
"@types/koa-multer": "1.0.0",
|
"@types/koa-multer": "1.0.0",
|
||||||
"@types/koa-router": "7.0.32",
|
"@types/koa-router": "7.0.32",
|
||||||
@ -58,9 +58,9 @@
|
|||||||
"@types/minio": "7.0.0",
|
"@types/minio": "7.0.0",
|
||||||
"@types/mkdirp": "0.5.2",
|
"@types/mkdirp": "0.5.2",
|
||||||
"@types/mocha": "5.2.3",
|
"@types/mocha": "5.2.3",
|
||||||
"@types/mongodb": "3.1.11",
|
"@types/mongodb": "3.1.12",
|
||||||
"@types/ms": "0.7.30",
|
"@types/ms": "0.7.30",
|
||||||
"@types/node": "10.11.5",
|
"@types/node": "10.11.6",
|
||||||
"@types/portscanner": "2.1.0",
|
"@types/portscanner": "2.1.0",
|
||||||
"@types/pug": "2.0.4",
|
"@types/pug": "2.0.4",
|
||||||
"@types/qrcode": "1.3.0",
|
"@types/qrcode": "1.3.0",
|
||||||
@ -78,7 +78,7 @@
|
|||||||
"@types/tinycolor2": "1.4.1",
|
"@types/tinycolor2": "1.4.1",
|
||||||
"@types/tmp": "0.0.33",
|
"@types/tmp": "0.0.33",
|
||||||
"@types/uuid": "3.4.4",
|
"@types/uuid": "3.4.4",
|
||||||
"@types/webpack": "4.4.15",
|
"@types/webpack": "4.4.16",
|
||||||
"@types/webpack-stream": "3.2.10",
|
"@types/webpack-stream": "3.2.10",
|
||||||
"@types/websocket": "0.0.40",
|
"@types/websocket": "0.0.40",
|
||||||
"@types/ws": "6.0.1",
|
"@types/ws": "6.0.1",
|
||||||
@ -206,7 +206,7 @@
|
|||||||
"typescript": "2.9.2",
|
"typescript": "2.9.2",
|
||||||
"typescript-eslint-parser": "20.0.0",
|
"typescript-eslint-parser": "20.0.0",
|
||||||
"uglify-es": "3.3.9",
|
"uglify-es": "3.3.9",
|
||||||
"url-loader": "1.1.1",
|
"url-loader": "1.1.2",
|
||||||
"uuid": "3.3.2",
|
"uuid": "3.3.2",
|
||||||
"v-animate-css": "0.0.2",
|
"v-animate-css": "0.0.2",
|
||||||
"vue": "2.5.17",
|
"vue": "2.5.17",
|
||||||
|
@ -131,15 +131,28 @@ pre
|
|||||||
[data-fa]
|
[data-fa]
|
||||||
display inline-block
|
display inline-block
|
||||||
|
|
||||||
|
.swal2-container
|
||||||
|
z-index 10000 !important
|
||||||
|
|
||||||
|
&.swal2-shown
|
||||||
|
background-color rgba(0, 0, 0, 0.5) !important
|
||||||
|
|
||||||
.swal2-popup
|
.swal2-popup
|
||||||
background var(--face) !important
|
background var(--face) !important
|
||||||
|
|
||||||
.swal-icon-only
|
.swal2-content
|
||||||
width 180px !important
|
color var(--text) !important
|
||||||
|
|
||||||
> .swal2-header
|
.swal2-confirm
|
||||||
> .swal2-icon
|
background-color var(--primary) !important
|
||||||
margin 1.25em auto 1.875em
|
border-left-color var(--primary) !important
|
||||||
|
border-right-color var(--primary) !important
|
||||||
|
color var(--primaryForeground) !important
|
||||||
|
|
||||||
> .swal2-title
|
&:hover
|
||||||
display none
|
background-image none !important
|
||||||
|
background-color var(--primaryDarken5) !important
|
||||||
|
|
||||||
|
&:active
|
||||||
|
background-image none !important
|
||||||
|
background-color var(--primaryDarken5) !important
|
||||||
|
@ -11,6 +11,7 @@ export default class Stream extends EventEmitter {
|
|||||||
private stream: ReconnectingWebsocket;
|
private stream: ReconnectingWebsocket;
|
||||||
private state: string;
|
private state: string;
|
||||||
private buffer: any[];
|
private buffer: any[];
|
||||||
|
private sharedConnectionPools: Pool[] = [];
|
||||||
private sharedConnections: SharedConnection[] = [];
|
private sharedConnections: SharedConnection[] = [];
|
||||||
private nonSharedConnections: NonSharedConnection[] = [];
|
private nonSharedConnections: NonSharedConnection[] = [];
|
||||||
|
|
||||||
@ -29,22 +30,21 @@ export default class Stream extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public useSharedConnection = (channel: string): SharedConnection => {
|
public useSharedConnection = (channel: string): SharedConnection => {
|
||||||
const existConnection = this.sharedConnections.find(c => c.channel === channel);
|
let pool = this.sharedConnectionPools.find(p => p.channel === channel);
|
||||||
|
|
||||||
if (existConnection) {
|
if (pool == null) {
|
||||||
existConnection.use();
|
pool = new Pool(this, channel);
|
||||||
return existConnection;
|
this.sharedConnectionPools.push(pool);
|
||||||
} else {
|
}
|
||||||
const connection = new SharedConnection(this, channel);
|
|
||||||
connection.use();
|
const connection = new SharedConnection(this, channel, pool);
|
||||||
this.sharedConnections.push(connection);
|
this.sharedConnections.push(connection);
|
||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
public removeSharedConnection(connection: SharedConnection) {
|
public removeSharedConnection(connection: SharedConnection) {
|
||||||
this.sharedConnections = this.sharedConnections.filter(c => c.id !== connection.id);
|
this.sharedConnections = this.sharedConnections.filter(c => c !== connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
public connectToChannel = (channel: string, params?: any): NonSharedConnection => {
|
public connectToChannel = (channel: string, params?: any): NonSharedConnection => {
|
||||||
@ -55,7 +55,7 @@ export default class Stream extends EventEmitter {
|
|||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
public disconnectToChannel(connection: NonSharedConnection) {
|
public disconnectToChannel(connection: NonSharedConnection) {
|
||||||
this.nonSharedConnections = this.nonSharedConnections.filter(c => c.id !== connection.id);
|
this.nonSharedConnections = this.nonSharedConnections.filter(c => c !== connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,8 +77,8 @@ export default class Stream extends EventEmitter {
|
|||||||
|
|
||||||
// チャンネル再接続
|
// チャンネル再接続
|
||||||
if (isReconnect) {
|
if (isReconnect) {
|
||||||
this.sharedConnections.forEach(c => {
|
this.sharedConnectionPools.forEach(p => {
|
||||||
c.connect();
|
p.connect();
|
||||||
});
|
});
|
||||||
this.nonSharedConnections.forEach(c => {
|
this.nonSharedConnections.forEach(c => {
|
||||||
c.connect();
|
c.connect();
|
||||||
@ -104,8 +104,18 @@ export default class Stream extends EventEmitter {
|
|||||||
|
|
||||||
if (type == 'channel') {
|
if (type == 'channel') {
|
||||||
const id = body.id;
|
const id = body.id;
|
||||||
const connection = this.sharedConnections.find(c => c.id === id) || this.nonSharedConnections.find(c => c.id === id);
|
|
||||||
connection.emit(body.type, body.body);
|
let connections: Connection[];
|
||||||
|
|
||||||
|
connections = this.sharedConnections.filter(c => c.id === id);
|
||||||
|
|
||||||
|
if (connections.length === 0) {
|
||||||
|
connections = [this.nonSharedConnections.find(c => c.id === id)];
|
||||||
|
}
|
||||||
|
|
||||||
|
connections.filter(c => c != null).forEach(c => {
|
||||||
|
c.emit(body.type, body.body);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.emit(type, body);
|
this.emit(type, body);
|
||||||
}
|
}
|
||||||
@ -140,19 +150,131 @@ export default class Stream extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class Connection extends EventEmitter {
|
class Pool {
|
||||||
public channel: string;
|
public channel: string;
|
||||||
public id: string;
|
public id: string;
|
||||||
protected params: any;
|
|
||||||
protected stream: Stream;
|
protected stream: Stream;
|
||||||
|
private users = 0;
|
||||||
|
private disposeTimerId: any;
|
||||||
|
private isConnected = false;
|
||||||
|
|
||||||
constructor(stream: Stream, channel: string, params?: any) {
|
constructor(stream: Stream, channel: string) {
|
||||||
|
this.channel = channel;
|
||||||
|
this.stream = stream;
|
||||||
|
|
||||||
|
this.id = Math.random().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public inc() {
|
||||||
|
if (this.users === 0 && !this.isConnected) {
|
||||||
|
this.connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.users++;
|
||||||
|
|
||||||
|
// タイマー解除
|
||||||
|
if (this.disposeTimerId) {
|
||||||
|
clearTimeout(this.disposeTimerId);
|
||||||
|
this.disposeTimerId = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public dec() {
|
||||||
|
this.users--;
|
||||||
|
|
||||||
|
// そのコネクションの利用者が誰もいなくなったら
|
||||||
|
if (this.users === 0) {
|
||||||
|
// また直ぐに再利用される可能性があるので、一定時間待ち、
|
||||||
|
// 新たな利用者が現れなければコネクションを切断する
|
||||||
|
this.disposeTimerId = setTimeout(() => {
|
||||||
|
this.disconnect();
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public connect() {
|
||||||
|
this.isConnected = true;
|
||||||
|
this.stream.send('connect', {
|
||||||
|
channel: this.channel,
|
||||||
|
id: this.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
private disconnect() {
|
||||||
|
this.isConnected = false;
|
||||||
|
this.disposeTimerId = null;
|
||||||
|
this.stream.send('disconnect', { id: this.id });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Connection extends EventEmitter {
|
||||||
|
public channel: string;
|
||||||
|
protected stream: Stream;
|
||||||
|
public abstract id: string;
|
||||||
|
|
||||||
|
constructor(stream: Stream, channel: string) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public send(id: string, typeOrPayload, payload?) {
|
||||||
|
const type = payload === undefined ? typeOrPayload.type : typeOrPayload;
|
||||||
|
const body = payload === undefined ? typeOrPayload.body : payload;
|
||||||
|
|
||||||
|
this.stream.send('ch', {
|
||||||
|
id: id,
|
||||||
|
type: type,
|
||||||
|
body: body
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract dispose(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SharedConnection extends Connection {
|
||||||
|
private pool: Pool;
|
||||||
|
|
||||||
|
public get id(): string {
|
||||||
|
return this.pool.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(stream: Stream, channel: string, pool: Pool) {
|
||||||
|
super(stream, channel);
|
||||||
|
|
||||||
|
this.pool = pool;
|
||||||
|
this.pool.inc();
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public send(typeOrPayload, payload?) {
|
||||||
|
super.send(this.pool.id, typeOrPayload, payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
|
public dispose() {
|
||||||
|
this.pool.dec();
|
||||||
|
this.removeAllListeners();
|
||||||
|
this.stream.removeSharedConnection(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NonSharedConnection extends Connection {
|
||||||
|
public id: string;
|
||||||
|
protected params: any;
|
||||||
|
|
||||||
|
constructor(stream: Stream, channel: string, params?: any) {
|
||||||
|
super(stream, channel);
|
||||||
|
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this.id = Math.random().toString();
|
this.id = Math.random().toString();
|
||||||
|
|
||||||
this.connect();
|
this.connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,59 +289,7 @@ abstract class Connection extends EventEmitter {
|
|||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
public send(typeOrPayload, payload?) {
|
public send(typeOrPayload, payload?) {
|
||||||
const type = payload === undefined ? typeOrPayload.type : typeOrPayload;
|
super.send(this.id, typeOrPayload, payload);
|
||||||
const body = payload === undefined ? typeOrPayload.body : payload;
|
|
||||||
|
|
||||||
this.stream.send('ch', {
|
|
||||||
id: this.id,
|
|
||||||
type: type,
|
|
||||||
body: body
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract dispose(): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SharedConnection extends Connection {
|
|
||||||
private users = 0;
|
|
||||||
private disposeTimerId: any;
|
|
||||||
|
|
||||||
constructor(stream: Stream, channel: string) {
|
|
||||||
super(stream, channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
@autobind
|
|
||||||
public use() {
|
|
||||||
this.users++;
|
|
||||||
|
|
||||||
// タイマー解除
|
|
||||||
if (this.disposeTimerId) {
|
|
||||||
clearTimeout(this.disposeTimerId);
|
|
||||||
this.disposeTimerId = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@autobind
|
|
||||||
public dispose() {
|
|
||||||
this.users--;
|
|
||||||
|
|
||||||
// そのコネクションの利用者が誰もいなくなったら
|
|
||||||
if (this.users === 0) {
|
|
||||||
// また直ぐに再利用される可能性があるので、一定時間待ち、
|
|
||||||
// 新たな利用者が現れなければコネクションを切断する
|
|
||||||
this.disposeTimerId = setTimeout(() => {
|
|
||||||
this.disposeTimerId = null;
|
|
||||||
this.removeAllListeners();
|
|
||||||
this.stream.send('disconnect', { id: this.id });
|
|
||||||
this.stream.removeSharedConnection(this);
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class NonSharedConnection extends Connection {
|
|
||||||
constructor(stream: Stream, channel: string, params?: any) {
|
|
||||||
super(stream, channel, params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
@ -71,7 +71,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.connection =((this as any).os.stream.connectToChannel('messaging', { otherparty: this.user.id });
|
this.connection = (this as any).os.stream.connectToChannel('messaging', { otherparty: this.user.id });
|
||||||
|
|
||||||
this.connection.on('message', this.onMessage);
|
this.connection.on('message', this.onMessage);
|
||||||
this.connection.on('read', this.onRead);
|
this.connection.on('read', this.onRead);
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { url } from '../../../config';
|
import { url } from '../../../config';
|
||||||
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
|
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
|
||||||
|
import Ok from './ok.vue';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
props: ['note', 'source', 'compact'],
|
props: ['note', 'source', 'compact'],
|
||||||
@ -78,6 +79,7 @@ export default Vue.extend({
|
|||||||
(this as any).api('i/pin', {
|
(this as any).api('i/pin', {
|
||||||
noteId: this.note.id
|
noteId: this.note.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
(this as any).os.new(Ok);
|
||||||
this.destroyDom();
|
this.destroyDom();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -103,12 +105,7 @@ export default Vue.extend({
|
|||||||
(this as any).api('notes/favorites/create', {
|
(this as any).api('notes/favorites/create', {
|
||||||
noteId: this.note.id
|
noteId: this.note.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$swal({
|
(this as any).os.new(Ok);
|
||||||
type: 'success',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 1250,
|
|
||||||
customClass: 'swal-icon-only'
|
|
||||||
});
|
|
||||||
this.destroyDom();
|
this.destroyDom();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
175
src/client/app/common/views/components/ok.vue
Normal file
175
src/client/app/common/views/components/ok.vue
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
<template>
|
||||||
|
<div class="yvbkymdqeusiqucuuloahhiqflzinufs">
|
||||||
|
<div class="bg" ref="bg"></div>
|
||||||
|
<div class="body" ref="body">
|
||||||
|
<div class="icon">
|
||||||
|
<div class="circle left"></div>
|
||||||
|
<span class="check tip"></span>
|
||||||
|
<span class="check long"></span>
|
||||||
|
<div class="ring"></div>
|
||||||
|
<div class="fix"></div>
|
||||||
|
<div class="circle right"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Vue from 'vue';
|
||||||
|
import * as anime from 'animejs';
|
||||||
|
|
||||||
|
export default Vue.extend({
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
anime({
|
||||||
|
targets: this.$refs.bg,
|
||||||
|
opacity: 1,
|
||||||
|
duration: 300,
|
||||||
|
easing: 'linear'
|
||||||
|
});
|
||||||
|
|
||||||
|
anime({
|
||||||
|
targets: this.$refs.body,
|
||||||
|
opacity: 1,
|
||||||
|
scale: [1.2, 1],
|
||||||
|
duration: 300,
|
||||||
|
easing: [0, 0.5, 0.5, 1]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
anime({
|
||||||
|
targets: this.$refs.bg,
|
||||||
|
opacity: 0,
|
||||||
|
duration: 300,
|
||||||
|
easing: 'linear'
|
||||||
|
});
|
||||||
|
|
||||||
|
anime({
|
||||||
|
targets: this.$refs.body,
|
||||||
|
opacity: 0,
|
||||||
|
scale: 0.8,
|
||||||
|
duration: 300,
|
||||||
|
easing: [0.5, 0, 1, 0.5],
|
||||||
|
complete: () => this.destroyDom()
|
||||||
|
});
|
||||||
|
}, 1250);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
.yvbkymdqeusiqucuuloahhiqflzinufs
|
||||||
|
pointer-events none
|
||||||
|
|
||||||
|
> .bg
|
||||||
|
display block
|
||||||
|
position fixed
|
||||||
|
z-index 10000
|
||||||
|
top 0
|
||||||
|
left 0
|
||||||
|
width 100%
|
||||||
|
height 100%
|
||||||
|
background rgba(#000, 0.7)
|
||||||
|
opacity 0
|
||||||
|
|
||||||
|
> .body
|
||||||
|
position fixed
|
||||||
|
z-index 10000
|
||||||
|
top 0
|
||||||
|
right 0
|
||||||
|
left 0
|
||||||
|
bottom 0
|
||||||
|
margin auto
|
||||||
|
width 150px
|
||||||
|
height 150px
|
||||||
|
background var(--face)
|
||||||
|
border-radius 8px
|
||||||
|
opacity 0
|
||||||
|
|
||||||
|
> .icon
|
||||||
|
display flex
|
||||||
|
justify-content center
|
||||||
|
position absolute
|
||||||
|
top 0
|
||||||
|
right 0
|
||||||
|
left 0
|
||||||
|
bottom 0
|
||||||
|
width 5em
|
||||||
|
height 5em
|
||||||
|
margin auto
|
||||||
|
border .25em solid transparent
|
||||||
|
border-radius 50%
|
||||||
|
line-height 5em
|
||||||
|
cursor default
|
||||||
|
box-sizing content-box
|
||||||
|
user-select none
|
||||||
|
zoom normal
|
||||||
|
border-color #a5dc86
|
||||||
|
|
||||||
|
> .circle
|
||||||
|
position absolute
|
||||||
|
width 3.75em
|
||||||
|
height 7.5em
|
||||||
|
transform rotate(45deg)
|
||||||
|
border-radius 50%
|
||||||
|
background var(--face)
|
||||||
|
|
||||||
|
&.left
|
||||||
|
top -.4375em
|
||||||
|
left -2.0635em
|
||||||
|
transform rotate(-45deg)
|
||||||
|
transform-origin 3.75em 3.75em
|
||||||
|
border-radius 7.5em 0 0 7.5em
|
||||||
|
|
||||||
|
&.right
|
||||||
|
top -.6875em
|
||||||
|
left 1.875em
|
||||||
|
transform rotate(-45deg)
|
||||||
|
transform-origin 0 3.75em
|
||||||
|
border-radius 0 7.5em 7.5em 0
|
||||||
|
animation swal2-rotate-success-circular-line 4.25s ease-in
|
||||||
|
|
||||||
|
> .check
|
||||||
|
display block
|
||||||
|
position absolute
|
||||||
|
height .3125em
|
||||||
|
border-radius .125em
|
||||||
|
background-color #a5dc86
|
||||||
|
z-index 2
|
||||||
|
|
||||||
|
&.tip
|
||||||
|
top 2.875em
|
||||||
|
left .875em
|
||||||
|
width 1.5625em
|
||||||
|
transform rotate(45deg)
|
||||||
|
animation swal2-animate-success-line-tip .75s
|
||||||
|
|
||||||
|
&.long
|
||||||
|
top 2.375em
|
||||||
|
right .5em
|
||||||
|
width 2.9375em
|
||||||
|
transform rotate(-45deg)
|
||||||
|
animation swal2-animate-success-line-long .75s
|
||||||
|
|
||||||
|
> .fix
|
||||||
|
position absolute
|
||||||
|
top .5em
|
||||||
|
left 1.625em
|
||||||
|
width .4375em
|
||||||
|
height 5.625em
|
||||||
|
transform rotate(-45deg)
|
||||||
|
z-index 1
|
||||||
|
background var(--face)
|
||||||
|
|
||||||
|
> .ring
|
||||||
|
position absolute
|
||||||
|
top -.25em
|
||||||
|
left -.25em
|
||||||
|
width 100%
|
||||||
|
height 100%
|
||||||
|
border .25em solid rgba(165,220,134,.3)
|
||||||
|
border-radius 50%
|
||||||
|
z-index 2
|
||||||
|
box-sizing content-box
|
||||||
|
</style>
|
@ -219,7 +219,10 @@ export default Vue.extend({
|
|||||||
try {
|
try {
|
||||||
theme = JSON5.parse(code);
|
theme = JSON5.parse(code);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert('%i18n:@invalid-theme%');
|
this.$swal({
|
||||||
|
type: 'error',
|
||||||
|
text: '%i18n:@invalid-theme%'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,12 +232,18 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (theme.id == null) {
|
if (theme.id == null) {
|
||||||
alert('%i18n:@invalid-theme%');
|
this.$swal({
|
||||||
|
type: 'error',
|
||||||
|
text: '%i18n:@invalid-theme%'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$store.state.device.themes.some(t => t.id == theme.id)) {
|
if (this.$store.state.device.themes.some(t => t.id == theme.id)) {
|
||||||
alert('%i18n:@already-installed%');
|
this.$swal({
|
||||||
|
type: 'info',
|
||||||
|
text: '%i18n:@already-installed%'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +252,10 @@ export default Vue.extend({
|
|||||||
key: 'themes', value: themes
|
key: 'themes', value: themes
|
||||||
});
|
});
|
||||||
|
|
||||||
alert('%i18n:@installed%'.replace('{}', theme.name));
|
this.$swal({
|
||||||
|
type: 'success',
|
||||||
|
text: '%i18n:@installed%'.replace('{}', theme.name)
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
uninstall() {
|
uninstall() {
|
||||||
@ -252,7 +264,11 @@ export default Vue.extend({
|
|||||||
this.$store.commit('device/set', {
|
this.$store.commit('device/set', {
|
||||||
key: 'themes', value: themes
|
key: 'themes', value: themes
|
||||||
});
|
});
|
||||||
alert('%i18n:@uninstalled%'.replace('{}', theme.name));
|
|
||||||
|
this.$swal({
|
||||||
|
type: 'info',
|
||||||
|
text: '%i18n:@uninstalled%'.replace('{}', theme.name)
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
import_() {
|
import_() {
|
||||||
@ -284,16 +300,26 @@ export default Vue.extend({
|
|||||||
|
|
||||||
gen() {
|
gen() {
|
||||||
const theme = this.myTheme;
|
const theme = this.myTheme;
|
||||||
|
|
||||||
if (theme.name == null || theme.name.trim() == '') {
|
if (theme.name == null || theme.name.trim() == '') {
|
||||||
alert('%i18n:@theme-name-required%');
|
this.$swal({
|
||||||
|
type: 'warning',
|
||||||
|
text: '%i18n:@theme-name-required%'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
theme.id = uuid();
|
theme.id = uuid();
|
||||||
|
|
||||||
const themes = this.$store.state.device.themes.concat(theme);
|
const themes = this.$store.state.device.themes.concat(theme);
|
||||||
this.$store.commit('device/set', {
|
this.$store.commit('device/set', {
|
||||||
key: 'themes', value: themes
|
key: 'themes', value: themes
|
||||||
});
|
});
|
||||||
alert('%i18n:@saved%');
|
|
||||||
|
this.$swal({
|
||||||
|
type: 'success',
|
||||||
|
text: '%i18n:@saved%'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -91,8 +91,6 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
|
||||||
.mk-dialog
|
.mk-dialog
|
||||||
> .bg
|
> .bg
|
||||||
display block
|
display block
|
||||||
|
@ -170,7 +170,10 @@ export default Vue.extend({
|
|||||||
this.$store.state.i.bannerUrl = i.bannerUrl;
|
this.$store.state.i.bannerUrl = i.bannerUrl;
|
||||||
|
|
||||||
if (notify) {
|
if (notify) {
|
||||||
alert('%i18n:@saved%');
|
this.$swal({
|
||||||
|
type: 'success',
|
||||||
|
text: '%i18n:@saved%'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user