From 2c1932faa72ef6f2c30df62e5b3248f2c0b77948 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 20 Jun 2019 22:52:35 +0900 Subject: [PATCH] Add psql version to info page --- src/server/web/index.ts | 2 ++ src/server/web/views/info.pug | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/server/web/index.ts b/src/server/web/index.ts index c5a3497f44..ba8f0649cf 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -20,6 +20,7 @@ import { Users, Notes, Emojis, UserProfiles, Pages } from '../../models'; import parseAcct from '../../misc/acct/parse'; import getNoteSummary from '../../misc/get-note-summary'; import { ensure } from '../../prelude/ensure'; +import { getConnection } from 'typeorm'; const client = `${__dirname}/../../client/`; @@ -250,6 +251,7 @@ router.get('/info', async ctx => { machine: os.hostname(), os: os.platform(), node: process.version, + psql: await getConnection().query('SHOW server_version').then(x => x[0].server_version), cpu: { model: os.cpus()[0].model, cores: os.cpus().length diff --git a/src/server/web/views/info.pug b/src/server/web/views/info.pug index c8b0bd939a..f18dcd45e3 100644 --- a/src/server/web/views/info.pug +++ b/src/server/web/views/info.pug @@ -85,6 +85,9 @@ html tr th Node version td= node + tr + th PSQL version + td= psql tr th Machine td= machine