You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
2.9 KiB
57 lines
2.9 KiB
9 months ago
|
From a62c5236b9b660803c98da943f2fdbca5faaf588 Mon Sep 17 00:00:00 2001
|
||
|
From: Eugene Zamriy <ezamriy@msvsphere-os.ru>
|
||
|
Date: Tue, 21 Nov 2023 00:36:55 +0300
|
||
|
Subject: [PATCH 5/6] Show MSVSPHERE_PRETTY_NAME instead of PRETTY_NAME in
|
||
|
overview
|
||
|
|
||
|
---
|
||
|
pkg/systemd/overview.jsx | 13 ++++++++++---
|
||
|
1 file changed, 10 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/pkg/systemd/overview.jsx b/pkg/systemd/overview.jsx
|
||
|
index e780a1c5d..3527b02b6 100644
|
||
|
--- a/pkg/systemd/overview.jsx
|
||
|
+++ b/pkg/systemd/overview.jsx
|
||
|
@@ -28,6 +28,7 @@ import { Page, PageSection, PageSectionVariants } from "@patternfly/react-core/d
|
||
|
import { Gallery } from "@patternfly/react-core/dist/esm/layouts/Gallery/index.js";
|
||
|
import { Dropdown, DropdownItem, DropdownPosition, DropdownToggle, DropdownToggleAction } from '@patternfly/react-core/dist/esm/deprecated/components/Dropdown/index.js';
|
||
|
|
||
|
+import { read_os_release } from "os-release.js";
|
||
|
import { superuser } from "superuser";
|
||
|
|
||
|
import { SystemInformationCard } from './overview-cards/systemInformationCard.jsx';
|
||
|
@@ -53,11 +54,14 @@ class OverviewPage extends React.Component {
|
||
|
this.state = {
|
||
|
actionIsOpen: false,
|
||
|
privileged: true,
|
||
|
+ osRelease: {},
|
||
|
};
|
||
|
this.hostnameMonitor = this.hostnameMonitor.bind(this);
|
||
|
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() {
|
||
|
@@ -154,9 +158,12 @@ class OverviewPage extends React.Component {
|
||
|
<h1>
|
||
|
{this.hostname_text()}
|
||
|
</h1>
|
||
|
- {this.state.hostnameData &&
|
||
|
- this.state.hostnameData.OperatingSystemPrettyName &&
|
||
|
- <div className="ct-overview-header-subheading" id="system_information_os_text">{cockpit.format(_("running $0"), this.state.hostnameData.OperatingSystemPrettyName)}</div>}
|
||
|
+ {this.state.osRelease && this.state.osRelease.MSVSPHERE_PRETTY_NAME ? (
|
||
|
+ <div className="ct-overview-header-subheading" id="system_information_os_text">{cockpit.format(_("running $0"), this.state.osRelease.MSVSPHERE_PRETTY_NAME)}</div>
|
||
|
+ ) : (
|
||
|
+ this.state.hostnameData && this.state.hostnameData.OperatingSystemPrettyName &&
|
||
|
+ <div className="ct-overview-header-subheading" id="system_information_os_text">{cockpit.format(_("running $0"), this.state.hostnameData.OperatingSystemPrettyName)}</div>
|
||
|
+ )}
|
||
|
</div>
|
||
|
<div className='ct-overview-header-actions'>
|
||
|
{ show_superuser && <SuperuserIndicator proxy={this.superuser} /> }
|
||
|
--
|
||
|
2.43.0
|
||
|
|