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
f37cbac3
You need to sign in or sign up before continuing.
Commit
f37cbac3
authored
Jun 24, 2017
by
NGPixel
Committed by
Nicolas Giard
Jul 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Split System Info and System Settings pages
parent
919afb46
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
41 deletions
+61
-41
admin.js
server/controllers/admin.js
+10
-3
admin.json
server/locales/en/admin.json
+3
-0
common.json
server/locales/en/common.json
+2
-2
_layout.pug
server/views/pages/admin/_layout.pug
+9
-5
settings.pug
server/views/pages/admin/settings.pug
+0
-31
system.pug
server/views/pages/admin/system.pug
+37
-0
No files found.
server/controllers/admin.js
View file @
f37cbac3
...
@@ -230,6 +230,13 @@ router.get('/settings', (req, res) => {
...
@@ -230,6 +230,13 @@ router.get('/settings', (req, res) => {
if
(
!
res
.
locals
.
rights
.
manage
)
{
if
(
!
res
.
locals
.
rights
.
manage
)
{
return
res
.
render
(
'error-forbidden'
)
return
res
.
render
(
'error-forbidden'
)
}
}
res
.
render
(
'pages/admin/settings'
,
{
adminTab
:
'settings'
})
})
router
.
get
(
'/system'
,
(
req
,
res
)
=>
{
if
(
!
res
.
locals
.
rights
.
manage
)
{
return
res
.
render
(
'error-forbidden'
)
}
fs
.
readJsonAsync
(
path
.
join
(
ROOTPATH
,
'package.json'
)).
then
(
packageObj
=>
{
fs
.
readJsonAsync
(
path
.
join
(
ROOTPATH
,
'package.json'
)).
then
(
packageObj
=>
{
axios
.
get
(
'https://api.github.com/repos/Requarks/wiki/releases/latest'
).
then
(
resp
=>
{
axios
.
get
(
'https://api.github.com/repos/Requarks/wiki/releases/latest'
).
then
(
resp
=>
{
...
@@ -239,15 +246,15 @@ router.get('/settings', (req, res) => {
...
@@ -239,15 +246,15 @@ router.get('/settings', (req, res) => {
latestPublishedAt
:
resp
.
data
.
published_at
latestPublishedAt
:
resp
.
data
.
published_at
}
}
res
.
render
(
'pages/admin/s
ettings'
,
{
adminTab
:
'settings
'
,
sysversion
})
res
.
render
(
'pages/admin/s
ystem'
,
{
adminTab
:
'system
'
,
sysversion
})
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
winston
.
warn
(
err
)
winston
.
warn
(
err
)
res
.
render
(
'pages/admin/s
ettings'
,
{
adminTab
:
'settings
'
,
sysversion
:
{
current
:
'v'
+
packageObj
.
version
}
})
res
.
render
(
'pages/admin/s
ystem'
,
{
adminTab
:
'system
'
,
sysversion
:
{
current
:
'v'
+
packageObj
.
version
}
})
})
})
})
})
})
})
router
.
post
(
'/s
ettings
/install'
,
(
req
,
res
)
=>
{
router
.
post
(
'/s
ystem
/install'
,
(
req
,
res
)
=>
{
if
(
!
res
.
locals
.
rights
.
manage
)
{
if
(
!
res
.
locals
.
rights
.
manage
)
{
return
res
.
render
(
'error-forbidden'
)
return
res
.
render
(
'error-forbidden'
)
}
}
...
...
server/locales/en/admin.json
View file @
f37cbac3
...
@@ -39,6 +39,9 @@
...
@@ -39,6 +39,9 @@
"flushsessionstext"
:
"All users will be logged out and forced to login again. Your current session will also be affected!"
,
"flushsessionstext"
:
"All users will be logged out and forced to login again. Your current session will also be affected!"
,
"flushsessionsbtn"
:
"Flush Sessions"
"flushsessionsbtn"
:
"Flush Sessions"
},
},
"system"
:
{
"subtitle"
:
"Information on Wiki.js and troubleshooting tools"
},
"users"
:
{
"users"
:
{
"createauthorize"
:
"Create / Authorize User"
,
"createauthorize"
:
"Create / Authorize User"
,
"subtitle"
:
"Manage users and access rights"
,
"subtitle"
:
"Manage users and access rights"
,
...
...
server/locales/en/common.json
View file @
f37cbac3
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
"settings"
:
"Settings"
,
"settings"
:
"Settings"
,
"source"
:
"Source"
,
"source"
:
"Source"
,
"stats"
:
"Stats"
,
"stats"
:
"Stats"
,
"sysinfo"
:
"System Info"
,
"syssettings"
:
"System Settings"
,
"syssettings"
:
"System Settings"
,
"theme"
:
"Color Theme"
,
"theme"
:
"Color Theme"
,
"users"
:
"Users"
,
"users"
:
"Users"
,
...
@@ -47,4 +48,4 @@
...
@@ -47,4 +48,4 @@
"source"
:
"Loading source..."
,
"source"
:
"Loading source..."
,
"editor"
:
"Loading editor..."
"editor"
:
"Loading editor..."
}
}
}
}
\ No newline at end of file
server/views/pages/admin/_layout.pug
View file @
f37cbac3
...
@@ -33,7 +33,7 @@ block content
...
@@ -33,7 +33,7 @@ block content
ul.sidebar-menu
ul.sidebar-menu
li
li
a(href='/admin/profile')
a(href='/admin/profile')
i.nc-icon-outline.
users_circle-10
i.nc-icon-outline.
business_business-contact-86
span= t('nav.myprofile')
span= t('nav.myprofile')
li
li
a(href='/admin/stats')
a(href='/admin/stats')
...
@@ -45,13 +45,17 @@ block content
...
@@ -45,13 +45,17 @@ block content
i.nc-icon-outline.users_multiple-19
i.nc-icon-outline.users_multiple-19
span= t('nav.users')
span= t('nav.users')
li
li
a(href='/admin/settings')
i.nc-icon-outline.ui-1_settings-gear-63
span= t('nav.syssettings')
//-li
a(href='/admin/theme')
a(href='/admin/theme')
i.icon-drop
i.icon-drop
span= t('nav.theme')
span= t('nav.theme')
li
a(href='/admin/settings')
i.nc-icon-outline.ui-1_settings-gear-63
span= t('nav.syssettings')
li
a(href='/admin/system')
i.nc-icon-outline.objects_planet
span= t('nav.sysinfo')
li
li
a(href='/logout')
a(href='/logout')
i.nc-icon-outline.arrows-1_log-out
i.nc-icon-outline.arrows-1_log-out
...
...
server/views/pages/admin/settings.pug
View file @
f37cbac3
...
@@ -4,34 +4,3 @@ block adminContent
...
@@ -4,34 +4,3 @@ block adminContent
.hero
.hero
h1.title#title= t('nav.syssettings')
h1.title#title= t('nav.syssettings')
h2.subtitle= t('admin:settings.subtitle')
h2.subtitle= t('admin:settings.subtitle')
admin-settings(inline-template)
.form-sections
section
img(src='/images/logo.png', style={width:'200px', float:'right'})
label.label= t('admin:settings.systemversion')
.section-block
p #{t('admin:settings.currentversion')}: #[strong= sysversion.current]
if sysversion.latest
p #{t('admin:settings.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:settings.upgrade')
else
button.button.is-disabled= t('admin:settings.upgrade')
button.button.is-deep-orange.is-outlined(@click='$store.dispatch("modalUpgradeSystem/open", { mode: "reinstall"})')= t('admin:settings.reinstall')
else
p: em= t('admin:settings.versioncheckfailed')
section
label.label= t('admin:settings.administrativetools')
.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')
modal-upgrade-system
server/views/pages/admin/system.pug
0 → 100644
View file @
f37cbac3
extends ./_layout.pug
block adminContent
.hero
h1.title#title= t('nav.sysinfo')
h2.subtitle= t('admin:system.subtitle')
admin-settings(inline-template)
.form-sections
section
img(src='/images/logo.png', style={width:'200px', float:'right'})
label.label= t('admin:settings.systemversion')
.section-block
p #{t('admin:settings.currentversion')}: #[strong= sysversion.current]
if sysversion.latest
p #{t('admin:settings.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:settings.upgrade')
else
button.button.is-disabled= t('admin:settings.upgrade')
button.button.is-deep-orange.is-outlined(@click='$store.dispatch("modalUpgradeSystem/open", { mode: "reinstall"})')= t('admin:settings.reinstall')
else
p: em= t('admin:settings.versioncheckfailed')
section
label.label= t('admin:settings.administrativetools')
.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')
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