Compare commits

...

20 Commits

Author SHA1 Message Date
f44c2a3e4f 10.6.0 2018-10-10 21:24:32 +09:00
1fad3cbaae 🎨 2018-10-10 21:23:38 +09:00
40d2e3e97c 🎨 2018-10-10 21:04:53 +09:00
2efabe612e fix(package): update @types/node to version 10.11.6 (#2876) 2018-10-10 21:01:25 +09:00
3107cbd6b9 fix(package): update @types/koa-logger to version 3.1.1 (#2877) 2018-10-10 21:01:18 +09:00
3a061ed1c3 New Crowdin translations (#2878)
* New translations ja-JP.yml (French)

* New translations ja-JP.yml (French)

* New translations ja-JP.yml (French)

* New translations ja-JP.yml (French)

* New translations ja-JP.yml (French)
2018-10-10 21:01:08 +09:00
d4f0e6461a fix(package): update @types/webpack to version 4.4.16 (#2880) 2018-10-10 21:01:00 +09:00
3285687652 fix(package): update url-loader to version 1.1.2 (#2883) 2018-10-10 21:00:47 +09:00
51c53f64d0 Fix #2881, Fix #2879 2018-10-10 20:59:10 +09:00
1d582f5ad2 Fix syntax error 2018-10-10 20:58:42 +09:00
8a62748e39 🎨 2018-10-10 20:02:56 +09:00
6db3d6dfb6 fix(package): update @types/mongodb to version 3.1.12 (#2874) 2018-10-10 03:47:12 +09:00
38e2853dcf 10.5.0 2018-10-10 03:38:39 +09:00
ba5a540ca3 Log misskey version 2018-10-10 03:37:51 +09:00
fb1e05c2e9 ストリーミングAPIでチャンネルに接続したときにconnectedメッセージを返すように 2018-10-10 03:28:11 +09:00
aba84612a7 Merge branch 'develop' of https://github.com/syuilo/misskey into develop 2018-10-10 03:24:18 +09:00
9bebbf4e03 Add alias 2018-10-10 03:24:09 +09:00
e41b3f9c10 Merge pull request #2873 from mei23/mei-1010-pull-recquery
Fix users recommendation query
2018-10-10 02:18:31 +09:00
890dc05022 lint fix 2018-10-10 02:08:26 +09:00
375f86ec82 Fix users recommendation query 2018-10-10 02:04:16 +09:00
13 changed files with 435 additions and 147 deletions

View File

@ -83,17 +83,17 @@ common:
pudding: "Pudding"
note-visibility:
public: "Public"
home: "Accueil"
home-desc: "Publier sur le fil local uniquement"
home: "Principal"
home-desc: "Publier sur le fil principal uniquement"
followers: "Abonnés·es"
followers-desc: "Publier à vos abonnés·es uniquement"
specified: "Direct"
specified-desc: "Publier aux utilisateurs·trices mentionnés·es"
specified-desc: "Publier uniquement aux utilisateurs·rices mentionnés·es"
private: "Privé"
note-placeholders:
a: "Que faites-vous maintenant ?"
b: "Quoi de neuf ?"
c: "Qu'avez-vous en tête ?"
c: "Quavez-vous en tête ?"
d: "Désirez-vous publier quelques mots ?"
e: "Écrivez ici"
f: "En attente de vos écrits"
@ -103,7 +103,7 @@ common:
ok: "OK"
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."
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"
show-reversi-board-labels: "Afficher les étiquettes des lignes et colonnes dans Reversi"
use-contrast-reversi-stones: "リバーシのアイコンにコントラストを付ける"
@ -120,7 +120,7 @@ common:
my-turn: "Cest votre tour"
opponent-turn: "Tour de ladversaire"
turn-of: "Cest le tour de {}"
past-turn-of: "C'est au tour de {}"
past-turn-of: "Cest au tour de {}"
won: "{} a gagné"
black: "Noirs"
white: "Blancs"
@ -267,8 +267,8 @@ common/views/components/media-banner.vue:
common/views/components/theme.vue:
light-theme: "非ダークモード時に使用するテーマ"
dark-theme: "ダークモード時に使用するテーマ"
light-themes: "明るいテーマ"
dark-themes: "暗いテーマ"
light-themes: "Thème clair"
dark-themes: "Thème sombre"
install-a-theme: "Installer un thème"
theme-code: "Code du thème"
install: "Installation"
@ -286,16 +286,16 @@ common/views/components/theme.vue:
invalid-theme: "Thème nest pas valide."
already-installed: "Le thème est déjà installé."
saved: "enregistré"
manage-themes: "テーマの管理"
builtin-themes: "標準テーマ"
my-themes: "マイテーマ"
manage-themes: "Gestion des thèmes"
builtin-themes: "Thèmes standards"
my-themes: "Mes thèmes"
installed-themes: "Thèmes installés"
select-theme: "Veuillez sélectionner un thème"
uninstall: "Désinstaller"
uninstalled: "« {} » a été désinstallé"
author: "Auteur"
desc: "Description"
export: "エクスポート"
export: "Exporter"
import: "Importer"
import-by-code: "Ou coller du code"
theme-name-required: "Nom du thème est obligatoire."
@ -329,8 +329,8 @@ common/views/components/nav.vue:
wiki: "Wiki"
donors: "Donateur·rice·s"
repository: "Dépôt"
develop: "Développeur·se·s"
feedback: "Remarques"
develop: "Développeurs"
feedback: "Suggestions"
common/views/components/note-menu.vue:
detail: "Détails"
copy-link: "Copier le lien"
@ -410,10 +410,10 @@ common/views/components/visibility-chooser.vue:
followers: "Abonné·e·s"
followers-desc: "Publier à vos abonné·e·s uniquement"
specified: "Direct"
specified-desc: "Publier aux utilisateur·rice·s mentionné·e·s"
specified-desc: "Publier uniquement aux utilisateurs·rices mentionné·e·s"
private: "Privé"
common/views/components/trends.vue:
count: "{} utilisateurs·trices mentionnés·es"
count: "{} utilisateurs·rices mentionnés·es"
empty: "Aucune tendance"
common/views/widgets/broadcast.vue:
fetching: "Récupération"
@ -514,7 +514,7 @@ desktop/views/components/charts.vue:
notes: "投稿の増減 (統合)"
local-notes: "投稿の増減 (ローカル)"
remote-notes: "投稿の増減 (リモート)"
notes-total: "投稿の積算"
notes-total: "Total des notes"
users: "Nombre dutilisateurs·trices : augmentation/diminution"
users-total: "ユーザーの積算"
drive: "ドライブ使用量の増減"
@ -858,7 +858,7 @@ desktop/views/components/timeline.vue:
list-name: "Nom de la liste"
desktop/views/components/ui.header.vue:
welcome-back: "Content de vous revoir !"
adjective: "さん"
adjective: "M."
desktop/views/components/ui.header.account.vue:
profile: "Votre profil"
drive: "Drive"
@ -911,9 +911,9 @@ desktop/views/pages/admin/admin.vue:
desktop/views/pages/admin/admin.dashboard.vue:
dashboard: "Tableau de bord"
all-users: "Toutes les utilisateurrices"
original-users: "Utilisateurrices sur cette instance"
original-users: "Utilisateur·rice·s sur cette instance"
all-notes: "Toutes les publications"
original-notes: "Publication sur cette instance"
original-notes: "Publications sur cette instance"
invite: "Invitation"
desktop/views/pages/admin/admin.suspend-user.vue:
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"
desktop/views/pages/stats/stats.vue:
all-users: "Toutes les utilisateurrices"
original-users: "Utilisateurrices sur cette instance"
original-users: "Utilisateur·rice·s sur cette instance"
all-notes: "Toutes les publications"
original-notes: "Publication sur cette instance"
original-notes: "Publications sur cette instance"
desktop/views/pages/welcome.vue:
about: "à propos"
gotit: "J'ai compris !"
@ -986,13 +986,13 @@ desktop/views/pages/user/user.followers-you-know.vue:
loading: "Chargement en cours"
no-users: "Pas d'utilisateurs"
desktop/views/pages/user/user.friends.vue:
title: "Personnes qui répondent le plus"
title: "Mentions fréquentes"
loading: "Chargement en cours"
no-users: "Pas d'utilisateurs"
desktop/views/pages/user/user.vue:
is-suspended: "Ce compte a été suspendu."
is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées"
view-remote: "Voir les informations détaillé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: "Consulter le profil complet"
desktop/views/pages/user/user.home.vue:
last-used-at: "Last used at"
desktop/views/pages/user/user.photos.vue:
@ -1000,7 +1000,7 @@ desktop/views/pages/user/user.photos.vue:
loading: "Chargement en cours"
no-photos: "Pas de photos"
desktop/views/pages/user/user.profile.vue:
follows-you: "Vous suis"
follows-you: "Vous suit"
stalk: "Traquer"
stalking: "ストーキングしています"
unstalk: "ストーク解除"
@ -1171,7 +1171,7 @@ mobile/views/pages/drive.vue:
drive: "Drive"
more: "Afficher plus ..."
mobile/views/pages/signup.vue:
lets-start: "Commençons ! 📦"
lets-start: "Votre compte est prêt ! 📦"
mobile/views/pages/followers.vue:
followers-of: "Abonné·e·s de {}"
mobile/views/pages/following.vue:
@ -1286,7 +1286,7 @@ mobile/views/pages/settings.vue:
sound: "Sons"
enable-sounds: "Activer les sons"
mobile/views/pages/user.vue:
follows-you: "vous suit"
follows-you: "Vous suit"
following: "Abonnements"
followers: "Abonné·e·s"
notes: "Notes"
@ -1294,8 +1294,8 @@ mobile/views/pages/user.vue:
timeline: "Fil d'actualité"
media: "Media"
is-suspended: "This account has been suspended."
is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées "
view-remote: "Voir les informations détaillées"
is-remote: "Ceci est le profil dun utilisateur·rice distant·e. Certaines informations peuvent ne pas refléter ce profil dans sa totalité."
view-remote: "Consulter son profil complet"
mobile/views/pages/user/home.vue:
recent-notes: "Notes récentes"
images: "Images"
@ -1319,7 +1319,7 @@ mobile/views/pages/user/home.photos.vue:
no-photos: "Pas de photos"
docs:
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:
entities:
properties: "Propriétés"

View File

@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "10.4.0",
"clientVersion": "1.0.10397",
"version": "10.6.0",
"clientVersion": "1.0.10417",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
@ -48,7 +48,7 @@
"@types/koa-bodyparser": "5.0.1",
"@types/koa-compress": "2.0.8",
"@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-multer": "1.0.0",
"@types/koa-router": "7.0.32",
@ -58,9 +58,9 @@
"@types/minio": "7.0.0",
"@types/mkdirp": "0.5.2",
"@types/mocha": "5.2.3",
"@types/mongodb": "3.1.11",
"@types/mongodb": "3.1.12",
"@types/ms": "0.7.30",
"@types/node": "10.11.5",
"@types/node": "10.11.6",
"@types/portscanner": "2.1.0",
"@types/pug": "2.0.4",
"@types/qrcode": "1.3.0",
@ -78,7 +78,7 @@
"@types/tinycolor2": "1.4.1",
"@types/tmp": "0.0.33",
"@types/uuid": "3.4.4",
"@types/webpack": "4.4.15",
"@types/webpack": "4.4.16",
"@types/webpack-stream": "3.2.10",
"@types/websocket": "0.0.40",
"@types/ws": "6.0.1",
@ -206,7 +206,7 @@
"typescript": "2.9.2",
"typescript-eslint-parser": "20.0.0",
"uglify-es": "3.3.9",
"url-loader": "1.1.1",
"url-loader": "1.1.2",
"uuid": "3.3.2",
"v-animate-css": "0.0.2",
"vue": "2.5.17",

View File

@ -131,15 +131,28 @@ pre
[data-fa]
display inline-block
.swal2-container
z-index 10000 !important
&.swal2-shown
background-color rgba(0, 0, 0, 0.5) !important
.swal2-popup
background var(--face) !important
.swal-icon-only
width 180px !important
.swal2-content
color var(--text) !important
> .swal2-header
> .swal2-icon
margin 1.25em auto 1.875em
.swal2-confirm
background-color var(--primary) !important
border-left-color var(--primary) !important
border-right-color var(--primary) !important
color var(--primaryForeground) !important
> .swal2-title
display none
&:hover
background-image none !important
background-color var(--primaryDarken5) !important
&:active
background-image none !important
background-color var(--primaryDarken5) !important

View File

@ -11,6 +11,7 @@ export default class Stream extends EventEmitter {
private stream: ReconnectingWebsocket;
private state: string;
private buffer: any[];
private sharedConnectionPools: Pool[] = [];
private sharedConnections: SharedConnection[] = [];
private nonSharedConnections: NonSharedConnection[] = [];
@ -29,22 +30,21 @@ export default class Stream extends EventEmitter {
}
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) {
existConnection.use();
return existConnection;
} else {
const connection = new SharedConnection(this, channel);
connection.use();
this.sharedConnections.push(connection);
return connection;
if (pool == null) {
pool = new Pool(this, channel);
this.sharedConnectionPools.push(pool);
}
const connection = new SharedConnection(this, channel, pool);
this.sharedConnections.push(connection);
return connection;
}
@autobind
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 => {
@ -55,7 +55,7 @@ export default class Stream extends EventEmitter {
@autobind
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) {
this.sharedConnections.forEach(c => {
c.connect();
this.sharedConnectionPools.forEach(p => {
p.connect();
});
this.nonSharedConnections.forEach(c => {
c.connect();
@ -104,8 +104,18 @@ export default class Stream extends EventEmitter {
if (type == 'channel') {
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 {
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 id: string;
protected params: any;
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();
this.stream = stream;
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.id = Math.random().toString();
this.connect();
}
@ -167,59 +289,7 @@ abstract class Connection extends EventEmitter {
@autobind
public send(typeOrPayload, payload?) {
const type = payload === undefined ? typeOrPayload.type : typeOrPayload;
const body = payload === undefined ? typeOrPayload.body : payload;
this.stream.send('channel', {
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);
super.send(this.id, typeOrPayload, payload);
}
@autobind

View File

@ -71,7 +71,7 @@ export default Vue.extend({
},
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('read', this.onRead);

View File

@ -8,6 +8,7 @@
import Vue from 'vue';
import { url } from '../../../config';
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
import Ok from './ok.vue';
export default Vue.extend({
props: ['note', 'source', 'compact'],
@ -78,6 +79,7 @@ export default Vue.extend({
(this as any).api('i/pin', {
noteId: this.note.id
}).then(() => {
(this as any).os.new(Ok);
this.destroyDom();
});
},
@ -103,12 +105,7 @@ export default Vue.extend({
(this as any).api('notes/favorites/create', {
noteId: this.note.id
}).then(() => {
this.$swal({
type: 'success',
showConfirmButton: false,
timer: 1250,
customClass: 'swal-icon-only'
});
(this as any).os.new(Ok);
this.destroyDom();
});
},

View 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>

View File

@ -219,7 +219,10 @@ export default Vue.extend({
try {
theme = JSON5.parse(code);
} catch (e) {
alert('%i18n:@invalid-theme%');
this.$swal({
type: 'error',
text: '%i18n:@invalid-theme%'
});
return;
}
@ -229,12 +232,18 @@ export default Vue.extend({
}
if (theme.id == null) {
alert('%i18n:@invalid-theme%');
this.$swal({
type: 'error',
text: '%i18n:@invalid-theme%'
});
return;
}
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;
}
@ -243,7 +252,10 @@ export default Vue.extend({
key: 'themes', value: themes
});
alert('%i18n:@installed%'.replace('{}', theme.name));
this.$swal({
type: 'success',
text: '%i18n:@installed%'.replace('{}', theme.name)
});
},
uninstall() {
@ -252,7 +264,11 @@ export default Vue.extend({
this.$store.commit('device/set', {
key: 'themes', value: themes
});
alert('%i18n:@uninstalled%'.replace('{}', theme.name));
this.$swal({
type: 'info',
text: '%i18n:@uninstalled%'.replace('{}', theme.name)
});
},
import_() {
@ -284,16 +300,26 @@ export default Vue.extend({
gen() {
const theme = this.myTheme;
if (theme.name == null || theme.name.trim() == '') {
alert('%i18n:@theme-name-required%');
this.$swal({
type: 'warning',
text: '%i18n:@theme-name-required%'
});
return;
}
theme.id = uuid();
const themes = this.$store.state.device.themes.concat(theme);
this.$store.commit('device/set', {
key: 'themes', value: themes
});
alert('%i18n:@saved%');
this.$swal({
type: 'success',
text: '%i18n:@saved%'
});
}
}
});

View File

@ -91,8 +91,6 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-dialog
> .bg
display block

View File

@ -170,7 +170,10 @@ export default Vue.extend({
this.$store.state.i.bannerUrl = i.bannerUrl;
if (notify) {
alert('%i18n:@saved%');
this.$swal({
type: 'success',
text: '%i18n:@saved%'
});
}
});
}

View File

@ -111,6 +111,7 @@ async function workerMain() {
*/
async function init(): Promise<Config> {
Logger.info('Welcome to Misskey!');
Logger.info(`<<< Misskey v${pkg.version} >>>`);
new Logger('Deps').info(`Node.js ${process.version}`);
MachineInfo.show();

View File

@ -3,8 +3,8 @@ import $ from 'cafy';
import User, { pack, ILocalUser } from '../../../../models/user';
import { getFriendIds } from '../../common/get-friends';
import Mute from '../../../../models/mute';
import * as request from 'request'
import config from '../../../../config'
import * as request from 'request';
import config from '../../../../config';
export const meta = {
desc: {
@ -18,18 +18,19 @@ export const meta = {
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
if (config.user_recommendation && config.user_recommendation.external) {
const userName = me.username
const hostName = config.hostname
const limit = params.limit
const offset = params.offset
const timeout = config.user_recommendation.timeout
const engine = config.user_recommendation.engine
const userName = me.username;
const hostName = config.hostname;
const limit = params.limit;
const offset = params.offset;
const timeout = config.user_recommendation.timeout;
const engine = config.user_recommendation.engine;
const url = engine
.replace('{{host}}', hostName)
.replace('{{user}}', userName)
.replace('{{limit}}', limit)
.replace('{{offset}}', offset)
request(
.replace('{{offset}}', offset);
request(
{
url: url,
timeout: timeout,
@ -39,12 +40,12 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
},
(error: any, response: any, body: any) => {
if (!error && response.statusCode == 200) {
res(body)
res(body);
} else {
res([])
res([]);
}
}
)
);
} else {
// Get 'limit' parameter
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
@ -67,7 +68,7 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
_id: {
$nin: followingIds.concat(mutedUserIds)
},
isLocked: false,
isLocked: { $ne: true },
$or: [{
lastUsedAt: {
$gte: new Date(Date.now() - ms('7days'))

View File

@ -58,6 +58,7 @@ export default class Connection {
case 'connect': this.onChannelConnectRequested(body); break;
case 'disconnect': this.onChannelDisconnectRequested(body); break;
case 'channel': this.onChannelMessageRequested(body); break;
case 'ch': this.onChannelMessageRequested(body); break; // alias
}
}
@ -180,6 +181,9 @@ export default class Connection {
const channel = new channelClass(id, this);
this.channels.push(channel);
channel.init(params);
this.sendMessageToWs('connected', {
id: id
});
}
/**