Поправил манифест
This commit is contained in:
parent
5256756411
commit
955fed547c
3 changed files with 20 additions and 16 deletions
|
@ -35,20 +35,6 @@ const AppLayout = () => {
|
|||
label: 'Квесты',
|
||||
link: '/quests'
|
||||
},
|
||||
hasRole('creator')
|
||||
? {
|
||||
key: 'quest/new',
|
||||
label: 'Создать квест',
|
||||
link: '/quest/new'
|
||||
}
|
||||
: null,
|
||||
hasRole('admin')
|
||||
? {
|
||||
key: 'admin',
|
||||
label: 'Админка',
|
||||
link: '/admin'
|
||||
}
|
||||
: null,
|
||||
{
|
||||
key: 'me',
|
||||
label: `${user.username} [${user.level}]`,
|
||||
|
@ -60,6 +46,22 @@ const AppLayout = () => {
|
|||
onClick: logout
|
||||
}
|
||||
]
|
||||
|
||||
if (hasRole('creator')) {
|
||||
items.push({
|
||||
key: 'quest/new',
|
||||
label: 'Создать квест',
|
||||
link: '/quest/new'
|
||||
})
|
||||
}
|
||||
|
||||
if (hasRole('admin')) {
|
||||
items.push({
|
||||
key: 'admin',
|
||||
label: 'Админка',
|
||||
link: '/admin'
|
||||
})
|
||||
}
|
||||
}
|
||||
const menuHandler = (x) => {
|
||||
const item = items.find(y => y.key === x.key)
|
||||
|
|
|
@ -53,9 +53,9 @@ const manifest = {
|
|||
],
|
||||
theme_color: '#fb923c',
|
||||
background_color: '#171e26',
|
||||
display: 'standalone',
|
||||
display: 'minimal-ui',
|
||||
scope: '/',
|
||||
start_url: '/quests'
|
||||
start_url: '/'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
main.go
2
main.go
|
@ -99,8 +99,10 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return echo.ErrForbidden
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue