Skip to content

Commit

Permalink
πŸ“ resolve merge conflict and standardize page names
Browse files Browse the repository at this point in the history
πŸ“ resolve merge conflict and standardize page names
  • Loading branch information
KaradzaJuraj committed Apr 4, 2024
2 parents c59be3f + 6f906e8 commit a05ff0c
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 139 deletions.
13 changes: 9 additions & 4 deletions cyclops-ui/src/components/k8s-resources/ConfigMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,21 @@ const ConfigMap = ({ name, namespace }: Props) => {
setConfigMap(res.data);
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
}
Expand Down
43 changes: 30 additions & 13 deletions cyclops-ui/src/components/k8s-resources/Deployment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,21 @@ const Deployment = ({ name, namespace }: Props) => {
setDeployment(res.data);
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
}
Expand Down Expand Up @@ -185,16 +190,21 @@ const Deployment = ({ name, namespace }: Props) => {
}
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
};
Expand Down Expand Up @@ -291,17 +301,24 @@ const Deployment = ({ name, namespace }: Props) => {
}
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message:
error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__
.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__
.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
setLogsModal({
Expand All @@ -327,7 +344,7 @@ const Deployment = ({ name, namespace }: Props) => {
open={logsModal.on}
onOk={handleCancelLogs}
onCancel={handleCancelLogs}
cancelButtonProps={{ style: { display: 'none' } }}
cancelButtonProps={{ style: { display: "none" } }}
width={"60%"}
>
<Tabs items={getTabItems()} onChange={onLogsTabsChange} />
Expand Down
41 changes: 28 additions & 13 deletions cyclops-ui/src/components/k8s-resources/Pod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,21 @@ const Pod = ({ name, namespace }: Props) => {
setPod(res.data);
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
}
Expand Down Expand Up @@ -206,16 +211,21 @@ const Pod = ({ name, namespace }: Props) => {
}
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
};
Expand Down Expand Up @@ -292,16 +302,21 @@ const Pod = ({ name, namespace }: Props) => {
}
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
setLogsModal({
Expand All @@ -321,7 +336,7 @@ const Pod = ({ name, namespace }: Props) => {
open={logsModal.on}
onOk={handleCancelLogs}
onCancel={handleCancelLogs}
cancelButtonProps={{ style: { display: 'none' } }}
cancelButtonProps={{ style: { display: "none" } }}
width={"60%"}
>
<Tabs items={getTabItems()} onChange={onLogsTabsChange} />
Expand Down
13 changes: 9 additions & 4 deletions cyclops-ui/src/components/k8s-resources/Service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,21 @@ const Service = ({ name, namespace }: Props) => {
setService(res.data);
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
}
Expand Down
43 changes: 30 additions & 13 deletions cyclops-ui/src/components/k8s-resources/StatefulSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,21 @@ const StatefulSet = ({ name, namespace }: Props) => {
setStatefulSet(res.data);
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
}
Expand Down Expand Up @@ -185,16 +190,21 @@ const StatefulSet = ({ name, namespace }: Props) => {
}
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
};
Expand Down Expand Up @@ -291,17 +301,24 @@ const StatefulSet = ({ name, namespace }: Props) => {
}
})
.catch((error) => {
console.log(error);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message:
error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__
.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__
.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError(error.response.data);
}
});
setLogsModal({
Expand All @@ -327,7 +344,7 @@ const StatefulSet = ({ name, namespace }: Props) => {
open={logsModal.on}
onOk={handleCancelLogs}
onCancel={handleCancelLogs}
cancelButtonProps={{ style: { display: 'none' } }}
cancelButtonProps={{ style: { display: "none" } }}
width={"60%"}
>
<Tabs items={getTabItems()} onChange={onLogsTabsChange} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,33 +193,39 @@ const EditModule = () => {
})
.catch((error) => {
setLoadTemplate(true);
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: String(error),
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: error.message,
description: error.response.data,
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
}
});
})
.catch((error) => {
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: String(error),
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: error.message,
description: error.response.data,
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
}
});
Expand Down Expand Up @@ -307,17 +313,20 @@ const EditModule = () => {
window.location.href = "/modules/" + moduleName;
})
.catch((error) => {
if (error.response === undefined) {
if (error?.response?.data) {
setError({
message: String(error),
message: error.response.data.message || String(error),
description:
error.response.data.description ||
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
} else {
setError({
message: error.message,
description: error.response.data,
message: String(error),
description:
"Check if Cyclops backend is available on: " +
window.__RUNTIME_CONFIG__.REACT_APP_CYCLOPS_CTRL_HOST,
});
}
});
Expand Down
Loading

0 comments on commit a05ff0c

Please sign in to comment.