Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslint warnings #394

Merged
merged 6 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: ui tests
on:
pull_request:
paths:
- 'cyclops-ui/**'
- "cyclops-ui/**"
push:
paths:
- 'cyclops-ui/**'
- "cyclops-ui/**"
branches:
- main

Expand All @@ -27,8 +27,6 @@ jobs:
cd ${{ github.workspace }}/cyclops-ui
yarn test
- name: Build
env:
CI: false
run: |
cd ${{ github.workspace }}/cyclops-ui
yarn build
1 change: 1 addition & 0 deletions cyclops-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.0",
"@types/react-gauge-chart": "^0.4.3",
"@types/react-highlight-words": "^0.16.7",
"husky": "^9.0.11",
Expand Down
Binary file removed cyclops-ui/src/.DS_Store
Binary file not shown.
Binary file removed cyclops-ui/src/components/.DS_Store
Binary file not shown.
40 changes: 20 additions & 20 deletions cyclops-ui/src/components/k8s-resources/ConfigMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ const ConfigMap = ({ name, namespace }: Props) => {
description: "",
});

function fetchConfigMap() {
axios
.get(`/api/resources`, {
params: {
group: ``,
version: `v1`,
kind: `ConfigMap`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setConfigMap(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

useEffect(() => {
function fetchConfigMap() {
axios
.get(`/api/resources`, {
params: {
group: ``,
version: `v1`,
kind: `ConfigMap`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setConfigMap(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

fetchConfigMap();
const interval = setInterval(() => fetchConfigMap(), 15000);
return () => {
clearInterval(interval);
};
}, []);
}, [name, namespace]);

const configMapData = (configMap: any) => {
if (configMap.data) {
Expand Down
40 changes: 20 additions & 20 deletions cyclops-ui/src/components/k8s-resources/CronJob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ const CronJob = ({ name, namespace }: Props) => {
description: "",
});

function fetchCronJob() {
axios
.get(`/api/resources`, {
params: {
group: `batch`,
version: `v1`,
kind: `CronJob`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setCronjob(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

useEffect(() => {
function fetchCronJob() {
axios
.get(`/api/resources`, {
params: {
group: `batch`,
version: `v1`,
kind: `CronJob`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setCronjob(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

fetchCronJob();
const interval = setInterval(() => fetchCronJob(), 15000);
return () => {
clearInterval(interval);
};
}, []);
}, [name, namespace]);

return (
<div>
Expand Down
40 changes: 20 additions & 20 deletions cyclops-ui/src/components/k8s-resources/DaemonSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ const DaemonSet = ({ name, namespace }: Props) => {
description: "",
});

function fetchDaemonSet() {
axios
.get(`/api/resources`, {
params: {
group: `apps`,
version: `v1`,
kind: `DaemonSet`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setDaemonSet(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

useEffect(() => {
function fetchDaemonSet() {
axios
.get(`/api/resources`, {
params: {
group: `apps`,
version: `v1`,
kind: `DaemonSet`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setDaemonSet(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

fetchDaemonSet();
const interval = setInterval(() => fetchDaemonSet(), 15000);
return () => {
clearInterval(interval);
};
}, []);
}, [name, namespace]);

return (
<div>
Expand Down
40 changes: 20 additions & 20 deletions cyclops-ui/src/components/k8s-resources/Deployment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ const Deployment = ({ name, namespace }: Props) => {
description: "",
});

function fetchDeployment() {
axios
.get(`/api/resources`, {
params: {
group: `apps`,
version: `v1`,
kind: `Deployment`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setDeployment(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

useEffect(() => {
function fetchDeployment() {
axios
.get(`/api/resources`, {
params: {
group: `apps`,
version: `v1`,
kind: `Deployment`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setDeployment(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

fetchDeployment();
const interval = setInterval(() => fetchDeployment(), 15000);
return () => {
clearInterval(interval);
};
}, []);
}, [name, namespace]);

return (
<div>
Expand Down
40 changes: 20 additions & 20 deletions cyclops-ui/src/components/k8s-resources/Job.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ const Job = ({ name, namespace }: Props) => {
description: "",
});

function fetchJob() {
axios
.get(`/api/resources`, {
params: {
group: `batch`,
version: `v1`,
kind: `Job`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setJob(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

useEffect(() => {
function fetchJob() {
axios
.get(`/api/resources`, {
params: {
group: `batch`,
version: `v1`,
kind: `Job`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setJob(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

fetchJob();
const interval = setInterval(() => fetchJob(), 15000);
return () => {
clearInterval(interval);
};
}, []);
}, [name, namespace]);

return (
<div>
Expand Down
40 changes: 20 additions & 20 deletions cyclops-ui/src/components/k8s-resources/Pod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,32 @@ const Pod = ({ name, namespace }: Props) => {
});
const [logs, setLogs] = useState("");

function fetchPod() {
axios
.get(`/api/resources`, {
params: {
group: ``,
version: `v1`,
kind: `Pod`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setPod(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

useEffect(() => {
function fetchPod() {
axios
.get(`/api/resources`, {
params: {
group: ``,
version: `v1`,
kind: `Pod`,
name: name,
namespace: namespace,
},
})
.then((res) => {
setPod(res.data);
})
.catch((error) => {
setError(mapResponseError(error));
});
}

fetchPod();
const interval = setInterval(() => fetchPod(), 15000);
return () => {
clearInterval(interval);
};
}, []);
}, [name, namespace]);

const handleCancelLogs = () => {
setLogsModal({
Expand Down
2 changes: 1 addition & 1 deletion cyclops-ui/src/components/k8s-resources/Secret.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";
import React, { useEffect, useState } from "react";
import { mapResponseError } from "../../utils/api/errors";
import { Alert, Descriptions, Divider, Table } from "antd";
import { Alert, Descriptions, Divider } from "antd";

interface Props {
name: string;
Expand Down
Loading
Loading