Added Logout Option
This commit is contained in:
parent
b0d296e007
commit
85a178e825
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
[Interface]
|
[Interface]
|
||||||
PrivateKey = GKXyqCZfS9r2yWzqHJ43L24dnW13VJNilER9jwkyREE=
|
PrivateKey = OPasvZsdAdU46BJLXOLMqy4BgZq/UvKtjTRpTTVSGX8=
|
||||||
Address = 10.0.0.95/32
|
Address = 10.0.0.96/32
|
||||||
DNS = 1.1.1.1
|
DNS = 1.1.1.1
|
||||||
|
|
||||||
[Peer]
|
[Peer]
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const httpsAgent = new https.Agent({
|
||||||
console.log('Base_URL$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$' ,Base_URL)
|
console.log('Base_URL$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$' ,Base_URL)
|
||||||
|
|
||||||
const api: AxiosInstance = axios.create({
|
const api: AxiosInstance = axios.create({
|
||||||
// baseURL: 'https://quality-friendly-goldfish.ngrok-free.app/api/v1/va', // 🔁 your backend
|
// baseURL: 'https://portal-sf.docva.com/api/v1/va', // 🔁 your backend
|
||||||
baseURL: `${Base_URL}/api/v1/va`,
|
baseURL: `${Base_URL}/api/v1/va`,
|
||||||
httpsAgent
|
httpsAgent
|
||||||
// timeout: 10000,
|
// timeout: 10000,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// let CURRENT_BASE_URL = "https://quality-friendly-goldfish.ngrok-free.app/api/v1/va";
|
// let CURRENT_BASE_URL = "https://portal-sf.docva.com/api/v1/va";
|
||||||
let CURRENT_BASE_URL = "https://quality-friendly-goldfish.ngrok-free.app";
|
let CURRENT_BASE_URL = "https://portal-sf.docva.com";
|
||||||
|
|
||||||
export const getBaseURL = () => CURRENT_BASE_URL;
|
export const getBaseURL = () => CURRENT_BASE_URL;
|
||||||
export const setBaseURL = (url: string) => {
|
export const setBaseURL = (url: string) => {
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,12 @@ app.on("ready", async () => {
|
||||||
// HANDLE CLOSE EVENTS
|
// HANDLE CLOSE EVENTS
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// handleCloseEvents(win);
|
// handleCloseEvents(win);
|
||||||
|
mainWindow.on("close", () => {
|
||||||
|
if(mainWindow !== null) {
|
||||||
|
mainWindow.webContents.executeJavaScript(`window.__allowClose__ = true`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -197,9 +203,6 @@ app.on('browser-window-focus', () => {
|
||||||
// globalShortcut.unregisterAll();
|
// globalShortcut.unregisterAll();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
app.on("window-all-closed", () => {
|
|
||||||
app.quit();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------
|
// ---------------------------
|
||||||
|
|
|
||||||
|
|
@ -592,7 +592,7 @@ const DashboardLayout = () => {
|
||||||
if (!selectedProject?.projectId) return
|
if (!selectedProject?.projectId) return
|
||||||
|
|
||||||
console.log(selectedProject?.projectId, "SelectedProject ID")
|
console.log(selectedProject?.projectId, "SelectedProject ID")
|
||||||
socketRef.current = io("https://quality-friendly-goldfish.ngrok-free.app", {
|
socketRef.current = io("https://portal-sf.docva.com", {
|
||||||
transports: ["websocket"],
|
transports: ["websocket"],
|
||||||
secure: true,
|
secure: true,
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,34 @@ import { Provider } from "react-redux";
|
||||||
import { store } from "./store";
|
import { store } from "./store";
|
||||||
import { ToastProvider } from './helper/ToastContext';
|
import { ToastProvider } from './helper/ToastContext';
|
||||||
|
|
||||||
// renderer only
|
declare global {
|
||||||
// window.addEventListener("online", (e) => {
|
interface Window {
|
||||||
// console.log("Network online (ignored)");
|
__allowClose__: boolean;
|
||||||
// e.preventDefault();
|
}
|
||||||
// });
|
}
|
||||||
|
|
||||||
// window.addEventListener("offline", (e) => {
|
|
||||||
// console.log("Network offline (ignored)");
|
// renderer only
|
||||||
// e.preventDefault();
|
window.addEventListener("online", (e) => {
|
||||||
// });
|
console.log("Network online (ignored)");
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener("offline", (e) => {
|
||||||
|
console.log("Network offline (ignored)");
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
// Extra safety
|
// Extra safety
|
||||||
window.onbeforeunload = () => false;
|
window.__allowClose__ = false;
|
||||||
|
|
||||||
|
window.addEventListener("beforeunload", (e) => {
|
||||||
|
if (!window.__allowClose__) {
|
||||||
|
e.returnValue = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ interface Props {
|
||||||
const VpnGuard: React.FC<Props> = ({ children }) => {
|
const VpnGuard: React.FC<Props> = ({ children }) => {
|
||||||
|
|
||||||
const VPN_API = "http://10.0.0.1:3000";
|
const VPN_API = "http://10.0.0.1:3000";
|
||||||
const DEFAULT_API = "https://quality-friendly-goldfish.ngrok-free.app"
|
const DEFAULT_API = "https://portal-sf.docva.com"
|
||||||
|
|
||||||
const [checking, setChecking] = useState(true);
|
const [checking, setChecking] = useState(true);
|
||||||
const [vpnConnected, setVpnConnected] = useState(true);
|
const [vpnConnected, setVpnConnected] = useState(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue