Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
8462e18f
Commit
8462e18f
authored
Mar 18, 2018
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: admin - system info
parent
392cbe93
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
16 deletions
+109
-16
admin-system.vue
client/components/admin-system.vue
+41
-12
graphql.js
client/constants/graphql.js
+25
-0
system.js
server/graph/resolvers/system.js
+36
-0
system.graphql
server/graph/schemas/system.graphql
+5
-1
master.pug
server/views/master.pug
+2
-3
No files found.
client/components/admin-system.vue
View file @
8462e18f
...
...
@@ -7,7 +7,7 @@
v-layout.mt-3(row wrap)
v-flex(lg6 xs12)
v-card
v-btn(fab, absolute, right, top, small, light): v-icon refresh
v-btn(fab, absolute, right, top, small, light
, @click='refresh'
): v-icon refresh
v-list(two-line, dense)
v-subheader Wiki.js
v-list-tile(avatar)
...
...
@@ -15,13 +15,13 @@
v-icon.blue.white--text system_update_alt
v-list-tile-content
v-list-tile-title Current Version
v-list-tile-sub-title
2.0.0
v-list-tile-sub-title
{{
info
.
currentVersion
}}
v-list-tile(avatar)
v-list-tile-avatar
v-icon.blue.white--text open_in_browser
v-list-tile-content
v-list-tile-title Latest Version
v-list-tile-sub-title
2.0.0
v-list-tile-sub-title
{{
info
.
latestVersion
}}
v-list-tile-action
v-list-tile-action-text Published 4 days ago
...
...
@@ -33,31 +33,31 @@
v-icon.blue-grey.white--text bubble_chart
v-list-tile-content
v-list-tile-title Operating System
v-list-tile-sub-title
Linux (linux) 4.4.0-116-generic x64
v-list-tile-sub-title
{{
info
.
operatingSystem
}}
v-list-tile(avatar)
v-list-tile-avatar
v-icon.blue-grey.white--text computer
v-list-tile-content
v-list-tile-title Hostname
v-list-tile-sub-title
wikijs
v-list-tile-sub-title
{{
info
.
hostname
}}
v-list-tile(avatar)
v-list-tile-avatar
v-icon.blue-grey.white--text nfc
v-list-tile-content
v-list-tile-title CPU Cores
v-list-tile-sub-title
8
v-list-tile-sub-title
{{
info
.
cpuCores
}}
v-list-tile(avatar)
v-list-tile-avatar
v-icon.blue-grey.white--text memory
v-list-tile-content
v-list-tile-title Total RAM
v-list-tile-sub-title
16.0 Gb
v-list-tile-sub-title
{{
info
.
ramTotal
}}
v-list-tile(avatar)
v-list-tile-avatar
v-icon.blue-grey.white--text last_page
v-list-tile-content
v-list-tile-title Working Directory
v-list-tile-sub-title
/var/wiki
v-list-tile-sub-title
{{
info
.
workingDirectory
}}
v-flex(lg6 xs12)
v-card.pb-3
...
...
@@ -68,7 +68,7 @@
v-avatar.light-green(size='40')
icon-node-js(fillColor='#FFFFFF')
v-list-tile-content
v-list-tile-title
8.9.4
v-list-tile-title
{{
info
.
nodeVersion
}}
v-divider
...
...
@@ -78,7 +78,10 @@
v-avatar.red(size='40')
icon-cube(fillColor='#FFFFFF')
v-list-tile-content
v-list-tile-title 4.0.8
v-list-tile-title
{{
info
.
redisVersion
}}
v-list-tile-sub-title
{{
info
.
redisHost
}}
v-list-tile-action
v-list-tile-action-text RAM Usage:
{{
info
.
redisUsedRAM
}}
/
{{
info
.
redisTotalRAM
}}
v-divider
...
...
@@ -88,7 +91,16 @@
v-avatar.indigo.darken-1(size='40')
icon-database(fillColor='#FFFFFF')
v-list-tile-content
v-list-tile-title 9.6.8
v-list-tile-title
{{
info
.
postgreVersion
}}
v-list-tile-sub-title
{{
info
.
postgreHost
}}
v-snackbar(
color='success'
top
v-model='refreshCompleted'
)
v-icon.mr-3(dark) cached
| System Info has been refreshed.
</
template
>
...
...
@@ -97,6 +109,8 @@ import IconCube from 'mdi/cube'
import
IconDatabase
from
'mdi/database'
import
IconNodeJs
from
'mdi/nodejs'
/* global CONSTANTS */
export
default
{
components
:
{
IconCube
,
...
...
@@ -104,7 +118,22 @@ export default {
IconNodeJs
},
data
()
{
return
{}
return
{
info
:
{},
refreshCompleted
:
false
}
},
apollo
:
{
info
:
{
query
:
CONSTANTS
.
GRAPH
.
SYSTEM
.
QUERY_INFO
,
update
:
(
data
)
=>
data
.
system
.
info
}
},
methods
:
{
async
refresh
()
{
await
this
.
$apollo
.
queries
.
info
.
refetch
()
this
.
refreshCompleted
=
true
}
}
}
</
script
>
...
...
client/constants/graphql.js
View file @
8462e18f
...
...
@@ -65,6 +65,31 @@ export default {
}
`
},
SYSTEM
:
{
QUERY_INFO
:
gql
`
query {
system {
info {
currentVersion
latestVersion
latestVersionReleaseDate
operatingSystem
hostname
cpuCores
ramTotal
workingDirectory
nodeVersion
redisVersion
redisUsedRAM
redisTotalRAM
redisHost
postgreVersion
postgreHost
}
}
}
`
},
TRANSLATIONS
:
{
QUERY_NAMESPACE
:
gql
`
query($locale: String!, $namespace: String!) {
...
...
server/graph/resolvers/system.js
0 → 100644
View file @
8462e18f
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
:
{
}
}
server/graph/schemas/system.graphql
View file @
8462e18f
...
...
@@ -37,9 +37,13 @@ type SystemInfo {
operatingSystem
:
String
hostname
:
String
cpuCores
:
Int
ramTotal
:
Int
ramTotal
:
String
workingDirectory
:
String
nodeVersion
:
String
redisVersion
:
String
redisUsedRAM
:
String
redisTotalRAM
:
String
redisHost
:
String
postgreVersion
:
String
postgreHost
:
String
}
server/views/master.pug
View file @
8462e18f
...
...
@@ -27,8 +27,7 @@ html
block head
link(href="/css/client.css?c473342a20546c545ebc" rel="stylesheet")
script(type="text/javascript" src="/js/runtime.js?c473342a20546c545ebc")
script(type="text/javascript" src="/js/client.js?c473342a20546c545ebc" async)
script(type="text/javascript" src="/js/runtime.js")
script(type="text/javascript" src="/js/client.js")
body
block body
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment