mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
show restart checkbox only if restarting is supported
This commit is contained in:
@@ -214,8 +214,25 @@ class PluginModal extends React.Component<Props, State> {
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
createRestartSectionContent = () => {
|
||||
const { restart } = this.state;
|
||||
const { plugin, pluginAction, t } = this.props;
|
||||
|
||||
if (plugin._links[pluginAction + "WithRestart"]) {
|
||||
return (
|
||||
<Checkbox
|
||||
checked={restart}
|
||||
label={t("plugins.modal.restart")}
|
||||
onChange={this.handleRestartChange}
|
||||
disabled={false}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return <Notification type="warning">{t("plugins.modal.manualRestartRequired")}</Notification>;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { plugin, pluginAction, onClose, t } = this.props;
|
||||
|
||||
const body = (
|
||||
@@ -262,12 +279,7 @@ class PluginModal extends React.Component<Props, State> {
|
||||
</div>
|
||||
<div className="media">
|
||||
<div className="media-content">
|
||||
<Checkbox
|
||||
checked={restart}
|
||||
label={t("plugins.modal.restart")}
|
||||
onChange={this.handleRestartChange}
|
||||
disabled={false}
|
||||
/>
|
||||
{this.createRestartSectionContent()}
|
||||
</div>
|
||||
</div>
|
||||
{this.renderNotifications()}
|
||||
|
||||
Reference in New Issue
Block a user