mirror of https://github.com/Requarks/wiki.git
5 changed files with 109 additions and 16 deletions
Split View
Diff Options
-
53client/components/admin-system.vue
-
25client/constants/graphql.js
-
36server/graph/resolvers/system.js
-
6server/graph/schemas/system.graphql
-
5server/views/master.pug
@ -0,0 +1,36 @@ |
|||
const _ = require('lodash') |
|||
const os = require('os') |
|||
const filesize = require('filesize') |
|||
|
|||
/* global WIKI */ |
|||
|
|||
module.exports = { |
|||
Query: { |
|||
async system() { return {} } |
|||
}, |
|||
Mutation: { |
|||
async system() { return {} } |
|||
}, |
|||
SystemQuery: { |
|||
async info(obj, args, context, info) { |
|||
return { |
|||
currentVersion: WIKI.version, |
|||
latestVersion: WIKI.version, // TODO
|
|||
latestVersionReleaseDate: new Date(), // TODO
|
|||
operatingSystem: `${os.type()} (${os.platform()}) ${os.release()} ${os.arch()}`, |
|||
hostname: os.hostname(), |
|||
cpuCores: os.cpus().length, |
|||
ramTotal: filesize(os.totalmem()), |
|||
workingDirectory: process.cwd(), |
|||
nodeVersion: process.version.substr(1), |
|||
redisVersion: WIKI.redis.serverInfo.redis_version, |
|||
redisUsedRAM: WIKI.redis.serverInfo.used_memory_human, |
|||
redisTotalRAM: _.get(WIKI.redis.serverInfo, 'total_system_memory_human', 'N/A'), |
|||
redisHost: WIKI.redis.options.host, |
|||
postgreVersion: WIKI.db.inst.options.databaseVersion, |
|||
postgreHost: WIKI.db.inst.options.host |
|||
} |
|||
} |
|||
}, |
|||
SystemMutation: { } |
|||
} |
Write
Preview
Loading…
Cancel
Save