diff --git a/changelog.md b/changelog.md index 49016e9..2863a20 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,5 @@ -## Version 0.7.1 -> 0.7.7 +## Version 0.7.1 -> 0.7.8 + - Fix issue where multiple DBs get created at the setup - Add more special characters to be used for password validation - Add configurable default data path for binds - Remove Redirects from home page diff --git a/client/src/api/index.jsx b/client/src/api/index.jsx index 83e05f0..038d672 100644 --- a/client/src/api/index.jsx +++ b/client/src/api/index.jsx @@ -53,62 +53,13 @@ let isOnline = () => { } let newInstall = (req, onProgress) => { - if(req.step == '2') { - const requestOptions = { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(req) - }; - - return fetch('/cosmos/api/newInstall', requestOptions) - .then(response => { - if (!response.ok) { - throw new Error(response.statusText); - } - - // The response body is a ReadableStream. This code reads the stream and passes chunks to the callback. - const reader = response.body.getReader(); - - // Read the stream and pass chunks to the callback as they arrive - return new ReadableStream({ - start(controller) { - function read() { - return reader.read().then(({ done, value }) => { - if (done) { - controller.close(); - return; - } - // Decode the UTF-8 text - let text = new TextDecoder().decode(value); - // Split by lines in case there are multiple lines in one chunk - let lines = text.split('\n'); - for (let line of lines) { - if (line) { - // Call the progress callback - onProgress(line); - } - } - controller.enqueue(value); - return read(); - }); - } - return read(); - } - }); - }).catch((e) => { - alert(e); - }); - } else { - return wrap(fetch('/cosmos/api/newInstall', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(req) - })) - } + return wrap(fetch('/cosmos/api/newInstall', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(req) + })) } let checkHost = (host) => { diff --git a/client/src/pages/home/index.jsx b/client/src/pages/home/index.jsx index 9e74dc3..927accd 100644 --- a/client/src/pages/home/index.jsx +++ b/client/src/pages/home/index.jsx @@ -73,7 +73,7 @@ export const TransparentHeader = () => { const HomePage = () => { const { routeName } = useParams(); - const [serveApps, setServeApps] = useState([]); + const [servApps, setServApps] = useState([]); const [config, setConfig] = useState(null); const [coStatus, setCoStatus] = useState(null); const [containers, setContainers] = useState(null); @@ -105,7 +105,7 @@ const HomePage = () => { const refreshConfig = () => { API.docker.list().then((res) => { - setServeApps(res.data); + setServApps(res.data); }); API.config.get().then((res) => { setConfig(res.data); @@ -166,11 +166,11 @@ const HomePage = () => { - {config && serveApps && routes.map((route) => { + {config && servApps && routes.map((route) => { let skip = route.Mode == "REDIRECT"; if(route.Mode == "SERVAPP") { const containerName = route.Target.split(':')[1].slice(2); - const container = serveApps.find((c) => c.Names.includes('/' + containerName)); + const container = servApps.find((c) => c.Names.includes('/' + containerName)); if(!container || container.State != "running") { skip = true } diff --git a/client/src/pages/servapps/actionBar.jsx b/client/src/pages/servapps/actionBar.jsx index 3de70e1..2d1f320 100644 --- a/client/src/pages/servapps/actionBar.jsx +++ b/client/src/pages/servapps/actionBar.jsx @@ -8,7 +8,7 @@ const GetActions = ({ Id, state, image, - refreshServeApps, + refreshServApps, setIsUpdatingId, updateAvailable }) => { @@ -30,10 +30,10 @@ const GetActions = ({ setIsUpdatingId(Id, true); return API.docker.manageContainer(Id, action).then((res) => { setIsUpdating(false); - refreshServeApps(); + refreshServApps(); }).catch((err) => { setIsUpdating(false); - refreshServeApps(); + refreshServApps(); }); }; @@ -119,7 +119,7 @@ const GetActions = ({ request={pullRequest} title="Updating ServeApp..." OnSuccess={() => { - refreshServeApps(); + refreshServApps(); }} /> diff --git a/client/src/pages/servapps/containers/overview.jsx b/client/src/pages/servapps/containers/overview.jsx index b85d2e4..cbd21e7 100644 --- a/client/src/pages/servapps/containers/overview.jsx +++ b/client/src/pages/servapps/containers/overview.jsx @@ -93,7 +93,7 @@ const ContainerOverview = ({ containerInfo, config, refresh, updatesAvailable, s Id={containerInfo.Name} image={Image} state={State.Status} - refreshServeApps={() => { + refreshServApps={() => { refreshAll() }} setIsUpdatingId={() => { diff --git a/client/src/pages/servapps/index.jsx b/client/src/pages/servapps/index.jsx index 9a9024c..95bb54d 100644 --- a/client/src/pages/servapps/index.jsx +++ b/client/src/pages/servapps/index.jsx @@ -9,7 +9,7 @@ import * as API from '../../api'; import { CheckOutlined, ClockCircleOutlined, DashboardOutlined, DeleteOutlined, DownOutlined, LockOutlined, UpOutlined } from "@ant-design/icons"; import IsLoggedIn from '../../isLoggedIn'; import PrettyTabbedView from '../../components/tabbedView/tabbedView'; -import ServeApps from './servapps'; +import ServApps from './servapps'; import VolumeManagementList from './volumes'; import NetworkManagementList from './networks'; @@ -20,7 +20,7 @@ const ServappsIndex = () => { , + children: , path: 'containers' }, { diff --git a/client/src/pages/servapps/servapps.jsx b/client/src/pages/servapps/servapps.jsx index 20468bc..9978b16 100644 --- a/client/src/pages/servapps/servapps.jsx +++ b/client/src/pages/servapps/servapps.jsx @@ -35,8 +35,8 @@ const noOver = { height: "50px" } -const ServeApps = () => { - const [serveApps, setServeApps] = useState([]); +const ServApps = () => { + const [servApps, setServApps] = useState([]); const [isUpdating, setIsUpdating] = useState({}); const [search, setSearch] = useState(""); const [config, setConfig] = useState(null); @@ -47,9 +47,9 @@ const ServeApps = () => { const [openRestartModal, setOpenRestartModal] = useState(false); const [selfName, setSelfName] = useState(""); - const refreshServeApps = () => { + const refreshServApps = () => { API.docker.list().then((res) => { - setServeApps(res.data); + setServApps(res.data); }); API.config.get().then((res) => { setConfig(res.data); @@ -67,7 +67,7 @@ const ServeApps = () => { } useEffect(() => { - refreshServeApps(); + refreshServApps(); }, []); function updateRoutes(newRoute) { @@ -123,7 +123,7 @@ const ServeApps = () => { { + container={servApps.find((app) => { return app.Names[0].replace('/', '') === (openModal && openModal.Names[0].replace('/', '')); })} config={config} @@ -148,7 +148,7 @@ const ServeApps = () => { }} /> } onClick={() => { - refreshServeApps(); + refreshServApps(); }}>Refresh { startIcon={} >Start ServApp - + @@ -165,7 +165,7 @@ const ServeApps = () => { Update are available for {Object.keys(updatesAvailable).join(', ')} } - {serveApps && serveApps.filter(app => search.length < 2 || app.Names[0].toLowerCase().includes(search.toLowerCase())).map((app) => { + {servApps && servApps.filter(app => search.length < 2 || app.Names[0].toLowerCase().includes(search.toLowerCase())).map((app) => { return }> @@ -202,7 +202,7 @@ const ServeApps = () => { image={app.Image} state={app.State} setIsUpdatingId={setIsUpdatingId} - refreshServeApps={refreshServeApps} + refreshServApps={refreshServApps} updateAvailable={updatesAvailable && updatesAvailable[app.Names[0]]} /> @@ -247,11 +247,11 @@ const ServeApps = () => { API.docker.secure(name, e.target.checked).then(() => { setTimeout(() => { setIsUpdatingId(name, false); - refreshServeApps(); + refreshServApps(); }, 3000); }).catch(() => { setIsUpdatingId(name, false); - refreshServeApps(); + refreshServApps(); }) }} /> Force Secure Network @@ -267,11 +267,11 @@ const ServeApps = () => { API.docker.autoUpdate(name, e.target.checked).then(() => { setTimeout(() => { setIsUpdatingId(name, false); - refreshServeApps(); + refreshServApps(); }, 3000); }).catch(() => { setIsUpdatingId(name, false); - refreshServeApps(); + refreshServApps(); }) }} /> Auto Update Container @@ -321,4 +321,4 @@ const ServeApps = () => { } -export default ServeApps; +export default ServApps; diff --git a/client/src/routes/MainRoutes.jsx b/client/src/routes/MainRoutes.jsx index cfbb876..71a450a 100644 --- a/client/src/routes/MainRoutes.jsx +++ b/client/src/routes/MainRoutes.jsx @@ -6,7 +6,7 @@ import MainLayout from '../layout/MainLayout'; import UserManagement from '../pages/config/users/usermanagement'; import ConfigManagement from '../pages/config/users/configman'; import ProxyManagement from '../pages/config/users/proxyman'; -import ServeAppsIndex from '../pages/servapps/'; +import ServAppsIndex from '../pages/servapps/'; import { Navigate } from 'react-router'; import RouteConfigPage from '../pages/config/routeConfigPage'; import logo from '../assets/images/icons/cosmos.png'; @@ -57,7 +57,7 @@ const MainRoutes = { }, { path: '/cosmos-ui/servapps', - element: + element: }, { path: '/cosmos-ui/config-users', diff --git a/package.json b/package.json index bea860f..147c146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.7.7", + "version": "0.7.8", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/newInstall.go b/src/newInstall.go index 58dc872..5d7b450 100644 --- a/src/newInstall.go +++ b/src/newInstall.go @@ -121,7 +121,6 @@ func NewInstallRoute(w http.ResponseWriter, req *http.Request) { utils.SaveConfigTofile(newConfig) utils.LoadBaseMainConfig(newConfig) } else if (request.Step == "4") { - adminObj := AdminJSON{ Nickname: request.Nickname, Password: request.Password,