This commit is contained in:
Jannis Mattheis 2021-12-04 20:43:17 +01:00
parent e272343deb
commit 6b3467b1d7
19 changed files with 88 additions and 44 deletions

View File

@ -34,7 +34,8 @@ export default class AddDialog extends Component<IProps, IState> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="app-dialog">
id="app-dialog"
>
<DialogTitle id="form-dialog-title">Create an application</DialogTitle>
<DialogContent>
<DialogContentText>
@ -69,7 +70,8 @@ export default class AddDialog extends Component<IProps, IState> {
disabled={!submitEnabled}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
Create
</Button>
</div>

View File

@ -53,11 +53,13 @@ class Applications extends Component<Stores<'appStore'>> {
id="create-app"
variant="contained"
color="primary"
onClick={() => (this.createDialog = true)}>
onClick={() => (this.createDialog = true)}
>
Create Application
</Button>
}
maxWidth={1000}>
maxWidth={1000}
>
<Grid item xs={12}>
<Paper elevation={6}>
<Table id="app-table">

View File

@ -44,7 +44,8 @@ export default class UpdateDialog extends Component<IProps, IState> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="app-dialog">
id="app-dialog"
>
<DialogTitle id="form-dialog-title">Update an application</DialogTitle>
<DialogContent>
<DialogContentText>
@ -79,7 +80,8 @@ export default class UpdateDialog extends Component<IProps, IState> {
disabled={!submitEnabled}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
Update
</Button>
</div>

View File

@ -28,7 +28,8 @@ export default class AddDialog extends Component<IProps, {name: string}> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="client-dialog">
id="client-dialog"
>
<DialogTitle id="form-dialog-title">Create a client</DialogTitle>
<DialogContent>
<TextField
@ -46,14 +47,16 @@ export default class AddDialog extends Component<IProps, {name: string}> {
<Button onClick={fClose}>Cancel</Button>
<Tooltip
placement={'bottom-start'}
title={submitEnabled ? '' : 'name is required'}>
title={submitEnabled ? '' : 'name is required'}
>
<div>
<Button
className="create"
disabled={!submitEnabled}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
Create
</Button>
</div>

View File

@ -48,10 +48,12 @@ class Clients extends Component<Stores<'clientStore'>> {
id="create-client"
variant="contained"
color="primary"
onClick={() => (this.showDialog = true)}>
onClick={() => (this.showDialog = true)}
>
Create Client
</Button>
}>
}
>
<Grid item xs={12}>
<Paper elevation={6}>
<Table id="client-table">

View File

@ -41,7 +41,8 @@ export default class UpdateDialog extends Component<IProps, IState> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="client-dialog">
id="client-dialog"
>
<DialogTitle id="form-dialog-title">Update a Client</DialogTitle>
<DialogContent>
<DialogContentText>
@ -68,7 +69,8 @@ export default class UpdateDialog extends Component<IProps, IState> {
disabled={!submitEnabled}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
Update
</Button>
</div>

View File

@ -23,7 +23,8 @@ export default function ConfirmDialog({title, text, fClose, fOnSubmit}: IProps)
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
className="confirm-dialog">
className="confirm-dialog"
>
<DialogTitle id="form-dialog-title">{title}</DialogTitle>
<DialogContent>
<DialogContentText>{text}</DialogContentText>
@ -37,7 +38,8 @@ export default function ConfirmDialog({title, text, fClose, fOnSubmit}: IProps)
autoFocus
color="primary"
variant="contained"
className="confirm">
className="confirm"
>
Yes
</Button>
</DialogActions>

View File

@ -16,7 +16,8 @@ export const ConnectionErrorBanner = ({height, retry, message}: ConnectionErrorB
width: '100%',
zIndex: 1300,
position: 'relative',
}}>
}}
>
<Typography align="center" variant="h6" style={{lineHeight: `${height}px`}}>
{message}{' '}
<Button variant="outlined" onClick={retry}>

View File

@ -36,7 +36,8 @@ class ScrollUpButton extends Component {
display: this.state.display,
opacity: this.state.opacity,
}}
onClick={this.scrollUp}>
onClick={this.scrollUp}
>
<KeyboardArrowUp />
</Fab>
);

View File

@ -31,7 +31,8 @@ class SettingsDialog extends Component<IProps & Stores<'currentUser'>> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="changepw-dialog">
id="changepw-dialog"
>
<DialogTitle id="form-dialog-title">Change Password</DialogTitle>
<DialogContent>
<TextField
@ -54,7 +55,8 @@ class SettingsDialog extends Component<IProps & Stores<'currentUser'>> {
disabled={pass.length === 0}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
Change
</Button>
</div>

View File

@ -106,7 +106,8 @@ class Header extends Component<IProps> {
</Link>
<a
href={'https://github.com/gotify/server/releases/tag/v' + version}
className={classes.link}>
className={classes.link}
>
<Typography variant="button" color="inherit">
@{version}
</Typography>
@ -122,7 +123,8 @@ class Header extends Component<IProps> {
href="https://github.com/gotify/server"
className={classes.link}
target="_blank"
rel="noopener noreferrer">
rel="noopener noreferrer"
>
<IconButton color="inherit">
<GitHubIcon />
</IconButton>

View File

@ -57,7 +57,8 @@ class Navigation extends Component<
onClick={() => setNavOpen(false)}
className={`${classes.link} item`}
to={'/messages/' + app.id}
key={app.id}>
key={app.id}
>
<ListItem button>
<ListItemText primary={app.name} />
</ListItem>
@ -78,7 +79,8 @@ class Navigation extends Component<
classes={{root: classes.root, paper: classes.drawerPaper}}
navOpen={navOpen}
setNavOpen={setNavOpen}
id="message-navigation">
id="message-navigation"
>
<div className={classes.toolbar} />
<Link className={classes.link} to="/" onClick={() => setNavOpen(false)}>
<ListItem button disabled={!loggedIn} className="all">
@ -94,7 +96,8 @@ class Navigation extends Component<
onClick={() => {
requestPermission();
this.setState({showRequestNotification: false});
}}>
}}
>
Enable Notifications
</Button>
) : null}

View File

@ -70,7 +70,8 @@ class Messages extends Component<IProps & Stores<'messagesStore' | 'appStore'>,
disabled={!hasMessages}
color="primary"
onClick={() => messagesStore.refreshByApp(appId)}
style={{marginRight: 5}}>
style={{marginRight: 5}}
>
Refresh
</Button>
<Button
@ -78,18 +79,21 @@ class Messages extends Component<IProps & Stores<'messagesStore' | 'appStore'>,
variant="contained"
disabled={!hasMessages}
color="primary"
onClick={() => messagesStore.removeByApp(appId)}>
onClick={() => messagesStore.removeByApp(appId)}
>
Delete All
</Button>
</div>
}>
}
>
{hasMessages ? (
<div style={{width: '100%'}} id="messages">
<ReactInfinite
key={appId}
useWindowAsScrollContainer
preloadBatchSize={window.innerHeight * 3}
elementHeight={messages.map((m) => this.heights[m.id] || 1)}>
elementHeight={messages.map((m) => this.heights[m.id] || 1)}
>
{messages.map(this.renderMessage)}
</ReactInfinite>

View File

@ -79,7 +79,8 @@ class PluginDetailView extends Component<IProps & Stores<'pluginStore'>, IState>
name={'Configurer'}
description={'This is the configuration panel for this plugin.'}
icon={Build}
refresh={this.refreshConfigurer.bind(this)}>
refresh={this.refreshConfigurer.bind(this)}
>
<ConfigurerPanel
pluginInfo={pluginInfo}
initialConfig={
@ -99,7 +100,8 @@ class PluginDetailView extends Component<IProps & Stores<'pluginStore'>, IState>
name={'Displayer'}
description={'This is the information generated by the plugin.'}
refresh={this.refreshDisplayer.bind(this)}
icon={Subject}>
icon={Subject}
>
<DisplayerPanel
pluginInfo={pluginInfo}
displayText={
@ -145,7 +147,8 @@ const PanelWrapper: React.FC<IPanelWrapperProps> = ({
style={{float: 'right'}}
onClick={() => {
refresh();
}}>
}}
>
<Refresh />
</Button>
) : null}
@ -199,7 +202,8 @@ class ConfigurerPanel extends Component<IConfigurerPanelProps, {unsavedChanges:
this.props.save(newConfig!).then(() => {
this.setState({unsavedChanges: null});
});
}}>
}}
>
<Typography variant="button">Save</Typography>
</Button>
</div>
@ -260,7 +264,8 @@ class PluginInfo extends Component<{pluginInfo: IPlugin}> {
href={url}
target="_blank"
rel="noopener noreferrer"
className="custom-route">
className="custom-route"
>
{url}
</a>
))(`${config.get('url')}plugin/${id}/custom/${token}/`)}

View File

@ -42,7 +42,8 @@ class SnackBarHandler extends Component<Stores<'snackManager'>> {
key="close"
aria-label="Close"
color="inherit"
onClick={this.closeCurrentSnack}>
onClick={this.closeCurrentSnack}
>
<Close />
</IconButton>
}

View File

@ -44,7 +44,8 @@ export default class AddEditDialog extends Component<IProps, IState> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="add-edit-user-dialog">
id="add-edit-user-dialog"
>
<DialogTitle id="form-dialog-title">
{isEdit ? 'Edit ' + this.props.name : 'Add a user'}
</DialogTitle>
@ -90,14 +91,16 @@ export default class AddEditDialog extends Component<IProps, IState> {
? ''
: 'password is required'
: 'name is required'
}>
}
>
<div>
<Button
className="save-create"
disabled={!passPresent || !namePresent}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
{isEdit ? 'Save' : 'Create'}
</Button>
</div>

View File

@ -50,7 +50,8 @@ class Login extends Component<Stores<'currentUser'>> {
color="primary"
disabled={!!this.props.currentUser.connectionErrorMessage}
style={{marginTop: 15, marginBottom: 5}}
onClick={this.login}>
onClick={this.login}
>
Login
</Button>
</form>
@ -78,7 +79,8 @@ class Login extends Component<Stores<'currentUser'>> {
id="register"
variant="contained"
color="primary"
onClick={() => (this.registerDialog = true)}>
onClick={() => (this.registerDialog = true)}
>
Register
</Button>
);

View File

@ -41,7 +41,8 @@ export default class RegistrationDialog extends Component<IProps, IState> {
open={true}
onClose={fClose}
aria-labelledby="form-dialog-title"
id="add-edit-user-dialog">
id="add-edit-user-dialog"
>
<DialogTitle id="form-dialog-title">Registration</DialogTitle>
<DialogContent>
<TextField
@ -74,14 +75,16 @@ export default class RegistrationDialog extends Component<IProps, IState> {
? ''
: 'password is required'
: 'name is required'
}>
}
>
<div>
<Button
className="save-create"
disabled={!passPresent || !namePresent}
onClick={submitAndClose}
color="primary"
variant="contained">
variant="contained"
>
Register
</Button>
</div>

View File

@ -75,10 +75,12 @@ class Users extends Component<WithStyles<'wrapper'> & Stores<'userStore'>> {
id="create-user"
variant="contained"
color="primary"
onClick={() => (this.createDialog = true)}>
onClick={() => (this.createDialog = true)}
>
Create User
</Button>
}>
}
>
<Grid item xs={12}>
<Paper elevation={6}>
<Table id="user-table">