This commit is contained in:
syuilo
2020-03-07 11:23:31 +09:00
parent 49a5b4eb14
commit 917726fecc
16 changed files with 96 additions and 105 deletions

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
},
@ -36,5 +36,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await activeUsersChart.getChart(ps.span as any, ps.limit!, ps.offset!);
return await activeUsersChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
},
@ -36,5 +36,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await driveChart.getChart(ps.span as any, ps.limit!, ps.offset!);
return await driveChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
},
@ -36,5 +36,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await federationChart.getChart(ps.span as any, ps.limit!, ps.offset!);
return await federationChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
tag: {
@ -43,5 +43,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await hashtagChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.tag);
return await hashtagChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.tag);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
host: {
@ -44,5 +44,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await instanceChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.host);
return await instanceChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.host);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
},
@ -36,5 +36,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await networkChart.getChart(ps.span as any, ps.limit!, ps.offset!);
return await networkChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
},
@ -36,5 +36,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await notesChart.getChart(ps.span as any, ps.limit!, ps.offset!);
return await notesChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

View File

@ -28,8 +28,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
userId: {
@ -45,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserDriveChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
return await perUserDriveChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View File

@ -28,8 +28,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
userId: {
@ -45,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserFollowingChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
return await perUserFollowingChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View File

@ -28,8 +28,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
userId: {
@ -45,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserNotesChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
return await perUserNotesChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View File

@ -28,8 +28,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
userId: {
@ -45,5 +45,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.offset!, ps.userId);
return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
});

View File

@ -27,8 +27,8 @@ export const meta = {
},
offset: {
validator: $.optional.num,
default: 0,
validator: $.optional.nullable.num,
default: null,
},
},
@ -36,5 +36,5 @@ export const meta = {
};
export default define(meta, async (ps) => {
return await usersChart.getChart(ps.span as any, ps.limit!, ps.offset!);
return await usersChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
});

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, 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]),
federationChart.getChart('hour', 1, null).then(chart => chart.instance.total[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.local.totalSize[0]),
driveChart.getChart('hour', 1, null).then(chart => chart.remote.totalSize[0]),
]);
return {