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
3752e95b
Commit
3752e95b
authored
Jul 02, 2017
by
NGPixel
Committed by
Nicolas Giard
Jul 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Host Information on System Info page
parent
fc42fd21
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
25 deletions
+52
-25
modal-upgrade-system.vue
client/js/components/modal-upgrade-system.vue
+1
-1
admin.js
server/controllers/admin.js
+13
-2
admin.json
server/locales/en/admin.json
+12
-5
system.pug
server/views/pages/admin/system.pug
+26
-17
No files found.
client/js/components/modal-upgrade-system.vue
View file @
3752e95b
...
...
@@ -56,7 +56,7 @@ export default {
},
upgradeStart
()
{
this
.
$store
.
commit
(
'modalUpgradeSystem/stepChange'
,
'running'
)
this
.
$http
.
post
(
'/admin/s
ettings
/install'
,
{
this
.
$http
.
post
(
'/admin/s
ystem
/install'
,
{
mode
:
this
.
mode
}).
then
(
resp
=>
{
// todo
...
...
server/controllers/admin.js
View file @
3752e95b
...
...
@@ -10,6 +10,8 @@ const _ = require('lodash')
const
axios
=
require
(
'axios'
)
const
path
=
require
(
'path'
)
const
fs
=
Promise
.
promisifyAll
(
require
(
'fs-extra'
))
const
os
=
require
(
'os'
)
const
filesize
=
require
(
'filesize.js'
)
/**
* Admin
...
...
@@ -238,6 +240,15 @@ router.get('/system', (req, res) => {
return
res
.
render
(
'error-forbidden'
)
}
let
hostInfo
=
{
cpus
:
os
.
cpus
(),
hostname
:
os
.
hostname
(),
nodeversion
:
process
.
version
,
os
:
`
${
os
.
type
()}
(
${
os
.
platform
()}
)
${
os
.
release
()}
${
os
.
arch
()}
`
,
totalmem
:
filesize
(
os
.
totalmem
()),
cwd
:
process
.
cwd
()
}
fs
.
readJsonAsync
(
path
.
join
(
ROOTPATH
,
'package.json'
)).
then
(
packageObj
=>
{
axios
.
get
(
'https://api.github.com/repos/Requarks/wiki/releases/latest'
).
then
(
resp
=>
{
let
sysversion
=
{
...
...
@@ -246,10 +257,10 @@ router.get('/system', (req, res) => {
latestPublishedAt
:
resp
.
data
.
published_at
}
res
.
render
(
'pages/admin/system'
,
{
adminTab
:
'system'
,
sysversion
})
res
.
render
(
'pages/admin/system'
,
{
adminTab
:
'system'
,
hostInfo
,
sysversion
})
}).
catch
(
err
=>
{
winston
.
warn
(
err
)
res
.
render
(
'pages/admin/system'
,
{
adminTab
:
'system'
,
sysversion
:
{
current
:
'v'
+
packageObj
.
version
}
})
res
.
render
(
'pages/admin/system'
,
{
adminTab
:
'system'
,
hostInfo
,
sysversion
:
{
current
:
'v'
+
packageObj
.
version
}
})
})
})
})
...
...
server/locales/en/admin.json
View file @
3752e95b
...
...
@@ -23,7 +23,10 @@
"users"
:
"Users"
},
"settings"
:
{
"subtitle"
:
"Manage site configuration"
,
"subtitle"
:
"Manage site configuration"
},
"system"
:
{
"subtitle"
:
"Information and utilities for your wiki"
,
"systemversion"
:
"System Version"
,
"currentversion"
:
"Current Version"
,
"latestversion"
:
"Latest Version"
,
...
...
@@ -39,10 +42,14 @@
"resetaccountsbtn"
:
"Reset System Accounts"
,
"flushsessions"
:
"Flush all active user sessions"
,
"flushsessionstext"
:
"All users will be logged out and forced to login again. Your current session will also be affected!"
,
"flushsessionsbtn"
:
"Flush Sessions"
},
"system"
:
{
"subtitle"
:
"Information and utilities for your wiki"
"flushsessionsbtn"
:
"Flush Sessions"
,
"hostinfo"
:
"Host Information"
,
"os"
:
"Operating System"
,
"nodeversion"
:
"Node.js Version"
,
"hostname"
:
"Hostname"
,
"cores"
:
"CPU Cores"
,
"totalmem"
:
"Total Memory"
,
"cwd"
:
"Working Directory"
},
"theme"
:
{
"subtitle"
:
"Change the look and feel of your wiki"
,
...
...
server/views/pages/admin/system.pug
View file @
3752e95b
...
...
@@ -9,30 +9,39 @@ block adminContent
.form-sections
section
img(src='/images/logo.png', style={width:'200px', float:'right'})
label.label= t('admin:s
ettings
.systemversion')
label.label= t('admin:s
ystem
.systemversion')
.section-block
p #{t('admin:s
ettings
.currentversion')}: #[strong= sysversion.current]
p #{t('admin:s
ystem
.currentversion')}: #[strong= sysversion.current]
if sysversion.latest
p #{t('admin:s
ettings
.latestversion')}: #[strong= sysversion.latest] #[em (Published #{moment(sysversion.latestPublishedAt).fromNow()})]
p #{t('admin:s
ystem
.latestversion')}: #[strong= sysversion.latest] #[em (Published #{moment(sysversion.latestPublishedAt).fromNow()})]
p
if sysversion.current !== sysversion.latest
button.button.is-deep-orange(@click='$store.dispatch("modalUpgradeSystem/open", { mode: "upgrade"})')= t('admin:s
ettings
.upgrade')
button.button.is-deep-orange(@click='$store.dispatch("modalUpgradeSystem/open", { mode: "upgrade"})')= t('admin:s
ystem
.upgrade')
else
button.button.is-disabled= t('admin:s
ettings
.upgrade')
button.button.is-deep-orange.is-outlined(@click='$store.dispatch("modalUpgradeSystem/open", { mode: "reinstall"})')= t('admin:s
ettings
.reinstall')
button.button.is-disabled= t('admin:s
ystem
.upgrade')
button.button.is-deep-orange.is-outlined(@click='$store.dispatch("modalUpgradeSystem/open", { mode: "reinstall"})')= t('admin:s
ystem
.reinstall')
else
p: em= t('admin:s
ettings
.versioncheckfailed')
p: em= t('admin:s
ystem
.versioncheckfailed')
section
label.label= t('admin:s
ettings.administrativetools
')
label.label= t('admin:s
ystem.hostinfo
')
.section-block
h6 #{t('admin:settings.flushcache')}:
p.is-small= t('admin:settings.flushcachetext')
p: button.button.is-teal.is-outlined(v-on:click='flushcache')= t('admin:settings.flushcachebtn')
h6 #{t('admin:settings.resetaccounts')}:
p.is-small= t('admin:settings.resetaccountstext')
p: button.button.is-teal.is-outlined(v-on:click='resetaccounts')= t('admin:settings.resetaccountsbtn')
h6 #{t('admin:settings.flushsessions')}:
p.is-small= t('admin:settings.flushsessionstext')
p: button.button.is-teal.is-outlined(v-on:click='flushsessions')= t('admin:settings.flushsessionsbtn')
p #{t('admin:system.os')}: #[strong= hostInfo.os]
p #{t('admin:system.nodeversion')}: #[strong= hostInfo.nodeversion]
p #{t('admin:system.hostname')}: #[strong= hostInfo.hostname]
p #{t('admin:system.cores')}: #[strong= hostInfo.cpus.length]
p #{t('admin:system.totalmem')}: #[strong= hostInfo.totalmem]
p #{t('admin:system.cwd')}: #[strong= hostInfo.cwd]
section
label.label= t('admin:system.administrativetools')
.section-block
h6 #{t('admin:system.flushcache')}:
p.is-small= t('admin:system.flushcachetext')
p: button.button.is-teal.is-outlined(v-on:click='flushcache')= t('admin:system.flushcachebtn')
h6 #{t('admin:system.resetaccounts')}:
p.is-small= t('admin:system.resetaccountstext')
p: button.button.is-teal.is-outlined(v-on:click='resetaccounts')= t('admin:system.resetaccountsbtn')
h6 #{t('admin:system.flushsessions')}:
p.is-small= t('admin:system.flushsessionstext')
p: button.button.is-teal.is-outlined(v-on:click='flushsessions')= t('admin:system.flushsessionsbtn')
modal-upgrade-system
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