From 98f6b2324968a53cae88cd3ded515bf6efeda9d5 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 29 Aug 2018 12:27:33 +0000 Subject: fix(package): update summaly to version 2.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index eea3f363c3..11391ea2a0 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "style-loader": "0.23.0", "stylus": "0.54.5", "stylus-loader": "3.0.2", - "summaly": "2.1.4", + "summaly": "2.2.0", "systeminformation": "3.44.2", "syuilo-password-strength": "0.0.1", "textarea-caret": "3.1.0", -- cgit v1.2.3-freya From 073c96af478f4c518ad19d2b7650c8a611321d62 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 29 Aug 2018 14:02:49 +0000 Subject: fix(package): update vue-js-modal to version 1.3.24 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index eea3f363c3..b48b336a49 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "vue": "2.5.17", "vue-chartjs": "3.4.0", "vue-cropperjs": "2.2.1", - "vue-js-modal": "1.3.23", + "vue-js-modal": "1.3.24", "vue-json-tree-view": "2.1.4", "vue-loader": "15.4.1", "vue-router": "3.0.1", -- cgit v1.2.3-freya From 5b943722fbd9a143b0b6b654e07e192e1218d4da Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 30 Aug 2018 00:16:12 +0000 Subject: fix(package): update @types/uuid to version 3.4.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 3123de1042..774c978f05 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "@types/speakeasy": "2.0.2", "@types/systeminformation": "3.23.0", "@types/tmp": "0.0.33", - "@types/uuid": "3.4.3", + "@types/uuid": "3.4.4", "@types/webpack": "4.4.11", "@types/webpack-stream": "3.2.10", "@types/websocket": "0.0.39", -- cgit v1.2.3-freya From 6a87e9f690c87579c37e3145bac080d6b6cbad35 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 30 Aug 2018 00:18:42 +0000 Subject: fix(package): update @types/websocket to version 0.0.40 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 3123de1042..4496b950eb 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@types/uuid": "3.4.3", "@types/webpack": "4.4.11", "@types/webpack-stream": "3.2.10", - "@types/websocket": "0.0.39", + "@types/websocket": "0.0.40", "@types/ws": "6.0.0", "animejs": "2.2.0", "autosize": "4.0.2", -- cgit v1.2.3-freya From 6a5a9de79585f957f324872746862d47b7294cbf Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Aug 2018 22:15:41 +0900 Subject: 8.16.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 37620e7a3b..76ed2ac949 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.15.0", - "clientVersion": "1.0.9031", + "version": "8.16.0", + "clientVersion": "1.0.9191", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 9cd334576ca81320c8fa9dc532ecc00b2bc2f26e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 30 Aug 2018 16:41:33 +0000 Subject: fix(package): update @types/node to version 10.9.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 76ed2ac949..a461d8076a 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@types/mocha": "5.2.3", "@types/mongodb": "3.1.4", "@types/ms": "0.7.30", - "@types/node": "10.9.3", + "@types/node": "10.9.4", "@types/portscanner": "2.1.0", "@types/pug": "2.0.4", "@types/qrcode": "1.2.0", -- cgit v1.2.3-freya From 6819eb3b4da43665de8e159d774b3f2325ddfe0b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 1 Sep 2018 09:16:25 +0900 Subject: Improve usability --- package.json | 1 + src/client/app/app.vue | 5 +++- src/client/app/init.ts | 5 ++++ src/client/app/mobile/api/post.ts | 24 ----------------- src/client/app/mobile/script.ts | 3 +-- src/client/app/mobile/style.styl | 10 ++++++++ .../mobile/views/components/drive-file-chooser.vue | 2 +- .../app/mobile/views/components/note-detail.vue | 30 +++++++++++++++++----- src/client/app/mobile/views/components/note.vue | 23 ++++++++++++----- .../app/mobile/views/components/post-form.vue | 4 --- src/client/app/mobile/views/pages/home.vue | 10 +++++++- 11 files changed, 72 insertions(+), 45 deletions(-) delete mode 100644 src/client/app/mobile/api/post.ts (limited to 'package.json') diff --git a/package.json b/package.json index a461d8076a..31e60260ba 100644 --- a/package.json +++ b/package.json @@ -216,6 +216,7 @@ "vue-router": "3.0.1", "vue-style-loader": "4.1.2", "vue-template-compiler": "2.5.17", + "vue-thin-modal": "1.1.1", "vuedraggable": "2.16.0", "vuex": "3.0.1", "vuex-persistedstate": "2.5.4", diff --git a/src/client/app/app.vue b/src/client/app/app.vue index 7a46e7dea0..011eb14661 100644 --- a/src/client/app/app.vue +++ b/src/client/app/app.vue @@ -1,3 +1,6 @@ diff --git a/src/client/app/init.ts b/src/client/app/init.ts index cf97957400..dd31f07475 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -11,6 +11,8 @@ import VAnimateCss from 'v-animate-css'; import Element from 'element-ui'; import ElementLocaleEn from 'element-ui/lib/locale/lang/en'; import ElementLocaleJa from 'element-ui/lib/locale/lang/ja'; +import VueThinModal from 'vue-thin-modal'; +import 'vue-thin-modal/dist/vue-thin-modal.css'; import App from './app.vue'; import checkForUpdate from './common/scripts/check-for-update'; @@ -30,6 +32,9 @@ Vue.use(VModal); Vue.use(TreeView); Vue.use(VAnimateCss); Vue.use(Element, { locale: elementLocale }); +Vue.use(VueThinModal, { + autoMountPortal: false +}); // Register global directives require('./common/views/directives'); diff --git a/src/client/app/mobile/api/post.ts b/src/client/app/mobile/api/post.ts deleted file mode 100644 index 15b2f6b691..0000000000 --- a/src/client/app/mobile/api/post.ts +++ /dev/null @@ -1,24 +0,0 @@ -import PostForm from '../views/components/post-form.vue'; - -export default (os) => (opts) => { - const o = opts || {}; - - const app = document.getElementById('app'); - app.style.display = 'none'; - - function recover() { - app.style.display = 'block'; - } - - const vm = new PostForm({ - parent: os.app, - propsData: { - reply: o.reply, - renote: o.renote - } - }).$mount(); - vm.$once('cancel', recover); - vm.$once('posted', recover); - document.body.appendChild(vm.$el); - (vm as any).focus(); -}; diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts index 5b9d45462a..edc2b35529 100644 --- a/src/client/app/mobile/script.ts +++ b/src/client/app/mobile/script.ts @@ -14,7 +14,6 @@ import chooseDriveFolder from './api/choose-drive-folder'; import chooseDriveFile from './api/choose-drive-file'; import dialog from './api/dialog'; import input from './api/input'; -import post from './api/post'; import notify from './api/notify'; import MkIndex from './views/pages/index.vue'; @@ -91,7 +90,7 @@ init((launch) => { chooseDriveFile, dialog: dialog(os), input, - post: post(os), + post: () => alert('deprecated'), notify })); }, true); diff --git a/src/client/app/mobile/style.styl b/src/client/app/mobile/style.styl index df8f4a8fae..f78146f8b8 100644 --- a/src/client/app/mobile/style.styl +++ b/src/client/app/mobile/style.styl @@ -17,3 +17,13 @@ body display flex flex-direction column min-height 100% + +.modal-backdrop + z-index 10000 !important + +.modal-content-wrapper + z-index 10001 !important + +.modal-content + padding 0 !important + background-color transparent !important diff --git a/src/client/app/mobile/views/components/drive-file-chooser.vue b/src/client/app/mobile/views/components/drive-file-chooser.vue index d95d5fa223..56e41e31d8 100644 --- a/src/client/app/mobile/views/components/drive-file-chooser.vue +++ b/src/client/app/mobile/views/components/drive-file-chooser.vue @@ -48,7 +48,7 @@ export default Vue.extend({ diff --git a/src/client/app/mobile/views/pages/home.vue b/src/client/app/mobile/views/pages/home.vue index a03fa03c5f..706c9cd28b 100644 --- a/src/client/app/mobile/views/pages/home.vue +++ b/src/client/app/mobile/views/pages/home.vue @@ -42,10 +42,6 @@ - - - - @@ -111,11 +107,7 @@ export default Vue.extend({ methods: { fn() { - this.$modal.push('postForm'); - }, - - postFormClosed() { - this.$modal.pop(); + (this as any).apis.post(); }, saveSrc() { -- cgit v1.2.3-freya From f3499b787cb08d36f2bf9af8293efd41729c77eb Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 1 Sep 2018 20:49:06 +0900 Subject: 8.20.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 4c88e02a45..72dd6b73f0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.19.1", - "clientVersion": "1.0.9225", + "version": "8.20.0", + "clientVersion": "1.0.9240", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 01beb705a28e84764ea36436d20ded14cad1b598 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 2 Sep 2018 00:07:23 +0900 Subject: 8.21.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 72dd6b73f0..499d453560 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.20.0", - "clientVersion": "1.0.9240", + "version": "8.21.0", + "clientVersion": "1.0.9259", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 14c03f226d49d656a7c1b8d522fa2b50b6280ac7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 2 Sep 2018 09:33:55 +0900 Subject: 8.21.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 499d453560..522765359c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.21.0", - "clientVersion": "1.0.9259", + "version": "8.21.1", + "clientVersion": "1.0.9264", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From c145c994a9d6a3e19cde971325df0017ff7d4a6d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 2 Sep 2018 19:27:09 +0900 Subject: 8.22.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 522765359c..bb7e70beb0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.21.1", - "clientVersion": "1.0.9264", + "version": "8.22.0", + "clientVersion": "1.0.9273", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From ba38f643536580c495b54c768ded0315a78467d4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 3 Sep 2018 23:25:35 +0900 Subject: 8.23.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index bb7e70beb0..c43f73ecc7 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.22.0", - "clientVersion": "1.0.9273", + "version": "8.23.0", + "clientVersion": "1.0.9287", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From a9ae9a65c83832d746df030c38ec2344c8176c8f Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 4 Sep 2018 02:10:47 +0900 Subject: 8.24.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index c43f73ecc7..4d4d109527 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.23.0", - "clientVersion": "1.0.9287", + "version": "8.24.0", + "clientVersion": "1.0.9289", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 921609cab162906cff1be52164c4d0ef3f70bf2f Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 4 Sep 2018 13:07:09 +0900 Subject: 8.25.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 4d4d109527..6238613e35 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.24.0", - "clientVersion": "1.0.9289", + "version": "8.25.0", + "clientVersion": "1.0.9297", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From a0735b0e7a843ef383de486968abdf07c3429814 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 4 Sep 2018 18:15:58 +0900 Subject: fix(package): update webpack to version 4.17.2 (#2599) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 6238613e35..b53345b9d0 100644 --- a/package.json +++ b/package.json @@ -221,7 +221,7 @@ "vuex-persistedstate": "2.5.4", "web-push": "3.3.2", "webfinger.js": "2.6.6", - "webpack": "4.17.1", + "webpack": "4.17.2", "webpack-cli": "3.1.0", "websocket": "1.0.26", "ws": "6.0.0", -- cgit v1.2.3-freya From f539491502e4969d43736e7e3e0f2493a2afaf25 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 5 Sep 2018 12:47:13 +0900 Subject: fix(package): update vue-js-modal to version 1.3.26 (#2613) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index b53345b9d0..c5c363798e 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "vue": "2.5.17", "vue-chartjs": "3.4.0", "vue-cropperjs": "2.2.1", - "vue-js-modal": "1.3.25", + "vue-js-modal": "1.3.26", "vue-json-tree-view": "2.1.4", "vue-loader": "15.4.1", "vue-router": "3.0.1", -- cgit v1.2.3-freya From a38ce86f87d72573dedcd1b09d7cea885715f9dc Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 5 Sep 2018 12:47:30 +0900 Subject: fix(package): update systeminformation to version 3.45.0 (#2609) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index c5c363798e..6664c91b0e 100644 --- a/package.json +++ b/package.json @@ -194,7 +194,7 @@ "stylus": "0.54.5", "stylus-loader": "3.0.2", "summaly": "2.2.0", - "systeminformation": "3.44.2", + "systeminformation": "3.45.0", "syuilo-password-strength": "0.0.1", "textarea-caret": "3.1.0", "tmp": "0.0.33", -- cgit v1.2.3-freya From 4bce6f14f3a4df30495b0db7add39c69a9ea55ed Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 5 Sep 2018 12:48:00 +0900 Subject: fix(package): update node-sass-json-importer to version 4.0.0 (#2614) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 6664c91b0e..2bfd0cc27a 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "nan": "2.11.0", "nested-property": "0.0.7", "node-sass": "4.9.3", - "node-sass-json-importer": "3.3.1", + "node-sass-json-importer": "4.0.0", "nprogress": "0.2.0", "object-assign-deep": "0.4.0", "on-build-webpack": "0.1.0", -- cgit v1.2.3-freya From 1915ccabdd99f45d708122ff52a2c2070cef40bc Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 5 Sep 2018 13:49:08 +0900 Subject: 8.26.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 2bfd0cc27a..7cfca8480e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.25.0", - "clientVersion": "1.0.9297", + "version": "8.26.0", + "clientVersion": "1.0.9358", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From f83f8631accb2455fe03fbcbb1711fdb829d163a Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 5 Sep 2018 13:56:59 +0900 Subject: fix(package): update systeminformation to version 3.45.1 (#2616) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 7cfca8480e..70124a0ae4 100644 --- a/package.json +++ b/package.json @@ -194,7 +194,7 @@ "stylus": "0.54.5", "stylus-loader": "3.0.2", "summaly": "2.2.0", - "systeminformation": "3.45.0", + "systeminformation": "3.45.1", "syuilo-password-strength": "0.0.1", "textarea-caret": "3.1.0", "tmp": "0.0.33", -- cgit v1.2.3-freya From a1b82e97230eab994c06fc7c902e71539664d3d7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 5 Sep 2018 19:32:46 +0900 Subject: #2620 --- package.json | 2 +- .../app/common/scripts/parse-search-query.ts | 53 ---------------------- .../common/views/components/welcome-timeline.vue | 2 +- .../app/desktop/views/components/note-detail.vue | 6 +-- .../app/desktop/views/components/notes.note.vue | 6 +-- src/client/app/desktop/views/components/notes.vue | 2 +- .../desktop/views/components/post-form-window.vue | 10 ++-- .../app/desktop/views/components/post-form.vue | 16 +++---- .../desktop/views/components/sub-note-content.vue | 6 +-- .../app/desktop/views/pages/deck/deck.list-tl.vue | 6 +-- .../app/desktop/views/pages/deck/deck.note.vue | 16 +++---- .../app/desktop/views/pages/deck/deck.notes.vue | 2 +- .../app/desktop/views/pages/deck/deck.tl.vue | 6 +-- .../app/desktop/views/pages/user/user.photos.vue | 6 +-- .../app/desktop/views/pages/user/user.timeline.vue | 4 +- src/client/app/desktop/views/widgets/trends.vue | 2 +- .../app/mobile/views/components/note-detail.vue | 8 ++-- src/client/app/mobile/views/components/note.vue | 8 ++-- src/client/app/mobile/views/components/notes.vue | 2 +- .../app/mobile/views/components/post-form.vue | 8 ++-- .../mobile/views/components/sub-note-content.vue | 6 +-- .../app/mobile/views/components/user-timeline.vue | 4 +- .../app/mobile/views/pages/user/home.photos.vue | 2 +- src/docs/api/entities/note.yaml | 12 ++--- src/misc/get-note-summary.ts | 6 +-- src/misc/is-quote.ts | 2 +- src/models/drive-file.ts | 2 +- src/models/note.ts | 26 +++++++++-- src/remote/activitypub/models/note.ts | 6 +-- src/remote/activitypub/renderer/note.ts | 4 +- src/server/activitypub/outbox.ts | 2 +- src/server/api/endpoints/notes.ts | 10 ++-- src/server/api/endpoints/notes/create.ts | 23 ++++++---- src/server/api/endpoints/notes/global-timeline.ts | 10 ++-- src/server/api/endpoints/notes/hybrid-timeline.ts | 12 ++--- src/server/api/endpoints/notes/local-timeline.ts | 10 ++-- src/server/api/endpoints/notes/search_by_tag.ts | 6 +-- src/server/api/endpoints/notes/timeline.ts | 12 ++--- src/server/api/endpoints/notes/trend.ts | 2 +- .../api/endpoints/notes/user-list-timeline.ts | 12 ++--- src/server/api/endpoints/users/notes.ts | 10 ++-- src/services/note/create.ts | 11 +++-- src/services/note/delete.ts | 2 +- 43 files changed, 167 insertions(+), 196 deletions(-) delete mode 100644 src/client/app/common/scripts/parse-search-query.ts (limited to 'package.json') diff --git a/package.json b/package.json index 70124a0ae4..775c997e55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.26.0", + "version": "9.0.0", "clientVersion": "1.0.9358", "codename": "nighthike", "main": "./built/index.js", diff --git a/src/client/app/common/scripts/parse-search-query.ts b/src/client/app/common/scripts/parse-search-query.ts deleted file mode 100644 index 5f6ae3320a..0000000000 --- a/src/client/app/common/scripts/parse-search-query.ts +++ /dev/null @@ -1,53 +0,0 @@ -export default function(qs: string) { - const q = { - text: '' - }; - - qs.split(' ').forEach(x => { - if (/^([a-z_]+?):(.+?)$/.test(x)) { - const [key, value] = x.split(':'); - switch (key) { - case 'user': - q['includeUserUsernames'] = value.split(','); - break; - case 'exclude_user': - q['excludeUserUsernames'] = value.split(','); - break; - case 'follow': - q['following'] = value == 'null' ? null : value == 'true'; - break; - case 'reply': - q['reply'] = value == 'null' ? null : value == 'true'; - break; - case 'renote': - q['renote'] = value == 'null' ? null : value == 'true'; - break; - case 'media': - q['media'] = value == 'null' ? null : value == 'true'; - break; - case 'poll': - q['poll'] = value == 'null' ? null : value == 'true'; - break; - case 'until': - case 'since': - // YYYY-MM-DD - if (/^[0-9]+\-[0-9]+\-[0-9]+$/) { - const [yyyy, mm, dd] = value.split('-'); - q[`${key}_date`] = (new Date(parseInt(yyyy, 10), parseInt(mm, 10) - 1, parseInt(dd, 10))).getTime(); - } - break; - default: - q[key] = value; - break; - } - } else { - q.text += x + ' '; - } - }); - - if (q.text) { - q.text = q.text.trim(); - } - - return q; -} diff --git a/src/client/app/common/views/components/welcome-timeline.vue b/src/client/app/common/views/components/welcome-timeline.vue index d4e7902c7b..b427721d37 100644 --- a/src/client/app/common/views/components/welcome-timeline.vue +++ b/src/client/app/common/views/components/welcome-timeline.vue @@ -63,7 +63,7 @@ export default Vue.extend({ local: true, reply: false, renote: false, - media: false, + file: false, poll: false }).then(notes => { this.notes = notes; diff --git a/src/client/app/desktop/views/components/note-detail.vue b/src/client/app/desktop/views/components/note-detail.vue index 1ba4a9a447..a61a004a85 100644 --- a/src/client/app/desktop/views/components/note-detail.vue +++ b/src/client/app/desktop/views/components/note-detail.vue @@ -42,8 +42,8 @@ %i18n:@deleted% -
- +
+
@@ -114,7 +114,7 @@ export default Vue.extend({ isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds.length == 0 && + this.note.fileIds.length == 0 && this.note.poll == null); }, p(): any { diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue index 7592ae3905..1d6b2048ba 100644 --- a/src/client/app/desktop/views/components/notes.note.vue +++ b/src/client/app/desktop/views/components/notes.note.vue @@ -28,8 +28,8 @@ RP:
-
- +
+
%fa:map-marker-alt% 位置情報 @@ -110,7 +110,7 @@ export default Vue.extend({ isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds.length == 0 && + this.note.fileIds.length == 0 && this.note.poll == null); }, diff --git a/src/client/app/desktop/views/components/notes.vue b/src/client/app/desktop/views/components/notes.vue index a1c1207a7b..f19ecf8f9a 100644 --- a/src/client/app/desktop/views/components/notes.vue +++ b/src/client/app/desktop/views/components/notes.vue @@ -122,7 +122,7 @@ export default Vue.extend({ prepend(note, silent = false) { //#region 弾く const isMyNote = note.userId == this.$store.state.i.id; - const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null; + const isPureRenote = note.renoteId != null && note.text == null && note.fileIds.length == 0 && note.poll == null; if (this.$store.state.settings.showMyRenotes === false) { if (isMyNote && isPureRenote) { diff --git a/src/client/app/desktop/views/components/post-form-window.vue b/src/client/app/desktop/views/components/post-form-window.vue index 51a416e281..a88c96d1bf 100644 --- a/src/client/app/desktop/views/components/post-form-window.vue +++ b/src/client/app/desktop/views/components/post-form-window.vue @@ -4,7 +4,7 @@ %fa:map-marker-alt% %i18n:@note% %i18n:@reply% - {{ '%i18n:@attaches%'.replace('{}', media.length) }} + {{ '%i18n:@attaches%'.replace('{}', files.length) }} {{ '%i18n:@uploading-media%'.replace('{}', uploadings.length) }} @@ -14,7 +14,7 @@ :reply="reply" @posted="onPosted" @change-uploadings="onChangeUploadings" - @change-attached-media="onChangeMedia" + @change-attached-files="onChangeFiles" @geo-attached="onGeoAttached" @geo-dettached="onGeoDettached"/>
@@ -29,7 +29,7 @@ export default Vue.extend({ data() { return { uploadings: [], - media: [], + files: [], geo: null }; }, @@ -42,8 +42,8 @@ export default Vue.extend({ onChangeUploadings(files) { this.uploadings = files; }, - onChangeMedia(media) { - this.media = media; + onChangeFiles(files) { + this.files = files; }, onGeoAttached(geo) { this.geo = geo; diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index 2ca5484610..f6f52c8f1f 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -20,7 +20,7 @@ @keydown="onKeydown" @paste="onPaste" :placeholder="placeholder" v-autocomplete="'text'" > -
+
@@ -188,7 +188,7 @@ export default Vue.extend({ (this.$refs.poll as any).set(draft.data.poll); }); } - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); } } @@ -225,12 +225,12 @@ export default Vue.extend({ attachMedia(driveFile) { this.files.push(driveFile); - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); }, detachMedia(id) { this.files = this.files.filter(x => x.id != id); - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); }, onChangeFile() { @@ -249,7 +249,7 @@ export default Vue.extend({ this.text = ''; this.files = []; this.poll = false; - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); }, onKeydown(e) { @@ -297,7 +297,7 @@ export default Vue.extend({ if (driveFile != null && driveFile != '') { const file = JSON.parse(driveFile); this.files.push(file); - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); e.preventDefault(); } //#endregion @@ -354,7 +354,7 @@ export default Vue.extend({ (this as any).api('notes/create', { text: this.text == '' ? undefined : this.text, - mediaIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined, + fileIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined, replyId: this.reply ? this.reply.id : undefined, renoteId: this.renote ? this.renote.id : undefined, poll: this.poll ? (this.$refs.poll as any).get() : undefined, @@ -514,7 +514,7 @@ root(isDark) margin-right 8px white-space nowrap - > .medias + > .files margin 0 padding 0 background isDark ? #181b23 : lighten($theme-color, 98%) diff --git a/src/client/app/desktop/views/components/sub-note-content.vue b/src/client/app/desktop/views/components/sub-note-content.vue index cb0374b910..6889dc231e 100644 --- a/src/client/app/desktop/views/components/sub-note-content.vue +++ b/src/client/app/desktop/views/components/sub-note-content.vue @@ -7,9 +7,9 @@ RP: ...
-
- ({{ '%i18n:@media-count%'.replace('{}', note.media.length) }}) - +
+ ({{ '%i18n:@media-count%'.replace('{}', note.files.length) }}) +
%i18n:@poll% diff --git a/src/client/app/desktop/views/pages/deck/deck.list-tl.vue b/src/client/app/desktop/views/pages/deck/deck.list-tl.vue index 70048f99e3..e82e76e4d0 100644 --- a/src/client/app/desktop/views/pages/deck/deck.list-tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.list-tl.vue @@ -68,7 +68,7 @@ export default Vue.extend({ (this as any).api('notes/user-list-timeline', { listId: this.list.id, limit: fetchLimit + 1, - mediaOnly: this.mediaOnly, + withFiles: this.mediaOnly, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes, includeLocalRenotes: this.$store.state.settings.showLocalRenotes @@ -90,7 +90,7 @@ export default Vue.extend({ listId: this.list.id, limit: fetchLimit + 1, untilId: (this.$refs.timeline as any).tail().id, - mediaOnly: this.mediaOnly, + withFiles: this.mediaOnly, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes, includeLocalRenotes: this.$store.state.settings.showLocalRenotes @@ -109,7 +109,7 @@ export default Vue.extend({ return promise; }, onNote(note) { - if (this.mediaOnly && note.media.length == 0) return; + if (this.mediaOnly && note.files.length == 0) return; // Prepend a note (this.$refs.timeline as any).prepend(note); diff --git a/src/client/app/desktop/views/pages/deck/deck.note.vue b/src/client/app/desktop/views/pages/deck/deck.note.vue index 2615c0d090..b42df1f347 100644 --- a/src/client/app/desktop/views/pages/deck/deck.note.vue +++ b/src/client/app/desktop/views/pages/deck/deck.note.vue @@ -28,8 +28,8 @@ RP:
-
- +
+
%fa:map-marker-alt% %i18n:@location% @@ -54,11 +54,11 @@
-
- +
+
-
- +
+
@@ -100,7 +100,7 @@ export default Vue.extend({ isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds.length == 0 && + this.note.fileIds.length == 0 && this.note.poll == null); }, @@ -371,7 +371,7 @@ root(isDark) .mk-url-preview margin-top 8px - > .media + > .files > img display block max-width 100% diff --git a/src/client/app/desktop/views/pages/deck/deck.notes.vue b/src/client/app/desktop/views/pages/deck/deck.notes.vue index f7fca5de92..2e7e30f12a 100644 --- a/src/client/app/desktop/views/pages/deck/deck.notes.vue +++ b/src/client/app/desktop/views/pages/deck/deck.notes.vue @@ -127,7 +127,7 @@ export default Vue.extend({ prepend(note, silent = false) { //#region 弾く const isMyNote = note.userId == this.$store.state.i.id; - const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null; + const isPureRenote = note.renoteId != null && note.text == null && note.fileIds.length == 0 && note.poll == null; if (this.$store.state.settings.showMyRenotes === false) { if (isMyNote && isPureRenote) { diff --git a/src/client/app/desktop/views/pages/deck/deck.tl.vue b/src/client/app/desktop/views/pages/deck/deck.tl.vue index a9e4d489c3..120ceb7fc2 100644 --- a/src/client/app/desktop/views/pages/deck/deck.tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.tl.vue @@ -96,7 +96,7 @@ export default Vue.extend({ (this.$refs.timeline as any).init(() => new Promise((res, rej) => { (this as any).api(this.endpoint, { limit: fetchLimit + 1, - mediaOnly: this.mediaOnly, + withFiles: this.mediaOnly, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes, includeLocalRenotes: this.$store.state.settings.showLocalRenotes @@ -117,7 +117,7 @@ export default Vue.extend({ const promise = (this as any).api(this.endpoint, { limit: fetchLimit + 1, - mediaOnly: this.mediaOnly, + withFiles: this.mediaOnly, untilId: (this.$refs.timeline as any).tail().id, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes, @@ -138,7 +138,7 @@ export default Vue.extend({ }, onNote(note) { - if (this.mediaOnly && note.media.length == 0) return; + if (this.mediaOnly && note.files.length == 0) return; // Prepend a note (this.$refs.timeline as any).prepend(note); diff --git a/src/client/app/desktop/views/pages/user/user.photos.vue b/src/client/app/desktop/views/pages/user/user.photos.vue index 64c537f1ed..c5cd9e24fe 100644 --- a/src/client/app/desktop/views/pages/user/user.photos.vue +++ b/src/client/app/desktop/views/pages/user/user.photos.vue @@ -24,12 +24,12 @@ export default Vue.extend({ mounted() { (this as any).api('users/notes', { userId: this.user.id, - withMedia: true, + withFiles: true, limit: 9 }).then(notes => { notes.forEach(note => { - note.media.forEach(media => { - if (this.images.length < 9) this.images.push(media); + note.files.forEach(file => { + if (this.images.length < 9) this.images.push(file); }); }); this.fetching = false; diff --git a/src/client/app/desktop/views/pages/user/user.timeline.vue b/src/client/app/desktop/views/pages/user/user.timeline.vue index 67987fcb94..54221380a7 100644 --- a/src/client/app/desktop/views/pages/user/user.timeline.vue +++ b/src/client/app/desktop/views/pages/user/user.timeline.vue @@ -66,7 +66,7 @@ export default Vue.extend({ limit: fetchLimit + 1, untilDate: this.date ? this.date.getTime() : undefined, includeReplies: this.mode == 'with-replies', - withMedia: this.mode == 'with-media' + withFiles: this.mode == 'with-media' }).then(notes => { if (notes.length == fetchLimit + 1) { notes.pop(); @@ -86,7 +86,7 @@ export default Vue.extend({ userId: this.user.id, limit: fetchLimit + 1, includeReplies: this.mode == 'with-replies', - withMedia: this.mode == 'with-media', + withFiles: this.mode == 'with-media', untilId: (this.$refs.timeline as any).tail().id }); diff --git a/src/client/app/desktop/views/widgets/trends.vue b/src/client/app/desktop/views/widgets/trends.vue index c33bf2f2f2..aeaab63ac4 100644 --- a/src/client/app/desktop/views/widgets/trends.vue +++ b/src/client/app/desktop/views/widgets/trends.vue @@ -49,7 +49,7 @@ export default define({ offset: this.offset, renote: false, reply: false, - media: false, + file: false, poll: false }).then(notes => { const note = notes ? notes[0] : null; diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue index 786e57bb22..10ff3fcc09 100644 --- a/src/client/app/mobile/views/components/note-detail.vue +++ b/src/client/app/mobile/views/components/note-detail.vue @@ -40,8 +40,8 @@ (%i18n:@deleted%)
-
- +
+
@@ -113,7 +113,7 @@ export default Vue.extend({ isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds.length == 0 && + this.note.fileIds.length == 0 && this.note.poll == null); }, @@ -369,7 +369,7 @@ root(isDark) > .mk-url-preview margin-top 8px - > .media + > .files > img display block max-width 100% diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue index 258433cb3f..9bd4a83ecb 100644 --- a/src/client/app/mobile/views/components/note.vue +++ b/src/client/app/mobile/views/components/note.vue @@ -28,8 +28,8 @@ RP:
-
- +
+
@@ -90,7 +90,7 @@ export default Vue.extend({ isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds.length == 0 && + this.note.fileIds.length == 0 && this.note.poll == null); }, @@ -414,7 +414,7 @@ root(isDark) .mk-url-preview margin-top 8px - > .media + > .files > img display block max-width 100% diff --git a/src/client/app/mobile/views/components/notes.vue b/src/client/app/mobile/views/components/notes.vue index 714e521c0f..ce2670dc52 100644 --- a/src/client/app/mobile/views/components/notes.vue +++ b/src/client/app/mobile/views/components/notes.vue @@ -125,7 +125,7 @@ export default Vue.extend({ prepend(note, silent = false) { //#region 弾く const isMyNote = note.userId == this.$store.state.i.id; - const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null; + const isPureRenote = note.renoteId != null && note.text == null && note.fileIds.length == 0 && note.poll == null; if (this.$store.state.settings.showMyRenotes === false) { if (isMyNote && isPureRenote) { diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index 8b1f7b08c8..644e27cce8 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -200,12 +200,12 @@ export default Vue.extend({ attachMedia(driveFile) { this.files.push(driveFile); - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); }, detachMedia(file) { this.files = this.files.filter(x => x.id != file.id); - this.$emit('change-attached-media', this.files); + this.$emit('change-attached-files', this.files); }, onChangeFile() { @@ -269,7 +269,7 @@ export default Vue.extend({ this.text = ''; this.files = []; this.poll = false; - this.$emit('change-attached-media'); + this.$emit('change-attached-files'); }, post() { @@ -277,7 +277,7 @@ export default Vue.extend({ const viaMobile = this.$store.state.settings.disableViaMobile !== true; (this as any).api('notes/create', { text: this.text == '' ? undefined : this.text, - mediaIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined, + fileIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined, replyId: this.reply ? this.reply.id : undefined, renoteId: this.renote ? this.renote.id : undefined, poll: this.poll ? (this.$refs.poll as any).get() : undefined, diff --git a/src/client/app/mobile/views/components/sub-note-content.vue b/src/client/app/mobile/views/components/sub-note-content.vue index a4ce49786e..4d0aa25f34 100644 --- a/src/client/app/mobile/views/components/sub-note-content.vue +++ b/src/client/app/mobile/views/components/sub-note-content.vue @@ -7,9 +7,9 @@ RP: ...
-
- ({{ '%i18n:@media-count%'.replace('{}', note.media.length) }}) - +
+ ({{ '%i18n:@media-count%'.replace('{}', note.files.length) }}) +
%i18n:@poll% diff --git a/src/client/app/mobile/views/components/user-timeline.vue b/src/client/app/mobile/views/components/user-timeline.vue index 6be675c0a7..7cd23d6655 100644 --- a/src/client/app/mobile/views/components/user-timeline.vue +++ b/src/client/app/mobile/views/components/user-timeline.vue @@ -41,7 +41,7 @@ export default Vue.extend({ (this.$refs.timeline as any).init(() => new Promise((res, rej) => { (this as any).api('users/notes', { userId: this.user.id, - withMedia: this.withMedia, + withFiles: this.withMedia, limit: fetchLimit + 1 }).then(notes => { if (notes.length == fetchLimit + 1) { @@ -62,7 +62,7 @@ export default Vue.extend({ const promise = (this as any).api('users/notes', { userId: this.user.id, - withMedia: this.withMedia, + withFiles: this.withMedia, limit: fetchLimit + 1, untilId: (this.$refs.timeline as any).tail().id }); diff --git a/src/client/app/mobile/views/pages/user/home.photos.vue b/src/client/app/mobile/views/pages/user/home.photos.vue index 73ff1d5173..e9025ec816 100644 --- a/src/client/app/mobile/views/pages/user/home.photos.vue +++ b/src/client/app/mobile/views/pages/user/home.photos.vue @@ -26,7 +26,7 @@ export default Vue.extend({ mounted() { (this as any).api('users/notes', { userId: this.user.id, - withMedia: true, + withFiles: true, limit: 6 }).then(notes => { notes.forEach(note => { diff --git a/src/docs/api/entities/note.yaml b/src/docs/api/entities/note.yaml index cae9a53f82..6654be2b02 100644 --- a/src/docs/api/entities/note.yaml +++ b/src/docs/api/entities/note.yaml @@ -33,19 +33,19 @@ props: ja-JP: "投稿の本文" en-US: "The text of this note" - mediaIds: + fileIds: type: "id(DriveFile)[]" optional: true desc: - ja-JP: "添付されているメディアのID (なければレスポンスでは空配列)" - en-US: "The IDs of the attached media (empty array for response if no media is attached)" + ja-JP: "添付されているファイルのID (なければレスポンスでは空配列)" + en-US: "The IDs of the attached files (empty array for response if no files is attached)" - media: + files: type: "entity(DriveFile)[]" optional: true desc: - ja-JP: "添付されているメディア" - en-US: "The attached media" + ja-JP: "添付されているファイル" + en-US: "The attached files" userId: type: "id(User)" diff --git a/src/misc/get-note-summary.ts b/src/misc/get-note-summary.ts index ec7c74cf9f..3c6f2dd3d6 100644 --- a/src/misc/get-note-summary.ts +++ b/src/misc/get-note-summary.ts @@ -16,9 +16,9 @@ const summarize = (note: any): string => { // 本文 summary += note.text ? note.text : ''; - // メディアが添付されているとき - if (note.media.length != 0) { - summary += ` (${note.media.length}つのメディア)`; + // ファイルが添付されているとき + if (note.files.length != 0) { + summary += ` (${note.files.length}つのファイル)`; } // 投票が添付されているとき diff --git a/src/misc/is-quote.ts b/src/misc/is-quote.ts index 420f03a489..a99b8f6434 100644 --- a/src/misc/is-quote.ts +++ b/src/misc/is-quote.ts @@ -1,5 +1,5 @@ import { INote } from '../models/note'; export default function(note: INote): boolean { - return note.renoteId != null && (note.text != null || note.poll != null || (note.mediaIds != null && note.mediaIds.length > 0)); + return note.renoteId != null && (note.text != null || note.poll != null || (note.fileIds != null && note.fileIds.length > 0)); } diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts index 698ef092a6..215b49b305 100644 --- a/src/models/drive-file.ts +++ b/src/models/drive-file.ts @@ -92,7 +92,7 @@ export async function deleteDriveFile(driveFile: string | mongo.ObjectID | IDriv // このDriveFileを添付しているNoteをすべて削除 await Promise.all(( - await Note.find({ mediaIds: d._id }) + await Note.find({ fileIds: d._id }) ).map(x => deleteNote(x))); // このDriveFileを添付しているMessagingMessageをすべて削除 diff --git a/src/models/note.ts b/src/models/note.ts index 9d2e23d901..98d37caf22 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -6,7 +6,7 @@ import { IUser, pack as packUser } from './user'; import { pack as packApp } from './app'; import PollVote, { deletePollVote } from './poll-vote'; import Reaction, { deleteNoteReaction } from './note-reaction'; -import { pack as packFile } from './drive-file'; +import { pack as packFile, IDriveFile } from './drive-file'; import NoteWatching, { deleteNoteWatching } from './note-watching'; import NoteReaction from './note-reaction'; import Favorite, { deleteFavorite } from './favorite'; @@ -17,9 +17,20 @@ const Note = db.get('notes'); Note.createIndex('uri', { sparse: true, unique: true }); Note.createIndex('userId'); Note.createIndex('tagsLower'); +Note.createIndex('_files.contentType'); Note.createIndex({ createdAt: -1 }); + +// 後方互換性のため +Note.update({}, { + $rename: { + mediaIds: 'fileIds' + } +}, { + multi: true +}); + export default Note; export function isValidText(text: string): boolean { @@ -34,7 +45,7 @@ export type INote = { _id: mongo.ObjectID; createdAt: Date; deletedAt: Date; - mediaIds: mongo.ObjectID[]; + fileIds: mongo.ObjectID[]; replyId: mongo.ObjectID; renoteId: mongo.ObjectID; poll: { @@ -92,6 +103,7 @@ export type INote = { inbox?: string; }; _replyIds?: mongo.ObjectID[]; + _files?: IDriveFile[]; }; /** @@ -271,11 +283,15 @@ export const pack = async ( _note.app = packApp(_note.appId); } - // Populate media - _note.media = hide ? [] : Promise.all(_note.mediaIds.map((fileId: mongo.ObjectID) => + // Populate files + _note.files = hide ? [] : Promise.all(_note.fileIds.map((fileId: mongo.ObjectID) => packFile(fileId) )); + // 後方互換性のため + _note.mediaIds = _note.fileIds; + _note.media = _note.files; + // When requested a detailed note data if (opts.detail) { //#region 重いので廃止 @@ -344,7 +360,7 @@ export const pack = async ( } if (hide) { - _note.mediaIds = []; + _note.fileIds = []; _note.text = null; _note.poll = null; _note.cw = null; diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index 1dfeebfdf7..97188b44a6 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -78,11 +78,11 @@ export async function createNote(value: any, resolver?: Resolver, silent = false } //#endergion - // 添付メディア + // 添付ファイル // TODO: attachmentは必ずしもImageではない // TODO: attachmentは必ずしも配列ではない // Noteがsensitiveなら添付もsensitiveにする - const media = note.attachment + const files = note.attachment .map(attach => attach.sensitive = note.sensitive) ? await Promise.all(note.attachment.map(x => resolveImage(actor, x))) : []; @@ -100,7 +100,7 @@ export async function createNote(value: any, resolver?: Resolver, silent = false return await post(actor, { createdAt: new Date(note.published), - media, + files: files, reply, renote: undefined, cw: note.summary, diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index 1d169d3088..6b30324ae7 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -8,8 +8,8 @@ import User from '../../../models/user'; import toHtml from '../misc/get-note-html'; export default async function renderNote(note: INote, dive = true): Promise { - const promisedFiles: Promise = note.mediaIds - ? DriveFile.find({ _id: { $in: note.mediaIds } }) + const promisedFiles: Promise = note.fileIds + ? DriveFile.find({ _id: { $in: note.fileIds } }) : Promise.resolve([]); let inReplyTo; diff --git a/src/server/activitypub/outbox.ts b/src/server/activitypub/outbox.ts index 37df190880..cc7e55b5df 100644 --- a/src/server/activitypub/outbox.ts +++ b/src/server/activitypub/outbox.ts @@ -58,7 +58,7 @@ export default async (ctx: Router.IRouterContext) => { $or: [{ text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }] }] } as any; diff --git a/src/server/api/endpoints/notes.ts b/src/server/api/endpoints/notes.ts index 029bc1a95e..4d15e9483f 100644 --- a/src/server/api/endpoints/notes.ts +++ b/src/server/api/endpoints/notes.ts @@ -20,9 +20,9 @@ export default (params: any) => new Promise(async (res, rej) => { const [renote, renoteErr] = $.bool.optional.get(params.renote); if (renoteErr) return rej('invalid renote param'); - // Get 'media' parameter - const [media, mediaErr] = $.bool.optional.get(params.media); - if (mediaErr) return rej('invalid media param'); + // Get 'files' parameter + const [files, filesErr] = $.bool.optional.get(params.files); + if (filesErr) return rej('invalid files param'); // Get 'poll' parameter const [poll, pollErr] = $.bool.optional.get(params.poll); @@ -79,8 +79,8 @@ export default (params: any) => new Promise(async (res, rej) => { query.renoteId = renote ? { $exists: true, $ne: null } : null; } - if (media != undefined) { - query.mediaIds = media ? { $exists: true, $ne: null } : []; + if (files != undefined) { + query.fileIds = files ? { $exists: true, $ne: null } : []; } if (poll != undefined) { diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts index 04f5f7562e..47b53c943b 100644 --- a/src/server/api/endpoints/notes/create.ts +++ b/src/server/api/endpoints/notes/create.ts @@ -71,9 +71,15 @@ export const meta = { ref: 'geo' }), + fileIds: $.arr($.type(ID)).optional.unique().range(1, 4).note({ + desc: { + 'ja-JP': '添付するファイル' + } + }), + mediaIds: $.arr($.type(ID)).optional.unique().range(1, 4).note({ desc: { - 'ja-JP': '添付するメディア' + 'ja-JP': '添付するファイル (このパラメータは廃止予定です。代わりに fileIds を使ってください。)' } }), @@ -124,15 +130,16 @@ export default (params: any, user: ILocalUser, app: IApp) => new Promise(async ( } let files: IDriveFile[] = []; - if (ps.mediaIds !== undefined) { + const fileIds = ps.fileIds != null ? ps.fileIds : ps.mediaIds != null ? ps.mediaIds : null; + if (fileIds != null) { // Fetch files // forEach だと途中でエラーなどがあっても return できないので // 敢えて for を使っています。 - for (const mediaId of ps.mediaIds) { + for (const fileId of fileIds) { // Fetch file // SELECT _id const entity = await DriveFile.findOne({ - _id: mediaId, + _id: fileId, 'metadata.userId': user._id }); @@ -155,7 +162,7 @@ export default (params: any, user: ILocalUser, app: IApp) => new Promise(async ( if (renote == null) { return rej('renoteee is not found'); - } else if (renote.renoteId && !renote.text && !renote.mediaIds) { + } else if (renote.renoteId && !renote.text && !renote.fileIds) { return rej('cannot renote to renote'); } } @@ -176,7 +183,7 @@ export default (params: any, user: ILocalUser, app: IApp) => new Promise(async ( } // 返信対象が引用でないRenoteだったらエラー - if (reply.renoteId && !reply.text && !reply.mediaIds) { + if (reply.renoteId && !reply.text && !reply.fileIds) { return rej('cannot reply to renote'); } } @@ -191,13 +198,13 @@ export default (params: any, user: ILocalUser, app: IApp) => new Promise(async ( // テキストが無いかつ添付ファイルが無いかつRenoteも無いかつ投票も無かったらエラー if ((ps.text === undefined || ps.text === null) && files === null && renote === null && ps.poll === undefined) { - return rej('text, mediaIds, renoteId or poll is required'); + return rej('text, fileIds, renoteId or poll is required'); } // 投稿を作成 const note = await create(user, { createdAt: new Date(), - media: files, + files: files, poll: ps.poll, text: ps.text, reply, diff --git a/src/server/api/endpoints/notes/global-timeline.ts b/src/server/api/endpoints/notes/global-timeline.ts index 8f7233e308..554245a0f4 100644 --- a/src/server/api/endpoints/notes/global-timeline.ts +++ b/src/server/api/endpoints/notes/global-timeline.ts @@ -33,9 +33,9 @@ export default async (params: any, user: ILocalUser) => { throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified'; } - // Get 'mediaOnly' parameter - const [mediaOnly, mediaOnlyErr] = $.bool.optional.get(params.mediaOnly); - if (mediaOnlyErr) throw 'invalid mediaOnly param'; + // Get 'withFiles' parameter + const [withFiles, withFilesErr] = $.bool.optional.get(params.withFiles); + if (withFilesErr) throw 'invalid withFiles param'; // ミュートしているユーザーを取得 const mutedUserIds = user ? (await Mute.find({ @@ -68,8 +68,8 @@ export default async (params: any, user: ILocalUser) => { }; } - if (mediaOnly) { - query.mediaIds = { $exists: true, $ne: [] }; + if (withFiles) { + query.fileIds = { $exists: true, $ne: [] }; } if (sinceId) { diff --git a/src/server/api/endpoints/notes/hybrid-timeline.ts b/src/server/api/endpoints/notes/hybrid-timeline.ts index 2dbb1190c1..1060792683 100644 --- a/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -66,7 +66,7 @@ export const meta = { } }), - mediaOnly: $.bool.optional.note({ + withFiles: $.bool.optional.note({ desc: { 'ja-JP': 'true にすると、メディアが添付された投稿だけ取得します' } @@ -164,7 +164,7 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] @@ -180,7 +180,7 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] @@ -196,16 +196,16 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] }); } - if (ps.mediaOnly) { + if (ps.withFiles) { query.$and.push({ - mediaIds: { $exists: true, $ne: [] } + fileIds: { $exists: true, $ne: [] } }); } diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts index bbcc6303ca..018e636ab5 100644 --- a/src/server/api/endpoints/notes/local-timeline.ts +++ b/src/server/api/endpoints/notes/local-timeline.ts @@ -33,9 +33,9 @@ export default async (params: any, user: ILocalUser) => { throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified'; } - // Get 'mediaOnly' parameter - const [mediaOnly, mediaOnlyErr] = $.bool.optional.get(params.mediaOnly); - if (mediaOnlyErr) throw 'invalid mediaOnly param'; + // Get 'withFiles' parameter + const [withFiles, withFilesErr] = $.bool.optional.get(params.withFiles); + if (withFilesErr) throw 'invalid withFiles param'; // ミュートしているユーザーを取得 const mutedUserIds = user ? (await Mute.find({ @@ -69,8 +69,8 @@ export default async (params: any, user: ILocalUser) => { }; } - if (mediaOnly) { - query.mediaIds = { $exists: true, $ne: [] }; + if (withFiles) { + query.fileIds = { $exists: true, $ne: [] }; } if (sinceId) { diff --git a/src/server/api/endpoints/notes/search_by_tag.ts b/src/server/api/endpoints/notes/search_by_tag.ts index e092275fe8..317a0726d3 100644 --- a/src/server/api/endpoints/notes/search_by_tag.ts +++ b/src/server/api/endpoints/notes/search_by_tag.ts @@ -247,7 +247,7 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => if (media != null) { if (media) { push({ - mediaIds: { + fileIds: { $exists: true, $ne: null } @@ -255,11 +255,11 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => } else { push({ $or: [{ - mediaIds: { + fileIds: { $exists: false } }, { - mediaIds: null + fileIds: null }] }); } diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index 099bf2010b..145f648c56 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -67,7 +67,7 @@ export const meta = { } }), - mediaOnly: $.bool.optional.note({ + withFiles: $.bool.optional.note({ desc: { 'ja-JP': 'true にすると、メディアが添付された投稿だけ取得します' } @@ -154,7 +154,7 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] @@ -170,7 +170,7 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] @@ -186,16 +186,16 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] }); } - if (ps.mediaOnly) { + if (ps.withFiles) { query.$and.push({ - mediaIds: { $exists: true, $ne: [] } + fileIds: { $exists: true, $ne: [] } }); } diff --git a/src/server/api/endpoints/notes/trend.ts b/src/server/api/endpoints/notes/trend.ts index 7a0a098f28..9f55ed3243 100644 --- a/src/server/api/endpoints/notes/trend.ts +++ b/src/server/api/endpoints/notes/trend.ts @@ -52,7 +52,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = } if (media != undefined) { - query.mediaIds = media ? { $exists: true, $ne: null } : null; + query.fileIds = media ? { $exists: true, $ne: null } : null; } if (poll != undefined) { diff --git a/src/server/api/endpoints/notes/user-list-timeline.ts b/src/server/api/endpoints/notes/user-list-timeline.ts index a7b43014ed..e00a7de371 100644 --- a/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/src/server/api/endpoints/notes/user-list-timeline.ts @@ -73,7 +73,7 @@ export const meta = { } }), - mediaOnly: $.bool.optional.note({ + withFiles: $.bool.optional.note({ desc: { 'ja-JP': 'true にすると、メディアが添付された投稿だけ取得します' } @@ -160,7 +160,7 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] @@ -176,7 +176,7 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] @@ -192,16 +192,16 @@ export default async (params: any, user: ILocalUser) => { }, { text: { $ne: null } }, { - mediaIds: { $ne: [] } + fileIds: { $ne: [] } }, { poll: { $ne: null } }] }); } - if (ps.mediaOnly) { + if (ps.withFiles) { query.$and.push({ - mediaIds: { $exists: true, $ne: [] } + fileIds: { $exists: true, $ne: [] } }); } diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index ff7855bde0..d894e52dba 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -27,9 +27,9 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => const [includeReplies = true, includeRepliesErr] = $.bool.optional.get(params.includeReplies); if (includeRepliesErr) return rej('invalid includeReplies param'); - // Get 'withMedia' parameter - const [withMedia = false, withMediaErr] = $.bool.optional.get(params.withMedia); - if (withMediaErr) return rej('invalid withMedia param'); + // Get 'withFiles' parameter + const [withFiles = false, withFilesErr] = $.bool.optional.get(params.withFiles); + if (withFilesErr) return rej('invalid withFiles param'); // Get 'limit' parameter const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit); @@ -104,8 +104,8 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => query.replyId = null; } - if (withMedia) { - query.mediaIds = { + if (withFiles) { + query.fileIds = { $exists: true, $ne: [] }; diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 63e3557828..11e3755863 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -84,7 +84,7 @@ type Option = { text?: string; reply?: INote; renote?: INote; - media?: IDriveFile[]; + files?: IDriveFile[]; geo?: any; poll?: any; viaMobile?: boolean; @@ -135,7 +135,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise< const mentionedUsers = await extractMentionedUsers(tokens); - const note = await insertNote(user, data, tokens, tags, mentionedUsers); + const note = await insertNote(user, data, tags, mentionedUsers); res(note); @@ -309,10 +309,10 @@ async function publish(user: IUser, note: INote, noteObj: any, reply: INote, ren publishToUserLists(note, noteObj); } -async function insertNote(user: IUser, data: Option, tokens: ReturnType, tags: string[], mentionedUsers: IUser[]) { +async function insertNote(user: IUser, data: Option, tags: string[], mentionedUsers: IUser[]) { const insert: any = { createdAt: data.createdAt, - mediaIds: data.media ? data.media.map(file => file._id) : [], + fileIds: data.files ? data.files.map(file => file._id) : [], replyId: data.reply ? data.reply._id : null, renoteId: data.renote ? data.renote._id : null, text: data.text, @@ -347,7 +347,8 @@ async function insertNote(user: IUser, data: Option, tokens: ReturnType Date: Thu, 6 Sep 2018 04:57:21 +0900 Subject: 8.27.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 775c997e55..60c6a09787 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "9.0.0", - "clientVersion": "1.0.9358", + "version": "8.27.0", + "clientVersion": "1.0.9378", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From a1b026239e8d38ae1c25bdeb59086551bbac0397 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 6 Sep 2018 19:55:20 +0900 Subject: fix(package): update @types/ws to version 6.0.1 (#2636) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 60c6a09787..3aa41cd504 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "@types/webpack": "4.4.11", "@types/webpack-stream": "3.2.10", "@types/websocket": "0.0.40", - "@types/ws": "6.0.0", + "@types/ws": "6.0.1", "animejs": "2.2.0", "autosize": "4.0.2", "autwh": "0.1.0", -- cgit v1.2.3-freya From 5dd2feba9bf12598eb240e3ece1844124392917d Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 6 Sep 2018 19:55:29 +0900 Subject: fix(package): update @types/minio to version 7.0.0 (#2626) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 3aa41cd504..811a60814a 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@types/koa-send": "4.1.1", "@types/koa-views": "2.0.3", "@types/koa__cors": "2.2.3", - "@types/minio": "6.0.2", + "@types/minio": "7.0.0", "@types/mkdirp": "0.5.2", "@types/mocha": "5.2.3", "@types/mongodb": "3.1.4", -- cgit v1.2.3-freya From aa31061d90dee10bb11a2d734a5635a9b0fca879 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 7 Sep 2018 04:23:26 +0900 Subject: fix(package): update node-sass-json-importer to version 4.0.1 (#2645) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 811a60814a..71068479dc 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "nan": "2.11.0", "nested-property": "0.0.7", "node-sass": "4.9.3", - "node-sass-json-importer": "4.0.0", + "node-sass-json-importer": "4.0.1", "nprogress": "0.2.0", "object-assign-deep": "0.4.0", "on-build-webpack": "0.1.0", -- cgit v1.2.3-freya From 6d9716f90eca1ed68b4875659b578abde926c84e Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Sep 2018 04:24:08 +0900 Subject: 8.28.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 71068479dc..4b7431b50e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.27.0", - "clientVersion": "1.0.9378", + "version": "8.28.0", + "clientVersion": "1.0.9400", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 95ce8dce3d874c0f1a23cad929569039052f214d Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Sep 2018 05:32:18 +0900 Subject: 8.28.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 4b7431b50e..5b7567e4cc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.28.0", + "version": "8.28.1", "clientVersion": "1.0.9400", "codename": "nighthike", "main": "./built/index.js", -- cgit v1.2.3-freya From e955fe1ffd38dd2da91e548748da2577810840f1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Sep 2018 05:47:47 +0900 Subject: 8.29.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 5b7567e4cc..ab984eef5c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.28.1", - "clientVersion": "1.0.9400", + "version": "8.29.0", + "clientVersion": "1.0.9406", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 2c0e514fb2dc5c8ac534f163beb0a36b9787c309 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 7 Sep 2018 10:32:06 +0000 Subject: fix(package): update commander to version 2.18.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index ab984eef5c..82c7c828c3 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "cafy": "11.3.0", "chalk": "2.4.1", "chart.js": "2.7.2", - "commander": "2.17.1", + "commander": "2.18.0", "crc-32": "1.2.0", "css-loader": "1.0.0", "dateformat": "3.0.3", -- cgit v1.2.3-freya From 8c6856d894b6ae95f1f935eb31857b43e9acff2d Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Sep 2018 20:21:25 +0900 Subject: Improve welcome page --- locales/ja-JP.yml | 1 + package.json | 1 + src/client/app/common/views/components/index.ts | 2 + .../app/common/views/components/tag-cloud.vue | 90 ++++++++++++++++++++++ src/client/app/desktop/views/pages/welcome.vue | 47 +++++++++-- 5 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 src/client/app/common/views/components/tag-cloud.vue (limited to 'package.json') diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0c4825e8c4..3cf8d90e9d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -994,6 +994,7 @@ desktop/views/pages/welcome.vue: announcements: "お知らせ" photos: "最近の画像" powered-by-misskey: "Powered by Misskey." + info: "情報" desktop/views/pages/drive.vue: title: "Misskey Drive" diff --git a/package.json b/package.json index ab984eef5c..9b49dfaac4 100644 --- a/package.json +++ b/package.json @@ -217,6 +217,7 @@ "vue-style-loader": "4.1.2", "vue-template-compiler": "2.5.17", "vuedraggable": "2.16.0", + "vuewordcloud": "18.7.11", "vuex": "3.0.1", "vuex-persistedstate": "2.5.4", "web-push": "3.3.2", diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts index 4700b6269e..75c6086d7c 100644 --- a/src/client/app/common/views/components/index.ts +++ b/src/client/app/common/views/components/index.ts @@ -1,5 +1,6 @@ import Vue from 'vue'; +import tagCloud from './tag-cloud.vue'; import trends from './trends.vue'; import analogClock from './analog-clock.vue'; import menu from './menu.vue'; @@ -41,6 +42,7 @@ import uiSelect from './ui/select.vue'; import formButton from './ui/form/button.vue'; import formRadio from './ui/form/radio.vue'; +Vue.component('mk-tag-cloud', tagCloud); Vue.component('mk-trends', trends); Vue.component('mk-analog-clock', analogClock); Vue.component('mk-menu', menu); diff --git a/src/client/app/common/views/components/tag-cloud.vue b/src/client/app/common/views/components/tag-cloud.vue new file mode 100644 index 0000000000..6675ba608e --- /dev/null +++ b/src/client/app/common/views/components/tag-cloud.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/welcome.vue b/src/client/app/desktop/views/pages/welcome.vue index f601bc9016..549d9175f3 100644 --- a/src/client/app/desktop/views/pages/welcome.vue +++ b/src/client/app/desktop/views/pages/welcome.vue @@ -50,6 +50,12 @@
+
+
+ +
+
+ + +
+
%fa:info-circle% %i18n:@info%
+
+
+

Version: {{ meta.version }}

+

Maintainer: {{ meta.maintainer.name }}

+
+
+
@@ -92,6 +108,7 @@ import { concat } from '../../../../../prelude/array'; export default Vue.extend({ data() { return { + meta: null, stats: null, copyright, host, @@ -104,6 +121,7 @@ export default Vue.extend({ created() { (this as any).os.getMeta().then(meta => { + this.meta = meta; this.name = meta.name; this.description = meta.description; this.announcements = meta.broadcasts; @@ -210,13 +228,12 @@ root(isDark) > .body display grid - grid-template-rows 1fr 1fr 64px + grid-template-rows 1fr 1fr 256px 64px grid-template-columns 1fr 1fr 350px gap 16px width 100% max-width 1200px - height 100vh - min-height 950px + height 1200px margin 0 auto padding 64px @@ -328,17 +345,25 @@ root(isDark) background-position center center background-size cover + > .tag-cloud + grid-row 3 + grid-column 1 / 3 + + > div + height 256px + padding 32px + > .nav display flex justify-content center align-items center - grid-row 3 + grid-row 4 grid-column 1 / 3 font-size 14px > .side display grid - grid-row 1 / 4 + grid-row 1 / 5 grid-column 3 grid-template-rows 1fr 350px grid-template-columns 1fr @@ -354,6 +379,18 @@ root(isDark) grid-column 1 padding 8px + > .info + grid-row 3 + grid-column 1 + + > div + padding 16px + + > .body + > p + display block + margin 0 + .mk-welcome[data-darkmode] root(true) -- cgit v1.2.3-freya From dac7387a7f1d2737db46b770877a33aa05fe011c Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 7 Sep 2018 20:22:04 +0900 Subject: fix(package): update minio to version 7.0.1 (#2655) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 9b49dfaac4..4874e873dc 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,7 @@ "lodash.assign": "4.2.0", "mecab-async": "0.1.2", "merge-options": "1.0.1", - "minio": "7.0.0", + "minio": "7.0.1", "mkdirp": "0.5.1", "mocha": "5.2.0", "moji": "0.5.1", -- cgit v1.2.3-freya From e7180d529aeb6603871c0107709dcbb586633c02 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Sep 2018 21:14:27 +0900 Subject: 8.30.0 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 35b9386191..b123d20798 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.29.0", - "clientVersion": "1.0.9406", + "version": "8.30.0", + "clientVersion": "1.0.9481", "codename": "nighthike", "main": "./built/index.js", "private": true, @@ -90,7 +90,7 @@ "cafy": "11.3.0", "chalk": "2.4.1", "chart.js": "2.7.2", - "commander": "2.18.0", + "commander": "2.17.1", "crc-32": "1.2.0", "css-loader": "1.0.0", "dateformat": "3.0.3", -- cgit v1.2.3-freya From 11f25ea2e7ac2b094e4bb329e2ba6acf376f97a8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 8 Sep 2018 06:44:34 +0900 Subject: 8.31.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index b123d20798..a3e7786226 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.30.0", - "clientVersion": "1.0.9481", + "version": "8.31.0", + "clientVersion": "1.0.9486", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From d44dc7e00d54d4c1cf0f18faf60b53b7e88545a6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 8 Sep 2018 15:30:07 +0900 Subject: 8.32.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index a3e7786226..32396cb64e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.31.0", - "clientVersion": "1.0.9486", + "version": "8.32.0", + "clientVersion": "1.0.9489", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 408118a1e8595a8f50e0a002416b25b0c463e23a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 8 Sep 2018 23:20:15 +0900 Subject: 8.33.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 32396cb64e..0112967b43 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.32.0", - "clientVersion": "1.0.9489", + "version": "8.33.0", + "clientVersion": "1.0.9497", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 0790dd7a2c02a94698f50aad15236ec05bf77437 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 9 Sep 2018 02:45:29 +0900 Subject: 8.33.1 --- package.json | 2 +- src/models/note.ts | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 0112967b43..9323ab0ea3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.33.0", + "version": "8.33.1", "clientVersion": "1.0.9497", "codename": "nighthike", "main": "./built/index.js", diff --git a/src/models/note.ts b/src/models/note.ts index 98d37caf22..181ebecf24 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -21,16 +21,6 @@ Note.createIndex('_files.contentType'); Note.createIndex({ createdAt: -1 }); - -// 後方互換性のため -Note.update({}, { - $rename: { - mediaIds: 'fileIds' - } -}, { - multi: true -}); - export default Note; export function isValidText(text: string): boolean { -- cgit v1.2.3-freya From 0fabb6a057cfc92e2d76070a1baa1f934da4fbb8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 03:40:01 +0900 Subject: 8.34.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 9323ab0ea3..d981dbf25a 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.33.1", - "clientVersion": "1.0.9497", + "version": "8.34.0", + "clientVersion": "1.0.9559", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From eebed9944c85bbf47381cbd21582321012692b90 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 05:45:59 +0900 Subject: 8.34.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index d981dbf25a..410b23bc52 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.34.0", - "clientVersion": "1.0.9559", + "version": "8.34.1", + "clientVersion": "1.0.9561", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 77d9ae92f6da8a7a403c5aa276ee789df223ee99 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 15:07:37 +0900 Subject: 8.34.2 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 410b23bc52..c8f8718439 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.34.1", - "clientVersion": "1.0.9561", + "version": "8.34.2", + "clientVersion": "1.0.9567", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From c6e69ffae479a986d09f70001d09dfd35a89615c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 18:07:38 +0900 Subject: 8.34.3 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index c8f8718439..6c24ae56a6 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.34.2", - "clientVersion": "1.0.9567", + "version": "8.34.3", + "clientVersion": "1.0.9572", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From fe3dd25bc392032f5212b0769ff70950c857fd99 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 21:40:14 +0900 Subject: 8.34.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 6c24ae56a6..304c309a52 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.34.3", + "version": "8.34.4", "clientVersion": "1.0.9572", "codename": "nighthike", "main": "./built/index.js", -- cgit v1.2.3-freya From 6d536c61e84c007f92ec8f24682b5a5b8885e1f9 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 12 Sep 2018 17:48:43 +0000 Subject: fix(package): update systeminformation to version 3.45.6 Closes #2617 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 304c309a52..88fac6d521 100644 --- a/package.json +++ b/package.json @@ -194,7 +194,7 @@ "stylus": "0.54.5", "stylus-loader": "3.0.2", "summaly": "2.2.0", - "systeminformation": "3.45.1", + "systeminformation": "3.45.6", "syuilo-password-strength": "0.0.1", "textarea-caret": "3.1.0", "tmp": "0.0.33", -- cgit v1.2.3-freya From c3c885de479cd091f742826f9a3ccfe373880ef5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Sep 2018 02:52:29 +0900 Subject: 8.35.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 304c309a52..17be739743 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.34.4", - "clientVersion": "1.0.9572", + "version": "8.35.0", + "clientVersion": "1.0.9589", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From b28eb54cac5af6db4aab50e2b5b94440d6c67e33 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 13 Sep 2018 18:28:12 +0900 Subject: fix(package): update vue-loader to version 15.4.2 (#2692) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 17be739743..a80be265ac 100644 --- a/package.json +++ b/package.json @@ -212,7 +212,7 @@ "vue-cropperjs": "2.2.1", "vue-js-modal": "1.3.26", "vue-json-tree-view": "2.1.4", - "vue-loader": "15.4.1", + "vue-loader": "15.4.2", "vue-router": "3.0.1", "vue-style-loader": "4.1.2", "vue-template-compiler": "2.5.17", -- cgit v1.2.3-freya From 9ed2a82d3bd8051350057c27fad473085b2b4d87 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Sep 2018 18:29:11 +0900 Subject: fix(package): update debug to version 4.0.1 (#2700) Closes #2682 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index a80be265ac..4f2543b0c2 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "crc-32": "1.2.0", "css-loader": "1.0.0", "dateformat": "3.0.3", - "debug": "3.1.0", + "debug": "4.0.1", "deep-equal": "1.0.1", "deepcopy": "0.6.3", "diskusage": "0.2.4", -- cgit v1.2.3-freya From c2eb80b44cc921dcb2e035fe2f15deaba475fd70 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Sep 2018 18:29:29 +0900 Subject: fix(package): update @types/mongodb to version 3.1.7 (#2701) Closes #2681 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 4f2543b0c2..c62efeef54 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@types/minio": "7.0.0", "@types/mkdirp": "0.5.2", "@types/mocha": "5.2.3", - "@types/mongodb": "3.1.4", + "@types/mongodb": "3.1.7", "@types/ms": "0.7.30", "@types/node": "10.9.4", "@types/portscanner": "2.1.0", -- cgit v1.2.3-freya From be842b5071512e9ed63f8b66fa98d4c7dc7005e1 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 13 Sep 2018 18:29:48 +0900 Subject: fix(package): update webpack to version 4.18.0 (#2680) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index c62efeef54..005dd7a94f 100644 --- a/package.json +++ b/package.json @@ -222,7 +222,7 @@ "vuex-persistedstate": "2.5.4", "web-push": "3.3.2", "webfinger.js": "2.6.6", - "webpack": "4.17.2", + "webpack": "4.18.0", "webpack-cli": "3.1.0", "websocket": "1.0.26", "ws": "6.0.0", -- cgit v1.2.3-freya From b51843ed50449758331444493eef30a38694d542 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Sep 2018 18:42:30 +0900 Subject: 8.36.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index b5dca222f9..c7387d7bcf 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.35.0", - "clientVersion": "1.0.9589", + "version": "8.36.0", + "clientVersion": "1.0.9637", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 17cc5a9b953a6af15b4b936c75c74086c9853b9a Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 13 Sep 2018 19:35:35 +0900 Subject: fix(package): update webpack to version 4.18.1 (#2704) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index c7387d7bcf..fa634da10c 100644 --- a/package.json +++ b/package.json @@ -222,7 +222,7 @@ "vuex-persistedstate": "2.5.4", "web-push": "3.3.2", "webfinger.js": "2.6.6", - "webpack": "4.18.0", + "webpack": "4.18.1", "webpack-cli": "3.1.0", "websocket": "1.0.26", "ws": "6.0.0", -- cgit v1.2.3-freya From 2c59da36c2880782982d1b6cccb671e535643dd3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 14 Sep 2018 09:19:24 +0900 Subject: 8.37.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index fa634da10c..1d21d4583c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.36.0", - "clientVersion": "1.0.9637", + "version": "8.37.0", + "clientVersion": "1.0.9642", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 10dc97c43fefcc76465078009a920b4f007bafa1 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 14 Sep 2018 03:29:26 +0000 Subject: fix(package): update webpack to version 4.19.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package.json') diff --git a/package.json b/package.json index 1d21d4583c..ac86a8128e 100644 --- a/package.json +++ b/package.json @@ -222,7 +222,7 @@ "vuex-persistedstate": "2.5.4", "web-push": "3.3.2", "webfinger.js": "2.6.6", - "webpack": "4.18.1", + "webpack": "4.19.0", "webpack-cli": "3.1.0", "websocket": "1.0.26", "ws": "6.0.0", -- cgit v1.2.3-freya From c87a43bdba9634934f6349db887e00edc43dbe28 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 14 Sep 2018 15:16:55 +0900 Subject: 8.38.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index ac86a8128e..48a1a3d8bc 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.37.0", - "clientVersion": "1.0.9642", + "version": "8.38.0", + "clientVersion": "1.0.9647", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From e615a3fdf3087b5e2bbb390154401441f09713eb Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 14 Sep 2018 20:35:31 +0900 Subject: 8.39.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 48a1a3d8bc..4d2a4b285b 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.38.0", - "clientVersion": "1.0.9647", + "version": "8.39.0", + "clientVersion": "1.0.9650", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From c985fed3e43bae05f9e6e854f651f49f2bc3e83a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Sep 2018 05:40:58 +0900 Subject: Resolve #2328 --- locales/ja-JP.yml | 4 + package.json | 1 + src/client/app/desktop/views/components/charts.vue | 103 ++++++++++++++++++++- src/models/stats.ts | 26 ++++++ src/server/api/endpoints/chart.ts | 21 +++++ src/server/index.ts | 25 +++++ src/services/update-chart.ts | 22 +++++ 7 files changed, 200 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5257d616c4..72dc88b7b3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -518,6 +518,7 @@ desktop/views/components/charts.vue: notes: "投稿" users: "ユーザー" drive: "ドライブ" + network: "ネットワーク" charts: notes: "投稿の増減 (統合)" local-notes: "投稿の増減 (ローカル)" @@ -529,6 +530,9 @@ desktop/views/components/charts.vue: drive-total: "ドライブ使用量の累計" drive-files: "ドライブのファイル数の増減" drive-files-total: "ドライブのファイル数の累計" + network-requests: "リクエスト" + network-time: "応答時間" + network-usage: "通信量" desktop/views/components/choose-file-from-drive-window.vue: choose-file: "ファイル選択中" diff --git a/package.json b/package.json index 4d2a4b285b..4b9eaf9e22 100644 --- a/package.json +++ b/package.json @@ -179,6 +179,7 @@ "redis": "2.8.0", "request": "2.88.0", "request-promise-native": "1.0.5", + "request-stats": "3.0.0", "rimraf": "2.6.2", "rndstr": "1.0.0", "s-age": "1.1.2", diff --git a/src/client/app/desktop/views/components/charts.vue b/src/client/app/desktop/views/components/charts.vue index c4e92e429f..6514cdf788 100644 --- a/src/client/app/desktop/views/components/charts.vue +++ b/src/client/app/desktop/views/components/charts.vue @@ -19,6 +19,11 @@ + + + + +
%i18n:@per-day% | %i18n:@per-hour% @@ -41,7 +46,10 @@ const colors = { localPlus: 'rgb(52, 178, 118)', remotePlus: 'rgb(158, 255, 209)', localMinus: 'rgb(255, 97, 74)', - remoteMinus: 'rgb(255, 149, 134)' + remoteMinus: 'rgb(255, 149, 134)', + + incoming: 'rgb(52, 178, 118)', + outgoing: 'rgb(255, 97, 74)', }; const rgba = (color: string): string => { @@ -75,6 +83,9 @@ export default Vue.extend({ case 'drive-total': return this.driveTotalChart(); case 'drive-files': return this.driveFilesChart(); case 'drive-files-total': return this.driveFilesTotalChart(); + case 'network-requests': return this.networkRequestsChart(); + case 'network-time': return this.networkTimeChart(); + case 'network-usage': return this.networkUsageChart(); } }, @@ -544,7 +555,95 @@ export default Vue.extend({ } } }]; - } + }, + + networkRequestsChart(): any { + const data = this.stats.slice().reverse().map(x => ({ + date: new Date(x.date), + requests: x.network.requests + })); + + return [{ + datasets: [{ + label: 'Requests', + fill: true, + backgroundColor: rgba(colors.localPlus), + borderColor: colors.localPlus, + borderWidth: 2, + pointBackgroundColor: '#fff', + lineTension: 0, + data: data.map(x => ({ t: x.date, y: x.requests })) + }] + }]; + }, + + networkTimeChart(): any { + const data = this.stats.slice().reverse().map(x => ({ + date: new Date(x.date), + time: x.network.requests != 0 ? (x.network.totalTime / x.network.requests) : 0, + })); + + return [{ + datasets: [{ + label: 'Avg time (ms)', + fill: true, + backgroundColor: rgba(colors.localPlus), + borderColor: colors.localPlus, + borderWidth: 2, + pointBackgroundColor: '#fff', + lineTension: 0, + data: data.map(x => ({ t: x.date, y: x.time })) + }] + }]; + }, + + networkUsageChart(): any { + const data = this.stats.slice().reverse().map(x => ({ + date: new Date(x.date), + incoming: x.network.incomingBytes, + outgoing: x.network.outgoingBytes + })); + + return [{ + datasets: [{ + label: 'Incoming', + fill: true, + backgroundColor: rgba(colors.incoming), + borderColor: colors.incoming, + borderWidth: 2, + pointBackgroundColor: '#fff', + lineTension: 0, + data: data.map(x => ({ t: x.date, y: x.incoming })) + }, { + label: 'Outgoing', + fill: true, + backgroundColor: rgba(colors.outgoing), + borderColor: colors.outgoing, + borderWidth: 2, + pointBackgroundColor: '#fff', + lineTension: 0, + data: data.map(x => ({ t: x.date, y: x.outgoing })) + }] + }, { + scales: { + yAxes: [{ + ticks: { + callback: value => { + return Vue.filter('bytes')(value, 1); + } + } + }] + }, + tooltips: { + callbacks: { + label: (tooltipItem, data) => { + const label = data.datasets[tooltipItem.datasetIndex].label || ''; + return `${label}: ${Vue.filter('bytes')(tooltipItem.yLabel, 1)}`; + } + } + } + }]; + }, } }); diff --git a/src/models/stats.ts b/src/models/stats.ts index d496f2c480..c4c838caeb 100644 --- a/src/models/stats.ts +++ b/src/models/stats.ts @@ -204,4 +204,30 @@ export interface IStats { decSize: number; }; }; + + /** + * ネットワークに関する統計 + */ + network: { + /** + * サーバーへのリクエスト数 + */ + requests: number; + + /** + * 応答時間の合計 + * TIP: (totalTime / requests) でひとつのリクエストに平均でどれくらいの時間がかかったか知れる + */ + totalTime: number; + + /** + * 合計受信データ量 + */ + incomingBytes: number; + + /** + * 合計送信データ量 + */ + outgoingBytes: number; + }; } diff --git a/src/server/api/endpoints/chart.ts b/src/server/api/endpoints/chart.ts index 7da970131e..3b1a3b56fc 100644 --- a/src/server/api/endpoints/chart.ts +++ b/src/server/api/endpoints/chart.ts @@ -6,6 +6,15 @@ type Omit = Pick>; function migrateStats(stats: IStats[]) { stats.forEach(stat => { + if (stat.network == null) { + stat.network = { + requests: 0, + totalTime: 0, + incomingBytes: 0, + outgoingBytes: 0 + }; + } + const isOldData = stat.users.local.inc == null || stat.users.local.dec == null || @@ -180,6 +189,12 @@ export default (params: any) => new Promise(async (res, rej) => { decCount: 0, decSize: 0 } + }, + network: { + requests: 0, + totalTime: 0, + incomingBytes: 0, + outgoingBytes: 0 } }); } else { @@ -236,6 +251,12 @@ export default (params: any) => new Promise(async (res, rej) => { decCount: 0, decSize: 0 } + }, + network: { + requests: 0, + totalTime: 0, + incomingBytes: 0, + outgoingBytes: 0 } }); } diff --git a/src/server/index.ts b/src/server/index.ts index f1fcf58c8d..dc60b0d9ec 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -11,11 +11,13 @@ import * as Router from 'koa-router'; import * as mount from 'koa-mount'; import * as compress from 'koa-compress'; import * as logger from 'koa-logger'; +const requestStats = require('request-stats'); //const slow = require('koa-slow'); import activityPub from './activitypub'; import webFinger from './webfinger'; import config from '../config'; +import { updateNetworkStats } from '../services/update-chart'; // Init app const app = new Koa(); @@ -81,4 +83,27 @@ export default () => new Promise(resolve => { // Listen server.listen(config.port, resolve); + + //#region Network stats + let queue: any[] = []; + + requestStats(server, (stats: any) => { + if (stats.ok) { + queue.push(stats); + } + }); + + // Bulk write + setInterval(() => { + if (queue.length == 0) return; + + const requests = queue.length; + const time = queue.reduce((a, b) => a + b.time, 0); + const incomingBytes = queue.reduce((a, b) => a + b.req.bytes, 0); + const outgoingBytes = queue.reduce((a, b) => a + b.res.bytes, 0); + queue = []; + + updateNetworkStats(requests, time, incomingBytes, outgoingBytes); + }, 5000); + //#endregion }); diff --git a/src/services/update-chart.ts b/src/services/update-chart.ts index 1f8da6be9f..78834ba601 100644 --- a/src/services/update-chart.ts +++ b/src/services/update-chart.ts @@ -96,6 +96,12 @@ async function getCurrentStats(span: 'day' | 'hour'): Promise { decCount: 0, decSize: 0 } + }, + network: { + requests: 0, + totalTime: 0, + incomingBytes: 0, + outgoingBytes: 0 } }; @@ -161,6 +167,12 @@ async function getCurrentStats(span: 'day' | 'hour'): Promise { decCount: 0, decSize: 0 } + }, + network: { + requests: 0, + totalTime: 0, + incomingBytes: 0, + outgoingBytes: 0 } }; @@ -243,3 +255,13 @@ export async function updateDriveStats(file: IDriveFile, isAdditional: boolean) await update(inc); } + +export async function updateNetworkStats(requests: number, time: number, incomingBytes: number, outgoingBytes: number) { + const inc = {} as any; + inc['network.requests'] = requests; + inc['network.totalTime'] = time; + inc['network.incomingBytes'] = incomingBytes; + inc['network.outgoingBytes'] = outgoingBytes; + + await update(inc); +} -- cgit v1.2.3-freya From 2fee2e51660fab5db24c3291403c6c6950eb61dc Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Sep 2018 05:50:08 +0900 Subject: 8.40.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 4b9eaf9e22..081780250a 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.39.0", - "clientVersion": "1.0.9650", + "version": "8.40.0", + "clientVersion": "1.0.9711", "codename": "nighthike", "main": "./built/index.js", "private": true, -- cgit v1.2.3-freya From 7b2b7d1456b500c8dd406a6e51c8f95d0f9405d3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Sep 2018 21:48:10 +0900 Subject: Resolve #2066 --- package.json | 4 - .../components/games/reversi/reversi.game.vue | 16 +- .../components/games/reversi/reversi.index.vue | 1 - .../components/games/reversi/reversi.room.vue | 7 +- src/client/app/desktop/script.ts | 1 - .../desktop/views/components/settings.drive.vue | 1 - .../desktop/views/components/settings.profile.vue | 2 +- .../app/desktop/views/components/settings.vue | 33 ++-- .../app/desktop/views/components/taskmanager.vue | 219 --------------------- src/client/app/init.ts | 11 -- src/client/app/mobile/script.ts | 1 - src/client/element.scss | 12 -- webpack.config.ts | 17 -- 13 files changed, 22 insertions(+), 303 deletions(-) delete mode 100644 src/client/app/desktop/views/components/taskmanager.vue delete mode 100644 src/client/element.scss (limited to 'package.json') diff --git a/package.json b/package.json index 081780250a..7b81c925b2 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,6 @@ "dompurify": "1.0.5", "double-ended-queue": "2.1.0-0", "elasticsearch": "15.1.1", - "element-ui": "2.4.6", "emojilib": "2.3.0", "escape-regexp": "0.0.1", "eslint": "5.0.1", @@ -132,7 +131,6 @@ "insert-text-at-cursor": "0.1.1", "is-root": "2.0.0", "is-url": "1.2.4", - "jquery": "3.3.1", "js-yaml": "3.12.0", "jsdom": "11.12.0", "koa": "2.5.1", @@ -160,8 +158,6 @@ "ms": "2.1.1", "nan": "2.11.0", "nested-property": "0.0.7", - "node-sass": "4.9.3", - "node-sass-json-importer": "4.0.1", "nprogress": "0.2.0", "object-assign-deep": "0.4.0", "on-build-webpack": "0.1.0", diff --git a/src/client/app/common/views/components/games/reversi/reversi.game.vue b/src/client/app/common/views/components/games/reversi/reversi.game.vue index 673879a435..fea19d917e 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.game.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.game.vue @@ -50,15 +50,15 @@
- - %fa:angle-double-left% - %fa:angle-left% - +
+ + +
{{ logPos }} / {{ logs.length }} - - %fa:angle-right% - %fa:angle-double-right% - +
+ + +
diff --git a/src/client/app/common/views/components/games/reversi/reversi.index.vue b/src/client/app/common/views/components/games/reversi/reversi.index.vue index fa88aeaaf4..d23902aae7 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.index.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.index.vue @@ -3,7 +3,6 @@

%i18n:@title%

%i18n:@sub-title%

- %i18n:@invite%
%i18n:@rule% diff --git a/src/client/app/common/views/components/games/reversi/reversi.room.vue b/src/client/app/common/views/components/games/reversi/reversi.room.vue index aed8718dd0..fef833d63e 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.room.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.room.vue @@ -59,11 +59,6 @@
- - diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index f0e8a42662..e32682286c 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -6,7 +6,6 @@ import VueRouter from 'vue-router'; // Style import './style.styl'; -import '../../element.scss'; import init from '../init'; import fuckAdBlock from '../common/scripts/fuck-ad-block'; diff --git a/src/client/app/desktop/views/components/settings.drive.vue b/src/client/app/desktop/views/components/settings.drive.vue index e8a3cc9685..d254b27110 100644 --- a/src/client/app/desktop/views/components/settings.drive.vue +++ b/src/client/app/desktop/views/components/settings.drive.vue @@ -1,7 +1,6 @@