parent
c20adb040a
commit
2a45b2f8ef
@ -0,0 +1,87 @@
|
|||||||
|
From fc676ccfa2932d62c09d6e47300147ab69aec6c0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eugene Zamriy <ezamriy@msvsphere-os.ru>
|
||||||
|
Date: Mon, 20 Nov 2023 21:15:12 +0300
|
||||||
|
Subject: [PATCH 1/6] Adds MSVSphere branding directory
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.am | 1 +
|
||||||
|
src/branding/msvsphere/Makefile.am | 11 +++++++++
|
||||||
|
src/branding/msvsphere/branding.css | 36 +++++++++++++++++++++++++++++
|
||||||
|
3 files changed, 48 insertions(+)
|
||||||
|
create mode 100644 src/branding/msvsphere/Makefile.am
|
||||||
|
create mode 100644 src/branding/msvsphere/branding.css
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index 7901fcc0d..5f2696062 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -174,6 +174,7 @@ include src/branding/debian/Makefile.am
|
||||||
|
include src/branding/default/Makefile.am
|
||||||
|
include src/branding/fedora/Makefile.am
|
||||||
|
include src/branding/kubernetes/Makefile.am
|
||||||
|
+include src/branding/msvsphere/Makefile.am
|
||||||
|
include src/branding/opensuse/Makefile.am
|
||||||
|
include src/branding/registry/Makefile.am
|
||||||
|
include src/branding/rhel/Makefile.am
|
||||||
|
diff --git a/src/branding/msvsphere/Makefile.am b/src/branding/msvsphere/Makefile.am
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000..7425bdd0f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/branding/msvsphere/Makefile.am
|
||||||
|
@@ -0,0 +1,11 @@
|
||||||
|
+msvspherebrandingdir = $(datadir)/cockpit/branding/msvsphere
|
||||||
|
+
|
||||||
|
+dist_msvspherebranding_DATA = \
|
||||||
|
+ src/branding/msvsphere/branding.css \
|
||||||
|
+ $(NULL)
|
||||||
|
+
|
||||||
|
+# Opportunistically use sphere-logos ... yes they're called 'fedora'
|
||||||
|
+install-data-hook::
|
||||||
|
+ ln -sTfr $(DESTDIR)/usr/share/pixmaps/system-logo-white.png $(DESTDIR)$(msvspherebrandingdir)/logo.png
|
||||||
|
+ ln -sTfr $(DESTDIR)/usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(msvspherebrandingdir)/apple-touch-icon.png
|
||||||
|
+ ln -sTfr $(DESTDIR)/etc/favicon.png $(DESTDIR)$(msvspherebrandingdir)/favicon.ico
|
||||||
|
diff --git a/src/branding/msvsphere/branding.css b/src/branding/msvsphere/branding.css
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000..2b87b42bc
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/branding/msvsphere/branding.css
|
||||||
|
@@ -0,0 +1,36 @@
|
||||||
|
+/* MSVSphere Branding */
|
||||||
|
+
|
||||||
|
+:root {
|
||||||
|
+ --ct-color-host-accent: #cc0000 !important;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+body.login-pf {
|
||||||
|
+ background: url("bg-plain.jpg") no-repeat 50% 0;
|
||||||
|
+ background-size: cover;
|
||||||
|
+ background-color: #101010;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#badge {
|
||||||
|
+ width: 225px;
|
||||||
|
+ height: 80px;
|
||||||
|
+ background-image: url("logo.png");
|
||||||
|
+ background-size: contain;
|
||||||
|
+ background-repeat: no-repeat;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#brand {
|
||||||
|
+ font-size: 18pt;
|
||||||
|
+ text-transform: uppercase;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#brand:before {
|
||||||
|
+ content: "${NAME}";
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#index-brand {
|
||||||
|
+ font-weight: bold;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#index-brand:before {
|
||||||
|
+ content: "${NAME}";
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,46 @@
|
|||||||
|
From 2e1149a465911f292a94a21d012198a009b1403f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eugene Zamriy <ezamriy@msvsphere-os.ru>
|
||||||
|
Date: Mon, 20 Nov 2023 21:25:21 +0300
|
||||||
|
Subject: [PATCH 2/6] Show MSVSPHERE_PRETTY_NAME instead of NAME on login page
|
||||||
|
|
||||||
|
---
|
||||||
|
src/branding/msvsphere/branding.css | 4 ++--
|
||||||
|
src/ws/cockpithandlers.c | 2 +-
|
||||||
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/branding/msvsphere/branding.css b/src/branding/msvsphere/branding.css
|
||||||
|
index 2b87b42bc..67faf6d4b 100644
|
||||||
|
--- a/src/branding/msvsphere/branding.css
|
||||||
|
+++ b/src/branding/msvsphere/branding.css
|
||||||
|
@@ -24,7 +24,7 @@ body.login-pf {
|
||||||
|
}
|
||||||
|
|
||||||
|
#brand:before {
|
||||||
|
- content: "${NAME}";
|
||||||
|
+ content: "${MSVSPHERE_PRETTY_NAME}";
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-brand {
|
||||||
|
@@ -32,5 +32,5 @@ body.login-pf {
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-brand:before {
|
||||||
|
- content: "${NAME}";
|
||||||
|
+ content: "${MSVSPHERE_PRETTY_NAME}";
|
||||||
|
}
|
||||||
|
diff --git a/src/ws/cockpithandlers.c b/src/ws/cockpithandlers.c
|
||||||
|
index c866e1c15..b1b914ffa 100644
|
||||||
|
--- a/src/ws/cockpithandlers.c
|
||||||
|
+++ b/src/ws/cockpithandlers.c
|
||||||
|
@@ -287,7 +287,7 @@ build_environment (GHashTable *os_release)
|
||||||
|
* the corresponding information is not a leak.
|
||||||
|
*/
|
||||||
|
static const gchar *release_fields[] = {
|
||||||
|
- "NAME", "ID", "PRETTY_NAME", "VARIANT", "VARIANT_ID", "CPE_NAME", "ID_LIKE", "DOCUMENTATION_URL"
|
||||||
|
+ "NAME", "ID", "PRETTY_NAME", "VARIANT", "VARIANT_ID", "CPE_NAME", "ID_LIKE", "DOCUMENTATION_URL", "MSVSPHERE_PRETTY_NAME"
|
||||||
|
};
|
||||||
|
|
||||||
|
static const gchar *prefix = "\n <script>\nvar environment = ";
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
From c1e377389f4e613e9707de8ea09bd5fc9179f8d4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eugene Zamriy <ezamriy@msvsphere-os.ru>
|
||||||
|
Date: Mon, 20 Nov 2023 21:46:51 +0300
|
||||||
|
Subject: [PATCH 3/6] Show MSVSPHERE_PRETTY_NAME instead of NAME for
|
||||||
|
documentation link
|
||||||
|
|
||||||
|
---
|
||||||
|
pkg/shell/topnav.jsx | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/pkg/shell/topnav.jsx b/pkg/shell/topnav.jsx
|
||||||
|
index 1ad8c3dcb..e1a8e4c66 100644
|
||||||
|
--- a/pkg/shell/topnav.jsx
|
||||||
|
+++ b/pkg/shell/topnav.jsx
|
||||||
|
@@ -149,7 +149,7 @@ export class TopNav extends React.Component {
|
||||||
|
|
||||||
|
if (this.state.osRelease.DOCUMENTATION_URL)
|
||||||
|
docItems.push(<DropdownItem key="os-doc" href={this.state.osRelease.DOCUMENTATION_URL} target="blank" rel="noopener noreferrer" icon={<ExternalLinkAltIcon />}>
|
||||||
|
- {cockpit.format(_("$0 documentation"), this.state.osRelease.NAME)}
|
||||||
|
+ {cockpit.format(_("$0 documentation"), this.state.osRelease.MSVSPHERE_PRETTY_NAME)}
|
||||||
|
</DropdownItem>);
|
||||||
|
|
||||||
|
// global documentation for cockpit as a whole
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,28 @@
|
|||||||
|
From 6beacc90bdaa4fc3af4f5ae6b627de59aa08fb55 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eugene Zamriy <ezamriy@msvsphere-os.ru>
|
||||||
|
Date: Tue, 21 Nov 2023 00:04:04 +0300
|
||||||
|
Subject: [PATCH 4/6] Include pkg/shell module translations in other modules
|
||||||
|
|
||||||
|
This is required to fix the sudo button translation which is
|
||||||
|
located in pkg/shell/superuser.jsx but used in different places
|
||||||
|
like pkg/sosreport module.
|
||||||
|
---
|
||||||
|
pkg/lib/cockpit-po-plugin.js | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/pkg/lib/cockpit-po-plugin.js b/pkg/lib/cockpit-po-plugin.js
|
||||||
|
index a7f31ca64..c3594d0ce 100644
|
||||||
|
--- a/pkg/lib/cockpit-po-plugin.js
|
||||||
|
+++ b/pkg/lib/cockpit-po-plugin.js
|
||||||
|
@@ -70,7 +70,7 @@ function buildFile(po_file, subdir, webpack_module, webpack_compilation) {
|
||||||
|
for (const [msgid, translation] of Object.entries(context)) {
|
||||||
|
/* Only include msgids which appear in this source directory */
|
||||||
|
const references = translation.comments.reference.split(/\s/);
|
||||||
|
- if (!references.some(str => str.startsWith(`pkg/${subdir}`) || str.startsWith(config.src_directory) || str.startsWith(`pkg/lib`)))
|
||||||
|
+ if (!references.some(str => str.startsWith(`pkg/${subdir}`) || str.startsWith(config.src_directory) || str.startsWith(`pkg/lib`) || str.startsWith(`pkg/shell`)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (translation.comments.flag?.match(/\bfuzzy\b/))
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,56 @@
|
|||||||
|
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
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
From a0a076d4b2b5770c35c63fff4e5ed80abd5fade9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eugene Zamriy <ezamriy@msvsphere-os.ru>
|
||||||
|
Date: Tue, 21 Nov 2023 00:48:25 +0300
|
||||||
|
Subject: [PATCH 6/6] Disable upstream documentation links
|
||||||
|
|
||||||
|
---
|
||||||
|
pkg/shell/topnav.jsx | 16 ----------------
|
||||||
|
1 file changed, 16 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pkg/shell/topnav.jsx b/pkg/shell/topnav.jsx
|
||||||
|
index e1a8e4c66..111563118 100644
|
||||||
|
--- a/pkg/shell/topnav.jsx
|
||||||
|
+++ b/pkg/shell/topnav.jsx
|
||||||
|
@@ -152,22 +152,6 @@ export class TopNav extends React.Component {
|
||||||
|
{cockpit.format(_("$0 documentation"), this.state.osRelease.MSVSPHERE_PRETTY_NAME)}
|
||||||
|
</DropdownItem>);
|
||||||
|
|
||||||
|
- // global documentation for cockpit as a whole
|
||||||
|
- (cockpit.manifests.shell?.docs ?? []).forEach(doc => {
|
||||||
|
- docItems.push(<DropdownItem key={doc.label} href={doc.url} target="blank" rel="noopener noreferrer" icon={<ExternalLinkAltIcon />}>
|
||||||
|
- {doc.label}
|
||||||
|
- </DropdownItem>);
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- if (docs.length > 0)
|
||||||
|
- docItems.push(<DropdownSeparator key="separator" />);
|
||||||
|
-
|
||||||
|
- docs.forEach(e => {
|
||||||
|
- docItems.push(<DropdownItem key={e.label} href={e.url} target="blank" rel="noopener noreferrer" icon={<ExternalLinkAltIcon />}>
|
||||||
|
- {_(e.label)}
|
||||||
|
- </DropdownItem>);
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
docItems.push(<DropdownSeparator key="separator1" />);
|
||||||
|
docItems.push(<DropdownItem key="about" component="button"
|
||||||
|
onClick={() => Dialogs.show(<AboutCockpitModal />)}>
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
_version="$1"
|
||||||
|
|
||||||
|
echo "Clean up sources"
|
||||||
|
rm -rf cockpit
|
||||||
|
|
||||||
|
echo "Cloning cockpit.git"
|
||||||
|
git clone https://github.com/cockpit-project/cockpit.git
|
||||||
|
cd cockpit
|
||||||
|
|
||||||
|
echo -n "Checking tag ${_version}... "
|
||||||
|
if ! git tag | grep -w ${_version}; then
|
||||||
|
echo "fail"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "ok"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Checkout tag ${_version}"
|
||||||
|
git checkout ${_version}
|
||||||
|
|
||||||
|
echo "Patching souurces"
|
||||||
|
git am ../000*.patch
|
||||||
|
|
||||||
|
echo "Fix version in tools/make-dist"
|
||||||
|
sed -i "s@VERSION=\"\$(git describe.*@VERSION=${_version}@" tools/make-dist
|
||||||
|
|
||||||
|
echo "Make dist"
|
||||||
|
tools/make-dist
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cp cockpit/tmp/build-dist/cockpit-300.3.tar.xz .
|
||||||
|
sha1sum cockpit-300.3.tar.xz
|
Loading…
Reference in new issue