diff --git a/pkg/selinux/setroubleshoot-view.jsx b/pkg/selinux/setroubleshoot-view.jsx
index 49497aad212e..fa65183b381b 100644
--- a/pkg/selinux/setroubleshoot-view.jsx
+++ b/pkg/selinux/setroubleshoot-view.jsx
@@ -219,60 +219,54 @@ class DismissableError extends React.Component {
* changeSelinuxMode function to use for changing the selinux enforcing mode
* dismissError function to dismiss the error message
*/
-class SELinuxStatus extends React.Component {
- render() {
- const errorMessage = this.props.selinuxStatusError
- ? {this.props.selinuxStatusError}
- : null;
-
- if (this.props.selinuxStatus.enabled === undefined) {
- // we don't know the current state
- return (
-
- {errorMessage}
-
{_("SELinux system status is unknown.")}
-
- );
- } else if (!this.props.selinuxStatus.enabled) {
- // selinux is disabled on the system, not much we can do
- return (
-
- {errorMessage}
-
{_("SELinux is disabled on the system.")}
-
- );
- }
- const configUnknown = (this.props.selinuxStatus.configEnforcing === undefined);
- let note = null;
- if (configUnknown)
- note = _("The configured state is unknown, it might change on the next boot.");
- else if (!configUnknown && this.props.selinuxStatus.enforcing !== this.props.selinuxStatus.configEnforcing)
- note = _("Setting deviates from the configured state and will revert on the next boot.");
-
- // note = _("Setting deviates from the configured state and will revert on the next boot.");
+const SELinuxStatus = ({ selinuxStatus, selinuxStatusError, changeSelinuxMode, dismissError }) => {
+ const errorMessage = selinuxStatusError
+ ? {selinuxStatusError}
+ : null;
+ if (selinuxStatus.enabled === undefined) {
return (
-
-
-
- {_("SELinux policy")}
-
-
-
- { note !== null &&
-
-
- { "\n" }
- { note }
-
- }
+
+ {errorMessage}
+
{_("SELinux system status is unknown.")}
+
+ );
+ } else if (!selinuxStatus.enabled) {
+ return (
+
{errorMessage}
-
+
{_("SELinux is disabled on the system.")}
+
);
}
-}
+ const configUnknown = (selinuxStatus.configEnforcing === undefined);
+ let note = null;
+ if (configUnknown)
+ note = _("The configured state is unknown, it might change on the next boot.");
+ else if (!configUnknown && selinuxStatus.enforcing !== selinuxStatus.configEnforcing)
+ note = _("Setting deviates from the configured state and will revert on the next boot.");
+
+ return (
+
+
+
+ {_("SELinux policy")}
+
+
+
+ { note !== null &&
+
+
+ { "\n" }
+ { note }
+
+ }
+ {errorMessage}
+
+ );
+};
/* The listing only shows if we have a connection to the dbus API
* Otherwise we have blank slate: trying to connect, error
diff --git a/pkg/storaged/logs-panel.jsx b/pkg/storaged/logs-panel.jsx
index 5bf47648f439..18fe196a177d 100644
--- a/pkg/storaged/logs-panel.jsx
+++ b/pkg/storaged/logs-panel.jsx
@@ -10,18 +10,16 @@ import { LogsPanel } from "cockpit-components-logs-panel.jsx";
const _ = cockpit.gettext;
-export class StorageLogsPanel extends React.Component {
- render() {
- const match = [
- "_SYSTEMD_UNIT=storaged.service", "+",
- "_SYSTEMD_UNIT=udisks2.service", "+",
- "_SYSTEMD_UNIT=dm-event.service", "+",
- "_SYSTEMD_UNIT=smartd.service", "+",
- "_SYSTEMD_UNIT=multipathd.service"
- ];
+export function StorageLogsPanel() {
+ const match = [
+ "_SYSTEMD_UNIT=storaged.service", "+",
+ "_SYSTEMD_UNIT=udisks2.service", "+",
+ "_SYSTEMD_UNIT=dm-event.service", "+",
+ "_SYSTEMD_UNIT=smartd.service", "+",
+ "_SYSTEMD_UNIT=multipathd.service"
+ ];
+ const search_options = { prio: "debug", _SYSTEMD_UNIT: "storaged.service,udisks2.service,dm-event.service,smartd.service,multipathd.service" };
+ const url = "/system/logs/#/?prio=debug&_SYSTEMD_UNIT=storaged.service,udisks2.service,dm-event.service,smartd.service,multipathd.service";
- const search_options = { prio: "debug", _SYSTEMD_UNIT: "storaged.service,udisks2.service,dm-event.service,smartd.service,multipathd.service" };
- const url = "/system/logs/#/?prio=debug&_SYSTEMD_UNIT=storaged.service,udisks2.service,dm-event.service,smartd.service,multipathd.service";
- return ;
- }
+ return ;
}