Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
370913c4
Commit
370913c4
authored
Oct 16, 2019
by
Markus Scheidgen
Browse files
Merge branch 'v0.6.0' into 'master'
v0.6.0 release See merge request
!61
parents
89851a37
e02770c5
Pipeline
#61986
passed with stage
in 22 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
gui/src/components/App.js
View file @
370913c4
...
...
@@ -6,7 +6,7 @@ import { compose } from 'recompose'
import
classNames
from
'
classnames
'
import
{
MuiThemeProvider
,
withStyles
}
from
'
@material-ui/core/styles
'
import
{
IconButton
,
LinearProgress
,
ListItemIcon
,
ListItemText
,
MenuList
,
MenuItem
,
Typography
,
Drawer
,
AppBar
,
Toolbar
,
Divider
,
Button
,
DialogContent
,
DialogTitle
,
DialogActions
,
Dialog
,
Tooltip
}
from
'
@material-ui/core
'
MenuList
,
MenuItem
,
Typography
,
Drawer
,
AppBar
,
Toolbar
,
Divider
,
Button
,
DialogContent
,
DialogTitle
,
DialogActions
,
Dialog
,
Tooltip
,
Snackbar
,
SnackbarContent
}
from
'
@material-ui/core
'
import
{
Switch
,
Route
,
Link
,
withRouter
}
from
'
react-router-dom
'
import
BackupIcon
from
'
@material-ui/icons/Backup
'
import
SearchIcon
from
'
@material-ui/icons/Search
'
...
...
@@ -31,6 +31,8 @@ import {help as uploadHelp, default as Uploads} from './uploads/Uploads'
import
ResolvePID
from
'
./entry/ResolvePID
'
import
DatasetPage
from
'
./DatasetPage
'
import
{
capitalize
}
from
'
../utils
'
import
{
makeStyles
}
from
'
@material-ui/core/styles
'
import
{
amber
}
from
'
@material-ui/core/colors
'
export
class
VersionMismatch
extends
Error
{
constructor
(
msg
)
{
...
...
@@ -39,6 +41,22 @@ export class VersionMismatch extends Error {
}
}
function
ReloadSnack
()
{
return
<
Snackbar
anchorOrigin
=
{{
vertical
:
'
bottom
'
,
horizontal
:
'
left
'
,
}}
open
>
<
SnackbarContent
style
=
{{
backgroundColor
:
amber
[
700
]}}
message
=
{
<
span
>
There
is
a
new
NOMAD
version
.
Please
press
your
browser
'
s reload (or even shift+reload) button.</span>}
/>
</Snackbar>
}
const drawerWidth = 200
class NavigationUnstyled extends React.Component {
...
...
@@ -187,8 +205,8 @@ class NavigationUnstyled extends React.Component {
.then((response) => response.json())
.then((meta) => {
if (meta.version !== packageJson.version) {
// this should not happen, if we setup the web servers correctly
console
.
error
(
'
GUI API version mismatch
'
)
console.log(
'
GUI
API
version
mismatch
'
)
this.setState({showReloadSnack: true}
)
}
})
.catch(() => {
...
...
@@ -203,6 +221,7 @@ class NavigationUnstyled extends React.Component {
render() {
const { classes, children, location: { pathname }, loading } = this.props
const { toolbarThemes, toolbarHelp, toolbarTitles } = this
const { showReloadSnack } = this.state
const selected = dct => {
const key = Object.keys(dct).find(key => {
...
...
@@ -218,6 +237,7 @@ class NavigationUnstyled extends React.Component {
<div className={classes.root}>
<div className={classes.appFrame}>
<MuiThemeProvider theme={theme}>
{ showReloadSnack ? <ReloadSnack/> :
''
}
<AppBar
position="absolute"
className={classNames(classes.appBar, this.state.open && classes.appBarShift)}
...
...
gui/src/components/ReloadSnack.js
0 → 100644
View file @
370913c4
export
default
function
ReloadSnack
()
{
return
<
Snackbar
anchorOrigin
=
{{
vertical
:
'
bottom
'
,
horizontal
:
'
left
'
,
}}
open
message
=
{
<
span
id
=
"
message-id
"
>
There
is
a
new
version
.
Please
press
your
browsers
Reload
(
or
even
Shift
+
Reload
)
button
.
<
/span>
}
/>
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment