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