mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-06 23:13:17 +00:00
Put in more env variables and fallback to localhost if BACKEND_URL and BACKEND_PORT is not found
Fixed imports for react imports for useMemo, useEffect etc from hosts and HostDetail files
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { AlertCircle, CheckCircle, Shield, UserPlus } from "lucide-react";
|
import { AlertCircle, CheckCircle, Shield, UserPlus } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useId, useState } from "react";
|
||||||
import { useAuth } from "../contexts/AuthContext";
|
import { useAuth } from "../contexts/AuthContext";
|
||||||
|
|
||||||
const FirstTimeAdminSetup = () => {
|
const FirstTimeAdminSetup = () => {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
Wifi,
|
Wifi,
|
||||||
X,
|
X,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useId, useState } from "react";
|
import { useEffect, useId, useState } from "react";
|
||||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||||
import InlineEdit from "../components/InlineEdit";
|
import InlineEdit from "../components/InlineEdit";
|
||||||
import {
|
import {
|
||||||
@@ -70,7 +70,7 @@ const HostDetail = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Auto-show credentials modal for new/pending hosts
|
// Auto-show credentials modal for new/pending hosts
|
||||||
React.useEffect(() => {
|
useEffect(() => {
|
||||||
if (host && host.status === "pending") {
|
if (host && host.status === "pending") {
|
||||||
setShowCredentialsModal(true);
|
setShowCredentialsModal(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
Users,
|
Users,
|
||||||
X,
|
X,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useEffect, useId, useState } from "react";
|
import { useEffect, useId, useMemo, useState } from "react";
|
||||||
import { Link, useNavigate, useSearchParams } from "react-router-dom";
|
import { Link, useNavigate, useSearchParams } from "react-router-dom";
|
||||||
import InlineEdit from "../components/InlineEdit";
|
import InlineEdit from "../components/InlineEdit";
|
||||||
import InlineGroupEdit from "../components/InlineGroupEdit";
|
import InlineGroupEdit from "../components/InlineGroupEdit";
|
||||||
@@ -510,7 +510,7 @@ const Hosts = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Table filtering and sorting logic
|
// Table filtering and sorting logic
|
||||||
const filteredAndSortedHosts = React.useMemo(() => {
|
const filteredAndSortedHosts = useMemo(() => {
|
||||||
if (!hosts) return [];
|
if (!hosts) return [];
|
||||||
|
|
||||||
const filtered = hosts.filter((host) => {
|
const filtered = hosts.filter((host) => {
|
||||||
@@ -629,7 +629,7 @@ const Hosts = () => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Group hosts by selected field
|
// Group hosts by selected field
|
||||||
const groupedHosts = React.useMemo(() => {
|
const groupedHosts = useMemo(() => {
|
||||||
if (groupBy === "none") {
|
if (groupBy === "none") {
|
||||||
return { "All Hosts": filteredAndSortedHosts };
|
return { "All Hosts": filteredAndSortedHosts };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
User,
|
User,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useId, useState } from "react";
|
||||||
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useAuth } from "../contexts/AuthContext";
|
import { useAuth } from "../contexts/AuthContext";
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
User,
|
User,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useId, useState } from "react";
|
||||||
|
|
||||||
import { useAuth } from "../contexts/AuthContext";
|
import { useAuth } from "../contexts/AuthContext";
|
||||||
import { useTheme } from "../contexts/ThemeContext";
|
import { useTheme } from "../contexts/ThemeContext";
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
Users,
|
Users,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useId, useState } from "react";
|
||||||
|
|
||||||
import { Link, useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import { repositoryAPI } from "../utils/api";
|
import { repositoryAPI } from "../utils/api";
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
X,
|
X,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useId, useState } from "react";
|
||||||
import UpgradeNotificationIcon from "../components/UpgradeNotificationIcon";
|
import UpgradeNotificationIcon from "../components/UpgradeNotificationIcon";
|
||||||
import { useUpdateNotification } from "../contexts/UpdateNotificationContext";
|
import { useUpdateNotification } from "../contexts/UpdateNotificationContext";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default defineConfig({
|
|||||||
allowedHosts: true, // Allow all hosts in development
|
allowedHosts: true, // Allow all hosts in development
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
target: `http://${process.env.BACKEND_HOST}:${process.env.BACKEND_PORT}`,
|
target: `http://${process.env.BACKEND_HOST || 'localhost'}:${process.env.BACKEND_PORT || '3001'}`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false,
|
secure: false,
|
||||||
configure:
|
configure:
|
||||||
|
|||||||
Reference in New Issue
Block a user