This commit is contained in:
syuilo
2020-03-07 01:04:36 +09:00
parent c7c537c8b8
commit 1947835c51
16 changed files with 167 additions and 64 deletions

View File

@ -25,11 +25,16 @@ export const meta = {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
validator: $.optional.num,
default: 0,
},
},
res: convertLog(activeUsersChart.schema),
};
export default define(meta, async (ps) => {
return await activeUsersChart.getChart(ps.span as any, ps.limit!);
return await activeUsersChart.getChart(ps.span as any, ps.limit!, ps.offset!);
});

View File

@ -25,11 +25,16 @@ export const meta = {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
validator: $.optional.num,
default: 0,
},
},
res: convertLog(driveChart.schema),
};
export default define(meta, async (ps) => {
return await driveChart.getChart(ps.span as any, ps.limit!);
return await driveChart.getChart(ps.span as any, ps.limit!, ps.offset!);
});

View File

@ -25,11 +25,16 @@ export const meta = {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
validator: $.optional.num,
default: 0,
},
},
res: convertLog(federationChart.schema),
};
export default define(meta, async (ps) => {
return await federationChart.getChart(ps.span as any, ps.limit!);
return await federationChart.getChart(ps.span as any, ps.limit!, ps.offset!);
});

View File

@ -26,6 +26,11 @@ export const meta = {
}
},
offset: {
validator: $.optional.num,
default: 0,
},
tag: {
validator: $.str,
desc: {
@ -38,5 +43,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await hashtagChart.getChart(ps.span as any, ps.limit!, ps.tag);
return await hashtagChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.tag);
});

View File

@ -26,6 +26,11 @@ export const meta = {
}
},
offset: {
validator: $.optional.num,
default: 0,
},
host: {
validator: $.str,
desc: {
@ -39,5 +44,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await instanceChart.getChart(ps.span as any, ps.limit!, ps.host);
return await instanceChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.host);
});

View File

@ -25,11 +25,16 @@ export const meta = {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
validator: $.optional.num,
default: 0,
},
},
res: convertLog(networkChart.schema),
};
export default define(meta, async (ps) => {
return await networkChart.getChart(ps.span as any, ps.limit!);
return await networkChart.getChart(ps.span as any, ps.limit!, ps.offset!);
});

View File

@ -25,11 +25,16 @@ export const meta = {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
validator: $.optional.num,
default: 0,
},
},
res: convertLog(notesChart.schema),
};
export default define(meta, async (ps) => {
return await notesChart.getChart(ps.span as any, ps.limit!);
return await notesChart.getChart(ps.span as any, ps.limit!, ps.offset!);
});

View File

@ -27,6 +27,11 @@ export const meta = {
}
},
offset: {
validator: $.optional.num,
default: 0,
},
userId: {
validator: $.type(ID),
desc: {
@ -40,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserDriveChart.getChart(ps.span as any, ps.limit!, ps.userId);
return await perUserDriveChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
});

View File

@ -27,6 +27,11 @@ export const meta = {
}
},
offset: {
validator: $.optional.num,
default: 0,
},
userId: {
validator: $.type(ID),
desc: {
@ -40,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserFollowingChart.getChart(ps.span as any, ps.limit!, ps.userId);
return await perUserFollowingChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
});

View File

@ -27,6 +27,11 @@ export const meta = {
}
},
offset: {
validator: $.optional.num,
default: 0,
},
userId: {
validator: $.type(ID),
desc: {
@ -40,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserNotesChart.getChart(ps.span as any, ps.limit!, ps.userId);
return await perUserNotesChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
});

View File

@ -27,6 +27,11 @@ export const meta = {
}
},
offset: {
validator: $.optional.num,
default: 0,
},
userId: {
validator: $.type(ID),
desc: {
@ -40,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.userId);
return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
});

View File

@ -25,11 +25,16 @@ export const meta = {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
validator: $.optional.num,
default: 0,
},
},
res: convertLog(usersChart.schema),
};
export default define(meta, async (ps) => {
return await usersChart.getChart(ps.span as any, ps.limit!);
return await usersChart.getChart(ps.span as any, ps.limit!, ps.offset!);
});

View File

@ -60,9 +60,9 @@ export default define(meta, async () => {
Notes.count({ where: { userHost: null }, cache: 3600000 }),
Users.count({ cache: 3600000 }),
Users.count({ where: { host: null }, cache: 3600000 }),
federationChart.getChart('hour', 1).then(chart => chart.instance.total[0]),
driveChart.getChart('hour', 1).then(chart => chart.local.totalSize[0]),
driveChart.getChart('hour', 1).then(chart => chart.remote.totalSize[0]),
federationChart.getChart('hour', 1, 0).then(chart => chart.instance.total[0]),
driveChart.getChart('hour', 1, 0).then(chart => chart.local.totalSize[0]),
driveChart.getChart('hour', 1, 0).then(chart => chart.remote.totalSize[0]),
]);
return {