mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 15:10:22 +00:00
release 0.2.0
This commit is contained in:
parent
5209105b94
commit
cf5a93a5ab
25 changed files with 78 additions and 33 deletions
|
@ -1,3 +1,9 @@
|
|||
## 0.2.0 release on 2023-06-03
|
||||
|
||||
1. appmanage docker 镜像更新到 0.2.0
|
||||
2. Portainer 插件修复自动登录 bug
|
||||
3. My Apps 插件修复首次使用获取容器 bug
|
||||
|
||||
## 0.1.0 release on 2023-05-26
|
||||
|
||||
1. stackhub 预发布,基本功能实现
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"files": {
|
||||
"main.css": "./static/css/main.751babb1.css",
|
||||
"main.js": "./static/js/main.ffda1723.js",
|
||||
"static/js/145.796bcadc.chunk.js": "./static/js/145.796bcadc.chunk.js",
|
||||
"main.js": "./static/js/main.9813c239.js",
|
||||
"static/js/145.13333720.chunk.js": "./static/js/145.13333720.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.ffda1723.js.map": "./static/js/main.ffda1723.js.map",
|
||||
"145.796bcadc.chunk.js.map": "./static/js/145.796bcadc.chunk.js.map",
|
||||
"main.9813c239.js.map": "./static/js/main.9813c239.js.map",
|
||||
"145.13333720.chunk.js.map": "./static/js/145.13333720.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.ffda1723.js"
|
||||
"static/js/main.9813c239.js"
|
||||
]
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"PORTAINER": {
|
||||
"PORTAINER_AUTH_URL": "/portainer/api/auth",
|
||||
"PORTAINER_HOME_PAGE": "/portainer",
|
||||
"PORTAINER_HOME_PAGE": "/portainer/#!/home",
|
||||
"PORTAINER_USERNAME": "admin",
|
||||
"PORTAINER_PASSWORD": "websoft9@2023"
|
||||
},
|
||||
|
|
|
@ -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.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>
|
||||
<!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.9813c239.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>
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"menu": {
|
||||
"appstore": {
|
||||
"label": "My Apps",
|
||||
|
|
|
@ -346,6 +346,10 @@
|
|||
"Add Domain": [
|
||||
null,
|
||||
"添加域名"
|
||||
],
|
||||
"Admin Page": [
|
||||
null,
|
||||
"访问后台"
|
||||
]
|
||||
}));
|
||||
|
||||
|
|
2
cockpit/myapps/build/static/js/145.13333720.chunk.js
Normal file
2
cockpit/myapps/build/static/js/145.13333720.chunk.js
Normal file
File diff suppressed because one or more lines are too long
1
cockpit/myapps/build/static/js/145.13333720.chunk.js.map
Normal file
1
cockpit/myapps/build/static/js/145.13333720.chunk.js.map
Normal file
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
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"PORTAINER": {
|
||||
"PORTAINER_AUTH_URL": "/portainer/api/auth",
|
||||
"PORTAINER_HOME_PAGE": "/portainer",
|
||||
"PORTAINER_HOME_PAGE": "/portainer/#!/home",
|
||||
"PORTAINER_USERNAME": "admin",
|
||||
"PORTAINER_PASSWORD": "websoft9@2023"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"menu": {
|
||||
"appstore": {
|
||||
"label": "My Apps",
|
||||
|
|
|
@ -16,6 +16,7 @@ const AppContainer = (props): React$Element<React$FragmentType> => {
|
|||
const getContainersData = async () => {
|
||||
try {
|
||||
let jwt = window.localStorage.getItem("portainer.JWT2"); //获取存储在本地的JWT数据
|
||||
let id = null;
|
||||
|
||||
//如果获取不到jwt,则模拟登录并写入新的jwt
|
||||
if (jwt === null) {
|
||||
|
@ -49,9 +50,34 @@ const AppContainer = (props): React$Element<React$FragmentType> => {
|
|||
}
|
||||
});
|
||||
if (endpointsData.status === 200) {
|
||||
//应该可能会返回“远程”的endpoint,这里只获取“本地”endpoint,条件为URL包含'/var/run/docker.sock'
|
||||
const id = endpointsData.data.find(({ URL }) => URL.includes('/var/run/docker.sock')).Id;
|
||||
setEndpointsId(id)
|
||||
//先判断是否获取了“本地”endpoint
|
||||
if (endpointsData.data.length == 0) { //没有“本地”endpoint
|
||||
//调用添加"本地"环境的接口
|
||||
const addEndpoint = await axios.post('/portainer/api/endpoints', {},
|
||||
{
|
||||
params: {
|
||||
Name: "websoft9-local",
|
||||
EndpointCreationType: 1
|
||||
},
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + jwt.replace(/"/g, '')
|
||||
}
|
||||
}
|
||||
);
|
||||
if (addEndpoint.status === 200) {
|
||||
id = addEndpoint.data?.Id;
|
||||
setEndpointsId(id);
|
||||
}
|
||||
else {
|
||||
console.error('Error:', addEndpoint);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//应该可能会返回“远程”的endpoint,这里只获取“本地”endpoint,条件为URL包含'/var/run/docker.sock'
|
||||
id = endpointsData.data.find(({ URL }) => URL.includes('/var/run/docker.sock')).Id;
|
||||
setEndpointsId(id);
|
||||
}
|
||||
|
||||
//调用接口获取
|
||||
const containersData = await axios.get(`/portainer/api/endpoints/${id}/docker/containers/json`, {
|
||||
headers: {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"files": {
|
||||
"main.css": "./static/css/main.576f2ed4.css",
|
||||
"main.js": "./static/js/main.4932f702.js",
|
||||
"main.js": "./static/js/main.36b105d3.js",
|
||||
"index.html": "./index.html",
|
||||
"main.576f2ed4.css.map": "./static/css/main.576f2ed4.css.map",
|
||||
"main.4932f702.js.map": "./static/js/main.4932f702.js.map"
|
||||
"main.36b105d3.js.map": "./static/js/main.36b105d3.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.576f2ed4.css",
|
||||
"static/js/main.4932f702.js"
|
||||
"static/js/main.36b105d3.js"
|
||||
]
|
||||
}
|
|
@ -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="Portainer"/><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="../base1/cockpit.js"></script><script type="text/javascript" src="../*/po.js"></script><title>Portainer</title><script defer="defer" src="./static/js/main.4932f702.js"></script><link href="./static/css/main.576f2ed4.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></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="Portainer"/><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="../base1/cockpit.js"></script><script type="text/javascript" src="../*/po.js"></script><title>Portainer</title><script defer="defer" src="./static/js/main.36b105d3.js"></script><link href="./static/css/main.576f2ed4.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"menu": {
|
||||
"container": {
|
||||
"label": "Portainer",
|
||||
|
|
File diff suppressed because one or more lines are too long
1
cockpit/portainer/build/static/js/main.36b105d3.js.map
Normal file
1
cockpit/portainer/build/static/js/main.36b105d3.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"menu": {
|
||||
"container": {
|
||||
"label": "Portainer",
|
||||
|
|
|
@ -25,7 +25,7 @@ function App() {
|
|||
password: PORTAINER_PASSWORD
|
||||
});
|
||||
if (authResponse.status === 200) {
|
||||
let jwt = "\"" + authResponse.data.jwt + "\"";
|
||||
jwt = "\"" + authResponse.data.jwt + "\"";
|
||||
setPortainerJWT(jwt);
|
||||
window.localStorage.setItem('portainer\.JWT', jwt); //关键是将通过API登录后获取的jwt,存储到本地localStorage
|
||||
} else {
|
||||
|
@ -37,6 +37,15 @@ function App() {
|
|||
}
|
||||
}
|
||||
else {
|
||||
const response = await axios.get('../myapps/config.json'); //从项目下读取配置文件
|
||||
if (response.status === 200) {
|
||||
let config = response.data.PORTAINER;
|
||||
const { PORTAINER_HOME_PAGE } = config;
|
||||
setPortainerHomePage(PORTAINER_HOME_PAGE);
|
||||
}
|
||||
else {
|
||||
console.log('Error:', response);
|
||||
}
|
||||
setPortainerJWT(jwt);
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -46,12 +55,12 @@ function App() {
|
|||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, []);
|
||||
}, [portainerJWT]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
portainerJWT && portainerHomePage ? (
|
||||
(portainerJWT && portainerHomePage) ? (
|
||||
<div class='myPortainer' key='container'>
|
||||
<iframe title='portainer' src={portainerHomePage} />
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue