Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
18d20efc
Commit
18d20efc
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Fetch settings tabs and keep them in local storage
parent
66791289
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!195
Move Settings tab navigation to the main sidebar menu
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/router/index.js
+5
-9
5 additions, 9 deletions
src/router/index.js
src/store/getters.js
+2
-1
2 additions, 1 deletion
src/store/getters.js
src/views/layout/components/Sidebar/index.vue
+24
-1
24 additions, 1 deletion
src/views/layout/components/Sidebar/index.vue
with
31 additions
and
11 deletions
src/router/index.js
+
5
−
9
View file @
18d20efc
...
...
@@ -11,14 +11,9 @@ const settingsDisabled = disabledFeatures.includes('settings')
const
settings
=
{
path
:
'
/settings
'
,
component
:
Layout
,
children
:
[
{
path
:
'
index
'
,
component
:
()
=>
import
(
'
@/views/settings/index
'
),
name
:
'
Settings
'
,
meta
:
{
title
:
'
settings
'
,
icon
:
'
settings
'
,
noCache
:
true
}
}
]
name
:
'
Settings
'
,
hasSubmenu
:
true
,
meta
:
{
title
:
'
settings
'
,
icon
:
'
settings
'
,
noCache
:
true
}
}
const
statusesDisabled
=
disabledFeatures
.
includes
(
'
statuses
'
)
...
...
@@ -145,7 +140,8 @@ export const constantRouterMap = [
{
path
:
''
,
component
:
Layout
,
redirect
:
'
/users/index
'
redirect
:
'
/users/index
'
,
hidden
:
true
}
]
...
...
This diff is collapsed.
Click to expand it.
src/store/getters.js
+
2
−
1
View file @
18d20efc
...
...
@@ -17,6 +17,7 @@ const getters = {
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
users
:
state
=>
state
.
users
.
fetchedUsers
,
authHost
:
state
=>
state
.
user
.
authHost
,
settings
:
state
=>
state
.
settings
settings
:
state
=>
state
.
settings
,
tabs
:
state
=>
state
.
settings
.
tabs
}
export
default
getters
This diff is collapsed.
Click to expand it.
src/views/layout/components/Sidebar/index.vue
+
24
−
1
View file @
18d20efc
...
...
@@ -7,6 +7,7 @@
:text-color=
"variables.menuText"
:active-text-color=
"variables.menuActiveText"
mode=
"vertical"
@
open=
"handleOpen"
>
<sidebar-item
v-for=
"route in permission_routers"
:key=
"route.path"
:item=
"route"
:base-path=
"route.path"
/>
</el-menu>
...
...
@@ -17,13 +18,15 @@
import
{
mapGetters
}
from
'
vuex
'
import
SidebarItem
from
'
./SidebarItem
'
import
variables
from
'
@/styles/variables.scss
'
// import router from '@/router'
export
default
{
components
:
{
SidebarItem
},
computed
:
{
...
mapGetters
([
'
permission_routers
'
,
'
sidebar
'
'
sidebar
'
,
'
tabs
'
]),
variables
()
{
return
variables
...
...
@@ -34,6 +37,26 @@ export default {
},
mounted
()
{
this
.
$store
.
dispatch
(
'
FetchOpenReportsCount
'
)
},
methods
:
{
async
handleOpen
(
$event
)
{
if
(
$event
===
'
/settings
'
)
{
let
items
=
localStorage
.
getItem
(
'
settingsTabs
'
)
if
(
!
items
)
{
await
this
.
$store
.
dispatch
(
'
FetchSettings
'
)
items
=
this
.
tabs
localStorage
.
setItem
(
'
settingsTabs
'
,
JSON
.
stringify
(
items
))
}
JSON
.
parse
(
items
).
forEach
(
item
=>
{
// router.addRoute('Settings', [{
// path: item.value,
// component: {
// template: '
<
span
>
Ioio
<
/span>
'
// }
// }])
})
}
}
}
}
</
script
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment