Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Janaka-Steph committed Aug 31, 2023
1 parent 1c9d6c9 commit 6d214a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/shared/api/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const api = () => {
if (isProxyEnabled() && hasDnsRecord) {
Object.assign(headers, { Host: "premd.docker.localhost" });
}
console.log("headers", headers);
console.log("hasDnsRecord", hasDnsRecord);
console.log("isProxyEnabled", isProxyEnabled());
return axios.create({
baseURL: useSettingStore.getState().backendUrl,
headers,
Expand Down
11 changes: 10 additions & 1 deletion src/shared/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { invoke } from "@tauri-apps/api/tauri";
import axios from "axios";
import type { Option, Service, ServiceStatus } from "modules/service/types";
import type { ServiceInfoValue } from "modules/service-detail/types";
import type { ControlProps, CSSObjectWithLabel } from "react-select";

import api from "../api/v1";
import useSettingStore from "../store/setting";

export const SERVICE_CHECK_REFETCH_INTERVAL = 10000;

Expand Down Expand Up @@ -35,7 +37,14 @@ export const runDockerContainer = async () => {

export const checkHasDnsRecord = async (): Promise<boolean> => {
try {
const existingDNS = await api().get(`dns/existing`);
const existingDNS = await axios.get(`dns/existing`, {
baseURL: useSettingStore.getState().backendUrl,
headers: {
"Content-Type": "application/json",
Host: "premd.docker.localhost",
},
});
console.log("existingDNS", existingDNS);
return existingDNS.data && existingDNS.status === 200;
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 6d214a9

Please sign in to comment.