feat: Split System Info and System Settings pages

This commit is contained in:
NGPixel 2017-06-24 16:26:33 -04:00 committed by Nicolas Giard
parent 919afb46e2
commit f37cbac332
6 changed files with 61 additions and 40 deletions

View File

@ -230,6 +230,13 @@ router.get('/settings', (req, res) => {
if (!res.locals.rights.manage) {
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 => {
axios.get('https://api.github.com/repos/Requarks/wiki/releases/latest').then(resp => {
@ -239,15 +246,15 @@ router.get('/settings', (req, res) => {
latestPublishedAt: resp.data.published_at
}
res.render('pages/admin/settings', { adminTab: 'settings', sysversion })
res.render('pages/admin/system', { adminTab: 'system', sysversion })
}).catch(err => {
winston.warn(err)
res.render('pages/admin/settings', { adminTab: 'settings', sysversion: { current: 'v' + packageObj.version } })
res.render('pages/admin/system', { adminTab: 'system', sysversion: { current: 'v' + packageObj.version } })
})
})
})
router.post('/settings/install', (req, res) => {
router.post('/system/install', (req, res) => {
if (!res.locals.rights.manage) {
return res.render('error-forbidden')
}

View File

@ -39,6 +39,9 @@
"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 on Wiki.js and troubleshooting tools"
},
"users": {
"createauthorize": "Create / Authorize User",
"subtitle": "Manage users and access rights",

View File

@ -33,6 +33,7 @@
"settings": "Settings",
"source": "Source",
"stats": "Stats",
"sysinfo": "System Info",
"syssettings": "System Settings",
"theme": "Color Theme",
"users": "Users",

View File

@ -33,7 +33,7 @@ block content
ul.sidebar-menu
li
a(href='/admin/profile')
i.nc-icon-outline.users_circle-10
i.nc-icon-outline.business_business-contact-86
span= t('nav.myprofile')
li
a(href='/admin/stats')
@ -45,13 +45,17 @@ block content
i.nc-icon-outline.users_multiple-19
span= t('nav.users')
li
a(href='/admin/settings')
i.nc-icon-outline.ui-1_settings-gear-63
span= t('nav.syssettings')
//-li
a(href='/admin/theme')
i.icon-drop
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
a(href='/logout')
i.nc-icon-outline.arrows-1_log-out

View File

@ -4,34 +4,3 @@ block adminContent
.hero
h1.title#title= t('nav.syssettings')
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

View File

@ -0,0 +1,37 @@
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