Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
Zéphir
WebUI
Commits
387a03f9
Commit
387a03f9
authored
Jun 06, 2019
by
Matthieu Lamalle
Browse files
restrict servermodel edit config to root
parent
0ea86711
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pages/ServerModelsPage/ServerModelDetail.js
View file @
387a03f9
...
...
@@ -31,11 +31,11 @@ class ServerModelDetail extends React.Component {
this
.
state
=
{
isLoading
:
false
,
};
this
.
onAppClick
=
this
.
onAppClick
.
bind
(
this
);
this
.
onAppClick
=
this
.
onAppClick
.
bind
(
this
);
}
render
(){
const
{
classes
,
inner
,
servermodel
}
=
this
.
props
;
const
{
classes
,
inner
,
servermodel
,
auth
}
=
this
.
props
;
const
{
isLoading
}
=
this
.
state
;
return
(
<
Page
...
...
@@ -61,13 +61,15 @@ class ServerModelDetail extends React.Component {
<
ListItem
divider
>
<
ListItemText
primary
=
"
Description
"
secondary
=
{
servermodel
.
model
.
servermodeldescription
}
/
>
<
/ListItem
>
<
ListItem
divider
button
onClick
=
{
this
.
onAppClick
}
>
<
ListItemText
primary
=
"
Configuration
"
secondary
=
"
Editer la configuration du modèle de serveur
"
/>
<
SettingsIcon
/>
<
/ListItem
>
{
auth
.
user
&&
auth
.
user
.
profil
===
"
root
"
&&
<
ListItem
divider
button
onClick
=
{
this
.
onAppClick
}
>
<
ListItemText
primary
=
"
Configuration
"
secondary
=
"
Editer la configuration du modèle de serveur
"
/>
<
SettingsIcon
/>
<
/ListItem
>
}
<
/List
>
<
/GridListTile
>
...
...
@@ -90,7 +92,7 @@ class ServerModelDetail extends React.Component {
);
}
onAppClick
(
app
)
{
onAppClick
()
{
const
{
servermodel
}
=
this
.
props
;
this
.
props
.
dispatch
(
appActions
.
openApp
(
'
ConfigEditor
'
,
{
servermodel
:
servermodel
.
model
}))
...
...
@@ -131,11 +133,12 @@ const styles = theme => ({
});
function
mapStateToProps
({
servermodels
},
{
match
})
{
function
mapStateToProps
({
servermodels
,
auth
},
{
match
})
{
const
servermodelId
=
parseInt
(
match
.
params
.
id
,
10
);
const
servermodel
=
selectServermodelById
(
servermodels
.
describeById
,
servermodelId
);
return
{
servermodel
,
auth
};
}
...
...
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