Skip to content

Commit bfa4b40

Browse files
committed
gg
1 parent 9644503 commit bfa4b40

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

server/controllers/grafanaApiController.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ const grafanaApiController: GrafanaApiController = {
5252
const { key, dashboard }: { key: string; dashboard: string } = req.body;
5353
try {
5454
const response = await fetch(
55-
`http://localhost:3000/api/search?query=${encodeURIComponent(dashboard)}`,
55+
`http://host.docker.internal:3000/api/search?query=${encodeURIComponent(
56+
dashboard
57+
)}`,
5658
{
5759
method: 'GET',
5860
headers: {

src/components/Images/Images.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ import globalStyles from '../global.module.scss';
1313
**/
1414

1515
const Images = ({ imagesList: initialImagesList }): JSX.Element => {
16-
//const imagesList = useAppSelector((state) => state.images.imagesList);
16+
// const imagesList = useAppSelector((state) => state.images.imagesList);
1717
const reduxImagesList = useAppSelector((state) => state.images.imagesList);
1818
const imagesList = initialImagesList ? [initialImagesList] : reduxImagesList;
19-
const [repo, setRepo] = useState("");
19+
const [repo, setRepo] = useState('');
2020
const dispatch = useAppDispatch();
2121
const { runIm, removeIm, pullImage } = useHelper();
2222

2323
const handleClick = () => {
2424
if (!repo) {
2525
dispatch(
2626
createAlert(
27-
"Please enter an image name prior to attempting to pull.",
27+
'Please enter an image name prior to attempting to pull.',
2828
5,
29-
"error"
29+
'error'
3030
)
3131
);
3232
return;
3333
} else {
3434
let existingRepo = false;
35-
if (repo.includes(":")) {
36-
const splitRepo = repo.split(":");
35+
if (repo.includes(':')) {
36+
const splitRepo = repo.split(':');
3737
imagesList.map((el) => {
3838
if (el.reps === splitRepo[0] && el.tag === splitRepo[1]) {
3939
existingRepo = true;
@@ -45,9 +45,9 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
4545
if (existingRepo === true) {
4646
dispatch(
4747
createAlert(
48-
"This image already exists within your Docketeer image collection.",
48+
'This image already exists within your Docketeer image collection.',
4949
5,
50-
"error"
50+
'error'
5151
)
5252
);
5353
return;
@@ -57,14 +57,14 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
5757
`Are you sure you want to pull ${repo}?`,
5858
() => {
5959
pullImage(repo);
60-
dispatch(createAlert(`Pulling ${repo}...`, 5, "success"));
60+
dispatch(createAlert(`Pulling ${repo}...`, 5, 'success'));
6161
},
6262
() => {
6363
dispatch(
6464
createAlert(
6565
`The request to pull ${repo} has been cancelled.`,
6666
5,
67-
"warning"
67+
'warning'
6868
)
6969
);
7070
}
@@ -74,7 +74,7 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
7474
}
7575
} else {
7676
imagesList.map((el) => {
77-
if (el.reps === repo && el.tag === "latest") {
77+
if (el.reps === repo && el.tag === 'latest') {
7878
existingRepo = true;
7979
return;
8080
}
@@ -84,9 +84,9 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
8484
if (existingRepo === true) {
8585
dispatch(
8686
createAlert(
87-
"This image already exists within your Docketeer image collection.",
87+
'This image already exists within your Docketeer image collection.',
8888
5,
89-
"error"
89+
'error'
9090
)
9191
);
9292
return;
@@ -96,14 +96,14 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
9696
`Are you sure you want to pull ${repo}?`,
9797
() => {
9898
pullImage(repo);
99-
dispatch(createAlert(`Pulling ${repo}...`, 5, "success"));
99+
dispatch(createAlert(`Pulling ${repo}...`, 5, 'success'));
100100
},
101101
() => {
102102
dispatch(
103103
createAlert(
104104
`The request to pull ${repo} has been cancelled.`,
105105
5,
106-
"warning"
106+
'warning'
107107
)
108108
);
109109
}
@@ -117,7 +117,7 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
117117

118118
const handleError = (e: SyntheticEvent<HTMLImageElement, Event>) => {
119119
e.currentTarget.src =
120-
"https://d36jcksde1wxzq.cloudfront.net/54e48877dab8df8f92cd.png";
120+
'https://d36jcksde1wxzq.cloudfront.net/54e48877dab8df8f92cd.png';
121121
};
122122

123123
const runImage = (image: ImageObj) => {
@@ -127,14 +127,14 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
127127
`Are you sure you want to run ${image.reps}?`,
128128
() => {
129129
runIm(image);
130-
dispatch(createAlert(`Running ${image.reps}...`, 5, "success"));
130+
dispatch(createAlert(`Running ${image.reps}...`, 5, 'success'));
131131
},
132132
() => {
133133
dispatch(
134134
createAlert(
135135
`The request to run ${image.reps} has been cancelled.`,
136136
5,
137-
"warning"
137+
'warning'
138138
)
139139
);
140140
}
@@ -150,14 +150,14 @@ const Images = ({ imagesList: initialImagesList }): JSX.Element => {
150150
`Are you sure you want to remove ${image.reps}?`,
151151
() => {
152152
removeIm(image.imgid);
153-
dispatch(createAlert(`Removing ${image.reps}...`, 5, "success"));
153+
dispatch(createAlert(`Removing ${image.reps}...`, 5, 'success'));
154154
},
155155
() => {
156156
dispatch(
157157
createAlert(
158158
`The request to remove ${image.reps} has been cancelled.`,
159159
5,
160-
"warning"
160+
'warning'
161161
)
162162
);
163163
}

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default defineConfig({
3333
},
3434
},
3535
server: {
36-
port: 4001,
36+
port: 4000,
3737
host: true,
3838
proxy: {
3939
'/api': {

0 commit comments

Comments
 (0)