diff --git a/client/src/api/index.jsx b/client/src/api/index.jsx
index 11a0a26..54f47f7 100644
--- a/client/src/api/index.jsx
+++ b/client/src/api/index.jsx
@@ -42,14 +42,63 @@ let isOnline = () => {
});
}
-let newInstall = (req) => {
- return wrap(fetch('/cosmos/api/newInstall', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(req)
- }))
+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)
+ }))
+ }
}
const isDemo = import.meta.env.MODE === 'demo';
diff --git a/client/src/components/containers.jsx b/client/src/components/containers.jsx
new file mode 100644
index 0000000..0554570
--- /dev/null
+++ b/client/src/components/containers.jsx
@@ -0,0 +1,9 @@
+import { WarningFilled } from "@ant-design/icons";
+import { Tooltip } from "@mui/material";
+
+export const ContainerNetworkWarning = ({container}) => (
+ container.HostConfig.NetworkMode != "bridge" && container.HostConfig.NetworkMode != "default" &&
+