This commit is contained in:
qiaofeng1227 2023-06-03 14:32:24 +08:00
parent 7d6019274a
commit 94e6a16ed8
13 changed files with 42 additions and 41 deletions

View file

@ -1,8 +1,8 @@
{
"files": {
"main.css": "./static/css/main.751babb1.css",
"main.js": "./static/js/main.083f1840.js",
"static/js/145.8a3fe8dc.chunk.js": "./static/js/145.8a3fe8dc.chunk.js",
"main.js": "./static/js/main.ffda1723.js",
"static/js/145.796bcadc.chunk.js": "./static/js/145.796bcadc.chunk.js",
"static/js/376.bc0e5568.chunk.js": "./static/js/376.bc0e5568.chunk.js",
"static/js/426.46c5e949.chunk.js": "./static/js/426.46c5e949.chunk.js",
"static/js/603.8e18e7fa.chunk.js": "./static/js/603.8e18e7fa.chunk.js",
@ -64,8 +64,8 @@
"static/media/logo-sm.svg": "./static/media/logo-sm.53b8ca70620b0b2968874a3660f195dd.svg",
"index.html": "./index.html",
"main.751babb1.css.map": "./static/css/main.751babb1.css.map",
"main.083f1840.js.map": "./static/js/main.083f1840.js.map",
"145.8a3fe8dc.chunk.js.map": "./static/js/145.8a3fe8dc.chunk.js.map",
"main.ffda1723.js.map": "./static/js/main.ffda1723.js.map",
"145.796bcadc.chunk.js.map": "./static/js/145.796bcadc.chunk.js.map",
"376.bc0e5568.chunk.js.map": "./static/js/376.bc0e5568.chunk.js.map",
"426.46c5e949.chunk.js.map": "./static/js/426.46c5e949.chunk.js.map",
"603.8e18e7fa.chunk.js.map": "./static/js/603.8e18e7fa.chunk.js.map",
@ -78,6 +78,6 @@
},
"entrypoints": [
"static/css/main.751babb1.css",
"static/js/main.083f1840.js"
"static/js/main.ffda1723.js"
]
}

View file

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><script type="text/javascript" src="../base1/cockpit.js"></script><script type="text/javascript" src="../*/po.js"></script><link rel="manifest" href="./manifest.json"/><title>App Store</title><script defer="defer" src="./static/js/main.083f1840.js"></script><link href="./static/css/main.751babb1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root" style="height:100%"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><script type="text/javascript" src="../base1/cockpit.js"></script><script type="text/javascript" src="../*/po.js"></script><link rel="manifest" href="./manifest.json"/><title>App Store</title><script defer="defer" src="./static/js/main.ffda1723.js"></script><link href="./static/css/main.751babb1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root" style="height:100%"></div></body></html>

View file

@ -307,43 +307,43 @@
null,
"请输入要搜索的应用名称,例如:WordPress,MySQL,GitLab, …"
],
"App Overview"[
"App Overview": [
null,
"应用预览"
],
"App Name"[
"App Name": [
null,
"应用名称"
],
"App Version"[
"App Version": [
null,
"应用版本"
],
"App Port"[
"App Port": [
null,
"应用端口"
],
"Created Time"[
"Created Time": [
null,
"创建时间"
],
"Config Path"[
"Config Path": [
null,
"配置目录"
],
"Data Path"[
"Data Path": [
null,
"数据目录"
],
"Domain Access"[
"Domain Access": [
null,
"域名访问"
],
"Domain access for better application performance.HTTPS and custom configurations available."[
"Domain access for better application performance.HTTPS and custom configurations available.": [
null,
"域名访问以获得更好的应用程序性能,HTTPS和自定义配置可点击"
],
"Add Domain"[
"Add Domain": [
null,
"添加域名"
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -307,45 +307,49 @@
null,
"请输入要搜索的应用名称,例如:WordPress,MySQL,GitLab, …"
],
"App Overview"[
"App Overview": [
null,
"应用预览"
],
"App Name"[
"App Name": [
null,
"应用名称"
],
"App Version"[
"App Version": [
null,
"应用版本"
],
"App Port"[
"App Port": [
null,
"应用端口"
],
"Created Time"[
"Created Time": [
null,
"创建时间"
],
"Config Path"[
"Config Path": [
null,
"配置目录"
],
"Data Path"[
"Data Path": [
null,
"数据目录"
],
"Domain Access"[
"Domain Access": [
null,
"域名访问"
],
"Domain access for better application performance.HTTPS and custom configurations available."[
"Domain access for better application performance.HTTPS and custom configurations available.": [
null,
"域名访问以获得更好的应用程序性能,HTTPS和自定义配置可点击"
],
"Add Domain"[
"Add Domain": [
null,
"添加域名"
],
"Admin Page": [
null,
"访问后台"
]
}));

View file

@ -348,7 +348,7 @@ const AppAccess = (props): React$Element<React$FragmentType> => {
{
props.data?.config?.admin_domain_url && (
<a href={props.data?.config?.admin_domain_url} target="_blank" className="me-2">
<Button variant="primary" size="sm">访问后台</Button>
<Button variant="primary" size="sm">{_("Admin Page")}</Button>
</a>
)
}

View file

@ -15,7 +15,7 @@ const AppContainer = (props): React$Element<React$FragmentType> => {
//通过Portainer的接口获取容器数据
const getContainersData = async () => {
try {
let jwt = window.localStorage.getItem("portainer.JWT"); //获取存储在本地的JWT数据
let jwt = window.localStorage.getItem("portainer.JWT2"); //获取存储在本地的JWT数据
//如果获取不到jwt则模拟登录并写入新的jwt
if (jwt === null) {
@ -32,7 +32,7 @@ const AppContainer = (props): React$Element<React$FragmentType> => {
if (authResponse.status === 200) {
jwt = "\"" + authResponse.data.jwt + "\"";
//jwt = authResponse.data.jwt
window.localStorage.setItem('portainer\.JWT', jwt); //关键是将通过API登录后获取的jwt存储到本地localStorage
window.localStorage.setItem('portainer\.JWT2', jwt); //关键是将通过API登录后获取的jwt存储到本地localStorage
} else {
console.error('Error:', authResponse);
}
@ -41,14 +41,11 @@ const AppContainer = (props): React$Element<React$FragmentType> => {
console.error('Error:', response);
}
}
else {
jwt = jwt.replace(/"/g, '')
}
//从portainer接口获取endpoints
const endpointsData = await axios.get('/portainer/api/endpoints', {
headers: {
'Authorization': 'Bearer ' + jwt
'Authorization': 'Bearer ' + jwt.replace(/"/g, '')
}
});
if (endpointsData.status === 200) {
@ -58,7 +55,7 @@ const AppContainer = (props): React$Element<React$FragmentType> => {
//调用接口获取
const containersData = await axios.get(`/portainer/api/endpoints/${id}/docker/containers/json`, {
headers: {
'Authorization': 'Bearer ' + jwt
'Authorization': 'Bearer ' + jwt.replace(/"/g, '')
},
params: {
all: true,