af3258dc79
の一部を取り込む (#94)
This commit is contained in:
parent
59b1064fad
commit
680f367924
BIN
packages/backend/assets/avatar.png
Normal file
BIN
packages/backend/assets/avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -14,7 +14,7 @@ const round = (num: number) => Math.round(num * 10) / 10;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ServerStatsService implements OnApplicationShutdown {
|
export class ServerStatsService implements OnApplicationShutdown {
|
||||||
private intervalId: NodeJS.Timer;
|
private intervalId: NodeJS.Timer | null = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
) {
|
) {
|
||||||
|
@ -64,7 +64,9 @@ export class ServerStatsService implements OnApplicationShutdown {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
clearInterval(this.intervalId);
|
if (this.intervalId) {
|
||||||
|
clearInterval(this.intervalId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -168,11 +168,14 @@ export class ServerService implements OnApplicationShutdown {
|
||||||
});
|
});
|
||||||
|
|
||||||
fastify.get<{ Params: { x: string } }>('/identicon/:x', async (request, reply) => {
|
fastify.get<{ Params: { x: string } }>('/identicon/:x', async (request, reply) => {
|
||||||
|
/*
|
||||||
const [temp, cleanup] = await createTemp();
|
const [temp, cleanup] = await createTemp();
|
||||||
await genIdenticon(request.params.x, fs.createWriteStream(temp));
|
await genIdenticon(request.params.x, fs.createWriteStream(temp));
|
||||||
reply.header('Content-Type', 'image/png');
|
reply.header('Content-Type', 'image/png');
|
||||||
reply.header('Cache-Control', 'public, max-age=86400');
|
reply.header('Cache-Control', 'public, max-age=86400');
|
||||||
return fs.createReadStream(temp).on('close', () => cleanup());
|
return fs.createReadStream(temp).on('close', () => cleanup());
|
||||||
|
*/
|
||||||
|
return reply.redirect('/static-assets/avatar.png');
|
||||||
});
|
});
|
||||||
|
|
||||||
fastify.get<{ Params: { code: string } }>('/verify-email/:code', async (request, reply) => {
|
fastify.get<{ Params: { code: string } }>('/verify-email/:code', async (request, reply) => {
|
||||||
|
|
|
@ -5,6 +5,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
requireCredential: false,
|
requireCredential: false,
|
||||||
|
allowGet: true,
|
||||||
|
cacheSec: 60 * 1,
|
||||||
|
|
||||||
tags: ['meta'],
|
tags: ['meta'],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
@ -62,7 +62,7 @@ const { widgetProps, configure, save } = useWidgetPropsManager(name,
|
||||||
|
|
||||||
const meta = ref(null);
|
const meta = ref(null);
|
||||||
|
|
||||||
os.api('server-info', {}).then(res => {
|
os.apiGet('server-info', {}).then(res => {
|
||||||
meta.value = res;
|
meta.value = res;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue