mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-28 13:02:35 +02:00
Fixes
This commit is contained in:
parent
3d3f283d20
commit
ea9670225e
18
src/graphql/graphqlModules/Mcu/McuAppVersion.js
Normal file
18
src/graphql/graphqlModules/Mcu/McuAppVersion.js
Normal file
@ -0,0 +1,18 @@
|
||||
module.exports.typeDefs = `
|
||||
type McuActions {
|
||||
version: McuAppVersionOutput!
|
||||
}
|
||||
|
||||
type McuAppVersionOutput {
|
||||
result: String
|
||||
error: Error
|
||||
}
|
||||
`
|
||||
|
||||
module.exports.resolvers = {
|
||||
McuActions: {
|
||||
version (root, args, { dispatch }) {
|
||||
return dispatch('api/mcu/version')
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,6 @@ module.exports.typeDefs = `
|
||||
}
|
||||
|
||||
type McuStats {
|
||||
currentAppVersion: String,
|
||||
timestamp: String!
|
||||
hostname: String,
|
||||
operatingSystem: String
|
||||
|
13
src/store/api/mcu/mcuAppVersion.js
Normal file
13
src/store/api/mcu/mcuAppVersion.js
Normal file
@ -0,0 +1,13 @@
|
||||
const { join } = require('path')
|
||||
const { exec } = require('child_process')
|
||||
const axios = require('axios')
|
||||
|
||||
module.exports = ({ define }) => {
|
||||
define('version', async (payload, { knex, errors, utils }) => {
|
||||
const gitAppVersion = await axios.get('https://raw.githubusercontent.com/jstefanop/apolloui/production-BTC/package.json');
|
||||
const currentAppVersion = (gitAppVersion && gitAppVersion.data) ? gitAppVersion.data.version : null;
|
||||
return currentAppVersion
|
||||
}, {
|
||||
auth: true
|
||||
})
|
||||
}
|
@ -5,8 +5,6 @@ const axios = require('axios')
|
||||
module.exports = ({ define }) => {
|
||||
define('stats', async (payload, { knex, errors, utils }) => {
|
||||
const stats = await getOsStats()
|
||||
const gitAppVersion = await axios.get('https://raw.githubusercontent.com/jstefanop/apolloui/production-BTC/package.json');
|
||||
stats.currentAppVersion = (gitAppVersion && gitAppVersion.data) ? gitAppVersion.data.version : null;
|
||||
stats.timestamp = new Date().toISOString()
|
||||
return { stats }
|
||||
}, {
|
||||
|
Loading…
Reference in New Issue
Block a user