Skip to content

Commit 0589f25

Browse files
committed
add php tab
1 parent 7862556 commit 0589f25

9 files changed

Lines changed: 751 additions & 429 deletions

File tree

build.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
#!/bin/bash
2-
cd /data/plugin-cockpit/plugin-myapps/build
32
yarn build
4-
while [ ! -d "/usr/share/cockpit/myapps" ]; do
5-
sleep 1
6-
done
7-
cp -r ./* /usr/share/cockpit/myapps/
3+
cp -r /data/plugin-cockpit/plugin-myapps/build/* /usr/share/cockpit/myapps/

config-overrides.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ module.exports = override(
88
addWebpackExternals({
99
"cockpit": "cockpit"
1010
}),
11+
(config, env) => {
12+
config.devtool = false;
13+
return config;
14+
}
1115
)

node_modules/.yarn-integrity

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"order": 0
88
}
99
},
10-
"content-security-policy": "default-src 'unsafe-inline' 'unsafe-eval' *;font-src * data:;style-src 'unsafe-inline' 'unsafe-eval' *;img-src * data:;connect-src http://redhattext http://overpass-webfont *"
11-
}
10+
"content-security-policy": "default-src 'unsafe-inline' 'unsafe-eval' *;font-src * data:;style-src 'unsafe-inline' 'unsafe-eval' *;img-src * data:;connect-src http://redhattext http://overpass-webfont https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9393241f-05b6-45a2-a3e7-b3ab5275cf09 *"
11+
}

public/po.zh_CN.js

Lines changed: 158 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,5 +947,162 @@ cockpit.locale({
947947
"W9_DNS_UDP_PORT_SET": [
948948
null,
949949
"DNS UDP 端口"
950+
],
951+
"PHP Overview": [
952+
null,
953+
"PHP 概览"
954+
],
955+
"Current PHP Version": [
956+
null,
957+
"当前PHP版本"
958+
],
959+
"Installed PHP Modules": [
960+
null,
961+
"已安装的PHP模块"
962+
],
963+
"Switch PHP Version": [
964+
null,
965+
"切换PHP版本"
966+
],
967+
"Switching PHP versions may cause compatibility issues with your application. Please contact support for assistance.": [
968+
null,
969+
"切换PHP版本可能会导致应用程序兼容性问题。请联系支持以获取帮助。"
970+
],
971+
"Contact Support": [
972+
null,
973+
"联系支持"
974+
],
975+
"Loading...": [
976+
null,
977+
"加载中..."
978+
],
979+
"Cancel": [
980+
null,
981+
"取消"
982+
],
983+
"Request Migration": [
984+
null,
985+
"版本切换"
986+
],
987+
"PHP version migration requires technical assistance to ensure compatibility": [
988+
null,
989+
"PHP版本切换需要技术支持以确保兼容性"
990+
],
991+
"Warning:": [
992+
null,
993+
"警告:"
994+
],
995+
"Target Version": [
996+
null,
997+
"目标版本"
998+
],
999+
"Select Version": [
1000+
null,
1001+
"选择版本"
1002+
],
1003+
"Contact Name": [
1004+
null,
1005+
"联系人姓名"
1006+
],
1007+
"Enter contact name": [
1008+
null,
1009+
"请输入联系人姓名"
1010+
],
1011+
"Phone Number": [
1012+
null,
1013+
"手机号码"
1014+
],
1015+
"Phone number": [
1016+
null,
1017+
"手机号码"
1018+
],
1019+
"Email Address": [
1020+
null,
1021+
"电子邮箱"
1022+
],
1023+
"Email address": [
1024+
null,
1025+
"电子邮箱"
1026+
],
1027+
"Remarks": [
1028+
null,
1029+
"备注说明"
1030+
],
1031+
"Other remarks and explanations": [
1032+
null,
1033+
"其他备注说明"
1034+
],
1035+
"Contact info: Phone or email required": [
1036+
null,
1037+
"联系方式:手机号或邮箱至少填写一项"
1038+
],
1039+
"Get Support": [
1040+
null,
1041+
"获取支持"
1042+
],
1043+
"Please enter contact name": [
1044+
null,
1045+
"请输入联系人姓名"
1046+
],
1047+
"Please enter at least one contact method (phone or email)": [
1048+
null,
1049+
"请至少填写一种联系方式(手机号或邮箱)"
1050+
],
1051+
"Please enter a valid phone number": [
1052+
null,
1053+
"请输入有效的手机号码"
1054+
],
1055+
"Please enter a valid email address": [
1056+
null,
1057+
"请输入有效的电子邮箱地址"
1058+
],
1059+
"Please select target PHP version": [
1060+
null,
1061+
"请选择目标PHP版本"
1062+
],
1063+
"PHP version change request submitted successfully! We will contact you soon.": [
1064+
null,
1065+
"PHP版本切换申请提交成功!我们将尽快与您联系。"
1066+
],
1067+
"Error fetching version": [
1068+
null,
1069+
"获取版本信息失败"
1070+
],
1071+
"Error fetching modules": [
1072+
null,
1073+
"获取模块信息失败"
1074+
],
1075+
"Cancel Switch": [
1076+
null,
1077+
"取消切换"
1078+
],
1079+
"Please include your contact information in the remarks and ensure it is accurate so we can reach you.": [
1080+
null,
1081+
"请在备注中包含您的联系信息,并确保其准确无误,以便我们能够联系到您。"
1082+
],
1083+
"Note": [
1084+
null,
1085+
"注意"
1086+
],
1087+
"Example": [
1088+
null,
1089+
"例如"
1090+
],
1091+
"Please provide contact information and remarks": [
1092+
null,
1093+
"请输入联系信息和备注说明"
1094+
],
1095+
"Please provide at least phone number or email address in remarks": [
1096+
null,
1097+
"请至少填写一种联系方式(手机号或邮箱)"
1098+
],
1099+
"Request submitted successfully": [
1100+
null,
1101+
"申请提交成功"
1102+
],
1103+
"Request submission failed": [
1104+
null,
1105+
"申请提交失败"
9501106
]
951-
});
1107+
});
1108+

src/pages/appdetail.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import AppCompose from './appdetailtabs/appcompose';
1414
import AppContainer from './appdetailtabs/appcontainer';
1515
import AppDatabases from './appdetailtabs/appdatabases';
1616
import AppOverview from './appdetailtabs/appoverview';
17+
import AppPhpVersion from './appdetailtabs/appphpversion';
1718
import Uninstall from './appdetailtabs/appuninstall';
1819
import AppVolume from './appdetailtabs/appvolume';
1920
import { getApiKey, getNginxConfig } from '../helpers/api_apphub/apiCore_axios';
@@ -297,16 +298,6 @@ const AppDetailModal = (props): React$Element<React$FragmentType> => {
297298
const [showDBExpose, setShowDBExpose] = useState(false);
298299
const [showAppVolumes, setShowAppVolumes] = useState(false);
299300
const baseURL = props.baseURL;
300-
301-
// const getNginxConfig = async () => {
302-
// var script = "docker exec -i websoft9-apphub apphub getconfig --section nginx_proxy_manager";
303-
// let content = (await cockpit.spawn(["/bin/bash", "-c", script], { superuser: "try" })).trim();
304-
// content = JSON.parse(content);
305-
// let listen_port = content.listen_port;
306-
307-
// baseURL = `${window.location.protocol}//${window.location.hostname}:${listen_port}`;
308-
// }
309-
310301
let stateResult = '';
311302
if (currentApp && currentApp.containers) {
312303
// 计算每个容器状态的数量
@@ -452,9 +443,17 @@ const AppDetailModal = (props): React$Element<React$FragmentType> => {
452443
text: <AppVolume data={currentApp} />,
453444
});
454445
}
455-
if (showDBExpose) {
446+
if (currentApp && props.isPhpApp) {
456447
tabContents.splice(4, 0, {
457448
id: '7',
449+
title: _("PHP"),
450+
icon: 'mdi dripicons-stack',
451+
text: <AppPhpVersion data={currentApp} />,
452+
});
453+
}
454+
if (showDBExpose) {
455+
tabContents.splice(4, 0, {
456+
id: '8',
458457
title: _("Database"),
459458
icon: 'mdi dripicons-stack',
460459
text: <AppDatabases data={currentApp} />,

0 commit comments

Comments
 (0)