From 142ff58b85f5267c55e7ae5d77793ad1a412585d Mon Sep 17 00:00:00 2001 From: tigro Date: Thu, 17 Oct 2024 13:11:41 +0300 Subject: [PATCH] Show MSVSPHERE_PRETTY_NAME instead of PRETTY_NAME in overview --- pkg/systemd/overview.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/systemd/overview.jsx b/pkg/systemd/overview.jsx index 7ade0dc27..7ac476b94 100644 --- a/pkg/systemd/overview.jsx +++ b/pkg/systemd/overview.jsx @@ -29,6 +29,7 @@ import { Gallery } from "@patternfly/react-core/dist/esm/layouts/Gallery/index.j import { Dropdown, DropdownItem, DropdownList } from '@patternfly/react-core/dist/esm/components/Dropdown/index.js'; import { MenuToggle, MenuToggleAction } from "@patternfly/react-core/dist/esm/components/MenuToggle"; +import { read_os_release } from "os-release.js"; import { superuser } from "superuser"; import { SystemInformationCard } from './overview-cards/systemInformationCard.jsx'; @@ -59,6 +60,8 @@ class OverviewPage extends React.Component { this.onPermissionChanged = this.onPermissionChanged.bind(this); this.superuser = cockpit.dbus(null, { bus: "internal" }).proxy("cockpit.Superuser", "/superuser"); + + read_os_release().then(os => this.setState({ osRelease: os || {} })); } componentDidMount() { @@ -164,9 +167,12 @@ class OverviewPage extends React.Component {

{this.hostname_text()}

- {this.state.hostnameData && - this.state.hostnameData.OperatingSystemPrettyName && -
{cockpit.format(_("running $0"), this.state.hostnameData.OperatingSystemPrettyName)}
} + {this.state.osRelease && this.state.osRelease.MSVSPHERE_PRETTY_NAME ? ( +
{cockpit.format(_("running $0"), this.state.osRelease.MSVSPHERE_PRETTY_NAME)}
+ ) : ( + this.state.hostnameData && this.state.hostnameData.OperatingSystemPrettyName && +
{cockpit.format(_("running $0"), this.state.hostnameData.OperatingSystemPrettyName)}
+ )}
{ show_superuser && } -- 2.47.0