mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 07:30:24 +00:00
override menu
This commit is contained in:
parent
be56fa1910
commit
cb0cf9f758
6 changed files with 289 additions and 47 deletions
43
cockpit/menu_override/networkmanager.override.json
Normal file
43
cockpit/menu_override/networkmanager.override.json
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
"name": "network",
|
||||||
|
"conditions": [
|
||||||
|
{"path-exists": "/usr/share/dbus-1/system.d/org.freedesktop.NetworkManager.conf"}
|
||||||
|
],
|
||||||
|
"tools": {
|
||||||
|
"index": {
|
||||||
|
"label": "Networking",
|
||||||
|
"order": 40,
|
||||||
|
"docs": [
|
||||||
|
{
|
||||||
|
"label": "Managing networking bonds",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-network-bonds-using-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing networking teams",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-network-teams-using-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing networking bridges",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-network-bridges-in-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing VLANs",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-vlans-in-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing firewall",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing_firewall_using_the_web_console"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"matches": ["network", "interface", "bridge", "vlan", "bond", "team", "port", "mac", "ipv4", "ipv6"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matches": ["firewall", "firewalld", "zone", "tcp", "udp"],
|
||||||
|
"goto": "/network/firewall"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
33
cockpit/menu_override/shell.override.json
Normal file
33
cockpit/menu_override/shell.override.json
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"requires": {
|
||||||
|
"cockpit": "239"
|
||||||
|
},
|
||||||
|
"locales": {
|
||||||
|
"en-us": "English",
|
||||||
|
"zh-cn": "中文(中国)"
|
||||||
|
},
|
||||||
|
"bridges": [
|
||||||
|
{
|
||||||
|
"privileged": true,
|
||||||
|
"environ": [
|
||||||
|
"SUDO_ASKPASS=${libexecdir}/cockpit-askpass"
|
||||||
|
],
|
||||||
|
"spawn": [
|
||||||
|
"sudo",
|
||||||
|
"-k",
|
||||||
|
"-A",
|
||||||
|
"cockpit-bridge",
|
||||||
|
"--privileged"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"privileged": true,
|
||||||
|
"spawn": [
|
||||||
|
"pkexec",
|
||||||
|
"--disable-internal-agent",
|
||||||
|
"cockpit-bridge",
|
||||||
|
"--privileged"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
75
cockpit/menu_override/storaged.override.json
Normal file
75
cockpit/menu_override/storaged.override.json
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"requires": {
|
||||||
|
"cockpit": "266"
|
||||||
|
},
|
||||||
|
"conditions": [
|
||||||
|
{"path-exists": "/usr/share/dbus-1/system.d/org.freedesktop.UDisks2.conf"}
|
||||||
|
],
|
||||||
|
|
||||||
|
"tools": {
|
||||||
|
"index": {
|
||||||
|
"label": "Storage",
|
||||||
|
"order": 30,
|
||||||
|
"docs": [
|
||||||
|
{
|
||||||
|
"label": "Managing partitions",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-partitions-using-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing NFS mounts",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-nfs-mounts-in-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing RAIDs",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-redundant-arrays-of-independent-disks-in-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing LVMs",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/using-the-web-console-for-configuring-lvm-logical-volumes_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing physical drives",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/using-the-web-console-for-changing-physical-drives-in-volume-groups_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Managing VDOs",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/using-the-web-console-for-managing-virtual-data-optimizer-volumes_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Using LUKS encryption",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/locking-data-with-luks-password-in-the-rhel-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Using Tang server",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-automated-unlocking-using-a-tang-key-in-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"matches": ["filesystem", "partition", "nfs", "raid", "volume", "disk", "vdo", "iscsi", "drive", "mount", "unmount", "udisks", "mkfs", "format", "fstab", "lvm2", "luks", "encryption", "nbde", "tang"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"config": {
|
||||||
|
"nfs_client_package": {
|
||||||
|
"rhel": "nfs-utils", "fedora": "nfs-utils",
|
||||||
|
"opensuse": "nfs-client", "opensuse-leap": "nfs-client",
|
||||||
|
"debian": "nfs-common", "ubuntu": "nfs-common",
|
||||||
|
"arch": "nfs-utils"
|
||||||
|
},
|
||||||
|
"vdo_package": { "rhel": "vdo", "centos": "vdo" },
|
||||||
|
"stratis_package": { "fedora": "stratisd",
|
||||||
|
"centos": "stratisd",
|
||||||
|
"arch": "stratisd",
|
||||||
|
"platform:el9": "stratisd"
|
||||||
|
},
|
||||||
|
"nbde_root_help": { "fedora": true,
|
||||||
|
"centos": true,
|
||||||
|
"rhel": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"content-security-policy": "img-src 'self' data:"
|
||||||
|
}
|
115
cockpit/menu_override/systemd.override.json
Normal file
115
cockpit/menu_override/systemd.override.json
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
{
|
||||||
|
"name": "system",
|
||||||
|
"requires": {
|
||||||
|
"cockpit": "265"
|
||||||
|
},
|
||||||
|
"menu": {
|
||||||
|
"terminal": {
|
||||||
|
"label": "Terminal",
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"console",
|
||||||
|
"command",
|
||||||
|
"bash",
|
||||||
|
"shell"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"index": {
|
||||||
|
"label": "Overview",
|
||||||
|
"order": -2,
|
||||||
|
"docs": [
|
||||||
|
{
|
||||||
|
"label": "Configuring system settings",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/getting-started-with-the-rhel-8-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"time",
|
||||||
|
"date",
|
||||||
|
"restart",
|
||||||
|
"shut",
|
||||||
|
"domain",
|
||||||
|
"machine",
|
||||||
|
"operating system",
|
||||||
|
"os",
|
||||||
|
"asset tag",
|
||||||
|
"ssh",
|
||||||
|
"power",
|
||||||
|
"version",
|
||||||
|
"host"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"hardware",
|
||||||
|
"mitigation",
|
||||||
|
"pci",
|
||||||
|
"memory",
|
||||||
|
"cpu",
|
||||||
|
"bios",
|
||||||
|
"ram",
|
||||||
|
"dimm",
|
||||||
|
"serial"
|
||||||
|
],
|
||||||
|
"goto": "/system/hwinfo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"graphs",
|
||||||
|
"metrics",
|
||||||
|
"history",
|
||||||
|
"pcp",
|
||||||
|
"cpu",
|
||||||
|
"memory",
|
||||||
|
"disks",
|
||||||
|
"network",
|
||||||
|
"cgroups",
|
||||||
|
"performance"
|
||||||
|
],
|
||||||
|
"goto": "/metrics"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tools": {
|
||||||
|
"logs": {
|
||||||
|
"label": "Logs",
|
||||||
|
"order": 20,
|
||||||
|
"docs": [
|
||||||
|
{
|
||||||
|
"label": "Reviewing logs",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/reviewing-logs_system-management-using-the-rhel-8-web-console"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"journal",
|
||||||
|
"warning",
|
||||||
|
"error",
|
||||||
|
"debug"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"abrt",
|
||||||
|
"crash",
|
||||||
|
"coredump"
|
||||||
|
],
|
||||||
|
"goto": "?tag=abrt-notification"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libexecdir": "${libexecdir}",
|
||||||
|
"preload": [
|
||||||
|
"index",
|
||||||
|
"services"
|
||||||
|
],
|
||||||
|
"content-security-policy": "img-src 'self' data:"
|
||||||
|
}
|
19
cockpit/menu_override/users.override.json
Normal file
19
cockpit/menu_override/users.override.json
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"tools": {
|
||||||
|
"index": {
|
||||||
|
"label": "Accounts",
|
||||||
|
"order": 70,
|
||||||
|
"docs": [
|
||||||
|
{
|
||||||
|
"label": "Managing user accounts",
|
||||||
|
"url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-user-accounts-in-the-web-console_system-management-using-the-rhel-8-web-console"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"matches": ["user", "password", "useradd", "passwd", "username", "login", "access", "roles", "ssh", "keys"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -375,7 +375,8 @@ else
|
||||||
echo "install from artifact"
|
echo "install from artifact"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo systemctl stop firewalld
|
||||||
|
sudo systemctl restart cockpit
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable --now cockpit
|
sudo systemctl enable --now cockpit
|
||||||
sudo systemctl enable --now cockpit.socket
|
sudo systemctl enable --now cockpit.socket
|
||||||
|
@ -513,53 +514,9 @@ sudo docker restart websoft9-nginxproxymanager
|
||||||
EditMenu(){
|
EditMenu(){
|
||||||
|
|
||||||
echo "Start to Edit Cockpit Menu ..."
|
echo "Start to Edit Cockpit Menu ..."
|
||||||
if command -v jq > /dev/null; then
|
cp -r /data/apps/websoft9/cockpit/menu_override/* /etc/cockpit
|
||||||
if [ -e /usr/share/cockpit/systemd ]; then
|
|
||||||
jq '. | .tools as $menu | .menu as $tools | .tools=$tools | .menu=$menu | del(.tools.services) | del(.menu.preload.services) | .menu.index = .tools.index | del(.tools.index) | .menu.index.order = -2' /usr/share/cockpit/systemd/manifest.json > /usr/share/cockpit/systemd/manifest.json.tmp
|
|
||||||
rm -rf /usr/share/cockpit/systemd/manifest.json
|
|
||||||
mv /usr/share/cockpit/systemd/manifest.json.tmp /usr/share/cockpit/systemd/manifest.json
|
|
||||||
cd /usr/share/cockpit/systemd && rm -rf services.js.gz services.html.gz services.css.gz services.js services.html services.css
|
cd /usr/share/cockpit/systemd && rm -rf services.js.gz services.html.gz services.css.gz services.js services.html services.css
|
||||||
fi
|
|
||||||
if [ -e /usr/share/cockpit/networkmanager ]; then
|
|
||||||
sudo sed -i 's/menu/tools/g' /usr/share/cockpit/networkmanager/manifest.json
|
|
||||||
fi
|
|
||||||
if [ -e /usr/share/cockpit/storaged ]; then
|
|
||||||
sudo sed -i 's/menu/tools/g' /usr/share/cockpit/storaged/manifest.json
|
|
||||||
fi
|
|
||||||
if [ -e /usr/share/cockpit/users ]; then
|
|
||||||
sudo sed -i 's/menu/tools/g' /usr/share/cockpit/users/manifest.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
jq '. | del(.locales."ca-es") | del(.locales."nb-no") | del(.locales."sk-sk") | del(.locales."tr-tr")| del(.locales."cs-cz") | del(.locales."de-de") | del(.locales."es-es") | del(.locales."fi-fi") | del(.locales."fr-fr") | del(.locales."it-it") | del(.locales."ja-jp") | del(.locales."pl-pl") | del(.locales."pt-br") | del(.locales."ru-ru") | del(.locales."sv-se") | del(.locales."uk-ua") | del(.locales."zh-tw") | del(.locales."he-il") | del(.locales."nl-nl") | del(.locales."ko-kr") | del(.locales."ka-ge")' /usr/share/cockpit/shell/manifest.json > /usr/share/cockpit/shell/manifest.json.tmp
|
|
||||||
rm -rf /usr/share/cockpit/shell/manifest.json
|
|
||||||
mv /usr/share/cockpit/shell/manifest.json.tmp /usr/share/cockpit/shell/manifest.json
|
|
||||||
else
|
|
||||||
echo "system have no jq, use cockpit menu ..."
|
|
||||||
if [ "$os_type" == 'CentOS' ] || [ "$os_type" == 'CentOS Stream' ] || [ "$os_type" == 'Fedora' ] || [ "$os_type" == 'OracleLinux' ] || [ "$os_type" == 'Redhat' ];then
|
|
||||||
sudo yum install epel-release -y 1>/dev/null 2>&1
|
|
||||||
sudo yum install jq -y 1>/dev/null 2>&1
|
|
||||||
if [ -e /usr/share/cockpit/systemd ]; then
|
|
||||||
jq '. | .tools as $menu | .menu as $tools | .tools=$tools | .menu=$menu | del(.tools.services) | del(.menu.preload.services) | .menu.index = .tools.index | del(.tools.index) | .menu.index.order = -2' /usr/share/cockpit/systemd/manifest.json > /usr/share/cockpit/systemd/manifest.json.tmp
|
|
||||||
rm -rf /usr/share/cockpit/systemd/manifest.json
|
|
||||||
mv /usr/share/cockpit/systemd/manifest.json.tmp /usr/share/cockpit/systemd/manifest.json
|
|
||||||
cd /usr/share/cockpit/systemd && rm -rf services.js.gz services.html.gz services.css.gz
|
|
||||||
fi
|
|
||||||
if [ -e /usr/share/cockpit/networkmanager ]; then
|
|
||||||
sudo sed -i 's/menu/tools/g' /usr/share/cockpit/networkmanager/manifest.json
|
|
||||||
fi
|
|
||||||
if [ -e /usr/share/cockpit/storaged ]; then
|
|
||||||
sudo sed -i 's/menu/tools/g' /usr/share/cockpit/storaged/manifest.json
|
|
||||||
fi
|
|
||||||
if [ -e /usr/share/cockpit/users ]; then
|
|
||||||
sudo sed -i 's/menu/tools/g' /usr/share/cockpit/users/manifest.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
jq '. | del(.locales."ca-es") | del(.locales."nb-no") | del(.locales."sk-sk") | del(.locales."tr-tr")| del(.locales."cs-cz") | del(.locales."de-de") | del(.locales."es-es") | del(.locales."fi-fi") | del(.locales."fr-fr") | del(.locales."it-it") | del(.locales."ja-jp") | del(.locales."pl-pl") | del(.locales."pt-br") | del(.locales."ru-ru") | del(.locales."sv-se") | del(.locales."uk-ua") | del(.locales."zh-tw") | del(.locales."he-il") | del(.locales."nl-nl") | del(.locales."ko-kr") | del(.locales."ka-ge")' /usr/share/cockpit/shell/manifest.json > /usr/share/cockpit/shell/manifest.json.tmp
|
|
||||||
rm -rf /usr/share/cockpit/shell/manifest.json
|
|
||||||
mv /usr/share/cockpit/shell/manifest.json.tmp /usr/share/cockpit/shell/manifest.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
echo "---------------------------------- Install success! you can install a app by websoft9's appstore -------------------------------------------------------"
|
echo "---------------------------------- Install success! you can install a app by websoft9's appstore -------------------------------------------------------"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue