Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
36215d50bd | ||
![]() |
5ff1245d0c | ||
![]() |
ebd189fb27 | ||
![]() |
6f724827bd | ||
![]() |
b6a0982012 | ||
![]() |
c3e375e8a5 | ||
![]() |
302409fd83 | ||
![]() |
a2046461c1 | ||
![]() |
6660c34120 | ||
![]() |
b88ccf0ddd | ||
![]() |
b898bbf94c | ||
![]() |
787e89eb95 | ||
![]() |
1022c2c438 | ||
![]() |
ba21c62ed4 | ||
![]() |
bfe66c919b | ||
![]() |
3dacf7f661 |
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "Spenden"
|
donation: "Spenden"
|
||||||
nav: "Navigation"
|
nav: "Navigation"
|
||||||
tips: "Tipps"
|
tips: "Tipps"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "Widget hinzufügen:"
|
widgets: "Widget hinzufügen:"
|
||||||
home: "Startseite"
|
home: "Startseite"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "Donation"
|
donation: "Donation"
|
||||||
nav: "Navigation"
|
nav: "Navigation"
|
||||||
tips: "Tips"
|
tips: "Tips"
|
||||||
|
hashtags: "Hashtags"
|
||||||
deck:
|
deck:
|
||||||
widgets: "Widgets"
|
widgets: "Widgets"
|
||||||
home: "Home"
|
home: "Home"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "寄付のお願い"
|
donation: "寄付のお願い"
|
||||||
nav: "ナビゲーション"
|
nav: "ナビゲーション"
|
||||||
tips: "ヒント"
|
tips: "ヒント"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "Dons"
|
donation: "Dons"
|
||||||
nav: "Navigation"
|
nav: "Navigation"
|
||||||
tips: "Conseils"
|
tips: "Conseils"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "Widgets"
|
widgets: "Widgets"
|
||||||
home: "Accueil"
|
home: "Accueil"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "寄付のお願い"
|
donation: "寄付のお願い"
|
||||||
nav: "ナビゲーション"
|
nav: "ナビゲーション"
|
||||||
tips: "ヒント"
|
tips: "ヒント"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
|
@@ -257,6 +257,7 @@ common/views/widgets/posts-monitor.vue:
|
|||||||
|
|
||||||
common/views/widgets/hashtags.vue:
|
common/views/widgets/hashtags.vue:
|
||||||
title: "ハッシュタグ"
|
title: "ハッシュタグ"
|
||||||
|
count: "{}人が投稿"
|
||||||
|
|
||||||
common/views/widgets/server.vue:
|
common/views/widgets/server.vue:
|
||||||
title: "サーバー情報"
|
title: "サーバー情報"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "寄付のお願い"
|
donation: "寄付のお願い"
|
||||||
nav: "ナビゲーション"
|
nav: "ナビゲーション"
|
||||||
tips: "ヒント"
|
tips: "ヒント"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "Dotacje"
|
donation: "Dotacje"
|
||||||
nav: "Nawigacja"
|
nav: "Nawigacja"
|
||||||
tips: "Wskazówki"
|
tips: "Wskazówki"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "Widżety"
|
widgets: "Widżety"
|
||||||
home: "Strona główna"
|
home: "Strona główna"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "寄付のお願い"
|
donation: "寄付のお願い"
|
||||||
nav: "ナビゲーション"
|
nav: "ナビゲーション"
|
||||||
tips: "ヒント"
|
tips: "ヒント"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "寄付のお願い"
|
donation: "寄付のお願い"
|
||||||
nav: "ナビゲーション"
|
nav: "ナビゲーション"
|
||||||
tips: "ヒント"
|
tips: "ヒント"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
|
@@ -70,6 +70,7 @@ common:
|
|||||||
donation: "寄付のお願い"
|
donation: "寄付のお願い"
|
||||||
nav: "ナビゲーション"
|
nav: "ナビゲーション"
|
||||||
tips: "ヒント"
|
tips: "ヒント"
|
||||||
|
hashtags: "ハッシュタグ"
|
||||||
deck:
|
deck:
|
||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "2.37.1",
|
"version": "2.37.2",
|
||||||
"clientVersion": "1.0.6419",
|
"clientVersion": "1.0.6437",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`">
|
<svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`" style="overflow:visible">
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient :id="gradientId" x1="0" x2="0" y1="1" y2="0">
|
<linearGradient :id="gradientId" x1="0" x2="0" y1="1" y2="0">
|
||||||
<stop offset="0%" stop-color="hsl(200, 80%, 70%)"></stop>
|
<stop offset="0%" stop-color="hsl(200, 80%, 70%)"></stop>
|
||||||
@@ -14,17 +14,17 @@
|
|||||||
:points="polylinePoints"
|
:points="polylinePoints"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke="#fff"
|
stroke="#fff"
|
||||||
stroke-width="0.7"/>
|
stroke-width="2"/>
|
||||||
<circle
|
<circle
|
||||||
:cx="headX"
|
:cx="headX"
|
||||||
:cy="headY"
|
:cy="headY"
|
||||||
r="1.2"
|
r="3"
|
||||||
fill="#fff"/>
|
fill="#fff"/>
|
||||||
</mask>
|
</mask>
|
||||||
</defs>
|
</defs>
|
||||||
<rect
|
<rect
|
||||||
x="-2" y="-2"
|
x="-10" y="-10"
|
||||||
:width="viewBoxX + 4" :height="viewBoxY + 4"
|
:width="viewBoxX + 20" :height="viewBoxY + 20"
|
||||||
:style="`stroke: none; fill: url(#${ gradientId }); mask: url(#${ maskId })`"/>
|
:style="`stroke: none; fill: url(#${ gradientId }); mask: url(#${ maskId })`"/>
|
||||||
</svg>
|
</svg>
|
||||||
</template>
|
</template>
|
||||||
@@ -65,10 +65,14 @@ export default Vue.extend({
|
|||||||
const stats = this.src.slice().reverse();
|
const stats = this.src.slice().reverse();
|
||||||
const peak = Math.max.apply(null, stats) || 1;
|
const peak = Math.max.apply(null, stats) || 1;
|
||||||
|
|
||||||
const polylinePoints = stats.map((x, i) => [this.viewBoxX - ((stats.length - 1) - i), (1 - (x / peak)) * this.viewBoxY]);
|
const polylinePoints = stats.map((n, i) => [
|
||||||
|
i * (this.viewBoxX / (stats.length - 1)),
|
||||||
|
(1 - (n / peak)) * this.viewBoxY
|
||||||
|
]);
|
||||||
|
|
||||||
this.polylinePoints = polylinePoints.map(xy => `${xy[0]},${xy[1]}`).join(' ');
|
this.polylinePoints = polylinePoints.map(xy => `${xy[0]},${xy[1]}`).join(' ');
|
||||||
|
|
||||||
this.polygonPoints = `${this.viewBoxX - (stats.length - 1)},${ this.viewBoxY } ${ this.polylinePoints } ${ this.viewBoxX },${ this.viewBoxY }`;
|
this.polygonPoints = `0,${ this.viewBoxY } ${ this.polylinePoints } ${ this.viewBoxX },${ this.viewBoxY }`;
|
||||||
|
|
||||||
this.headX = polylinePoints[polylinePoints.length - 1][0];
|
this.headX = polylinePoints[polylinePoints.length - 1][0];
|
||||||
this.headY = polylinePoints[polylinePoints.length - 1][1];
|
this.headY = polylinePoints[polylinePoints.length - 1][1];
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
<div v-for="stat in stats" :key="stat.tag">
|
<div v-for="stat in stats" :key="stat.tag">
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
<router-link :to="`/tags/${ stat.tag }`">#{{ stat.tag }}</router-link>
|
<router-link :to="`/tags/${ stat.tag }`">#{{ stat.tag }}</router-link>
|
||||||
|
<p>{{ '%i18n:@count%'.replace('{}', stat.usersCount) }}</p>
|
||||||
</div>
|
</div>
|
||||||
<x-chart class="chart" :src="stat.chart"/>
|
<x-chart class="chart" :src="stat.chart"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,7 +66,7 @@ root(isDark)
|
|||||||
.mkw-hashtags--body
|
.mkw-hashtags--body
|
||||||
> .fetching
|
> .fetching
|
||||||
margin 0
|
margin 0
|
||||||
padding 16px
|
padding 12px 16px
|
||||||
text-align center
|
text-align center
|
||||||
color #aaa
|
color #aaa
|
||||||
|
|
||||||
@@ -79,16 +80,22 @@ root(isDark)
|
|||||||
padding 16px
|
padding 16px
|
||||||
|
|
||||||
&:not(:last-child)
|
&:not(:last-child)
|
||||||
border-bottom solid 1px #393f4f
|
border-bottom solid 1px isDark ? #393f4f : #eee
|
||||||
|
|
||||||
> .tag
|
> .tag
|
||||||
flex 1
|
flex 1
|
||||||
|
font-size 14px
|
||||||
|
color isDark ? #9baec8 : #65727b
|
||||||
|
|
||||||
> a
|
> a
|
||||||
color #9baec8
|
color inherit
|
||||||
|
|
||||||
|
> p
|
||||||
|
margin 0
|
||||||
|
font-size 75%
|
||||||
|
opacity 0.7
|
||||||
|
|
||||||
> .chart
|
> .chart
|
||||||
width 50px
|
|
||||||
height 30px
|
height 30px
|
||||||
|
|
||||||
.mkw-hashtags[data-darkmode]
|
.mkw-hashtags[data-darkmode]
|
||||||
|
@@ -18,49 +18,48 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
|||||||
$unwind: '$tags'
|
$unwind: '$tags'
|
||||||
}, {
|
}, {
|
||||||
$group: {
|
$group: {
|
||||||
_id: '$tags',
|
_id: { tags: '$tags', userId: '$userId' }
|
||||||
count: {
|
|
||||||
$sum: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
tags: {
|
|
||||||
$push: {
|
|
||||||
tag: '$_id',
|
|
||||||
count: '$count'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$project: {
|
|
||||||
_id: false,
|
|
||||||
tags: true
|
|
||||||
}
|
}
|
||||||
}]) as Array<{
|
}]) as Array<{
|
||||||
tags: Array<{
|
_id: {
|
||||||
tag: string;
|
tags: string;
|
||||||
count: number;
|
userId: any;
|
||||||
}>
|
}
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
return res([]);
|
return res([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const hots = data[0].tags
|
const tags = [];
|
||||||
|
|
||||||
|
data.map(x => x._id).forEach(x => {
|
||||||
|
const i = tags.findIndex(tag => tag.name == x.tags);
|
||||||
|
if (i != -1) {
|
||||||
|
tags[i].count++;
|
||||||
|
} else {
|
||||||
|
tags.push({
|
||||||
|
name: x.tags,
|
||||||
|
count: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const hots = tags
|
||||||
.sort((a, b) => b.count - a.count)
|
.sort((a, b) => b.count - a.count)
|
||||||
.map(tag => tag.tag)
|
.map(tag => tag.name)
|
||||||
.slice(0, 10);
|
.slice(0, 5);
|
||||||
|
|
||||||
const countPromises: Array<Promise<number[]>> = [];
|
const countPromises: Array<Promise<any[]>> = [];
|
||||||
|
|
||||||
|
const range = 20;
|
||||||
|
|
||||||
for (let i = 0; i < 10; i++) {
|
|
||||||
// 10分
|
// 10分
|
||||||
const interval = 1000 * 60 * 10;
|
const interval = 1000 * 60 * 10;
|
||||||
|
|
||||||
countPromises.push(Promise.all(hots.map(tag => Note.count({
|
for (let i = 0; i < range; i++) {
|
||||||
|
|
||||||
|
countPromises.push(Promise.all(hots.map(tag => Note.distinct('userId', {
|
||||||
tags: tag,
|
tags: tag,
|
||||||
createdAt: {
|
createdAt: {
|
||||||
$lt: new Date(Date.now() - (interval * i)),
|
$lt: new Date(Date.now() - (interval * i)),
|
||||||
@@ -71,9 +70,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
|||||||
|
|
||||||
const countsLog = await Promise.all(countPromises);
|
const countsLog = await Promise.all(countPromises);
|
||||||
|
|
||||||
|
const totalCounts: any = await Promise.all(hots.map(tag => Note.distinct('userId', {
|
||||||
|
tags: tag,
|
||||||
|
createdAt: {
|
||||||
|
$gt: new Date(Date.now() - (interval * range))
|
||||||
|
}
|
||||||
|
})));
|
||||||
|
|
||||||
const stats = hots.map((tag, i) => ({
|
const stats = hots.map((tag, i) => ({
|
||||||
tag,
|
tag,
|
||||||
chart: countsLog.map(counts => counts[i])
|
chart: countsLog.map(counts => counts[i].length),
|
||||||
|
usersCount: totalCounts[i].length
|
||||||
}));
|
}));
|
||||||
|
|
||||||
res(stats);
|
res(stats);
|
||||||
|
Reference in New Issue
Block a user