change ports
This commit is contained in:
@@ -245,7 +245,7 @@ air
|
|||||||
cd frontend && npm run dev
|
cd frontend && npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Frontend dev server runs on `:5173` and proxies API calls to `:8081`.
|
Frontend dev server runs on `:5175` and proxies API calls to `:8085`.
|
||||||
|
|
||||||
### Production Build
|
### Production Build
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import ChangePasswordModal from './components/ChangePasswordModal'
|
|||||||
import SettingsModal from './components/SettingsModal'
|
import SettingsModal from './components/SettingsModal'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef, useCallback } from 'react'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import LazyMedia from './LazyMedia'
|
import LazyMedia from './LazyMedia'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
const PAGE_SIZE = 50
|
const PAGE_SIZE = 50
|
||||||
|
|
||||||
function Activity({ startDate, endDate }) {
|
function Activity({ startDate, endDate }) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect, useRef, useCallback } from 'react'
|
import { useState, useEffect, useRef, useCallback } from 'react'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
const PAGE_SIZE = 50
|
const PAGE_SIZE = 50
|
||||||
|
|
||||||
function Calls({ startDate, endDate }) {
|
function Calls({ startDate, endDate }) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import axios from 'axios'
|
|||||||
import VCardPreview from './VCardPreview'
|
import VCardPreview from './VCardPreview'
|
||||||
import './LazyMedia.css'
|
import './LazyMedia.css'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function LazyMedia({ messageId, mediaType, className, alt = "MMS attachment" }) {
|
function LazyMedia({ messageId, mediaType, className, alt = "MMS attachment" }) {
|
||||||
const [src, setSrc] = useState(null)
|
const [src, setSrc] = useState(null)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from 'react'
|
|||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
import './MediaCarousel.css'
|
import './MediaCarousel.css'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function MediaCarousel({ mediaItems, initialIndex, onClose, transcodeVideos = new Set() }) {
|
function MediaCarousel({ mediaItems, initialIndex, onClose, transcodeVideos = new Set() }) {
|
||||||
const [currentIndex, setCurrentIndex] = useState(initialIndex)
|
const [currentIndex, setCurrentIndex] = useState(initialIndex)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import axios from 'axios'
|
|||||||
import MediaCarousel from './MediaCarousel'
|
import MediaCarousel from './MediaCarousel'
|
||||||
import './MediaGrid.css'
|
import './MediaGrid.css'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function MediaGrid({ conversation, startDate, endDate }) {
|
function MediaGrid({ conversation, startDate, endDate }) {
|
||||||
const [mediaItems, setMediaItems] = useState([])
|
const [mediaItems, setMediaItems] = useState([])
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { format } from 'date-fns'
|
|||||||
import LazyMedia from './LazyMedia'
|
import LazyMedia from './LazyMedia'
|
||||||
import MediaGrid from './MediaGrid'
|
import MediaGrid from './MediaGrid'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function MessageThread({ conversation, startDate, endDate }) {
|
function MessageThread({ conversation, startDate, endDate }) {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import axios from 'axios'
|
|||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
import './PrintView.css'
|
import './PrintView.css'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function PrintView() {
|
function PrintView() {
|
||||||
const { address } = useParams()
|
const { address } = useParams()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useEffect, useRef } from 'react'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function Search({ searchQuery, setSearchQuery, results, setResults, loading, setLoading, searched, setSearched, scrollPosition, setScrollPosition }) {
|
function Search({ searchQuery, setSearchQuery, results, setResults, loading, setLoading, searched, setSearched, scrollPosition, setScrollPosition }) {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function SettingsModal({ show, onClose, onSettingsUpdated }) {
|
function SettingsModal({ show, onClose, onSettingsUpdated }) {
|
||||||
const [settings, setSettings] = useState({
|
const [settings, setSettings] = useState({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
PieChart, Pie, Cell, LineChart, Line, Legend
|
PieChart, Pie, Cell, LineChart, Line, Legend
|
||||||
} from 'recharts'
|
} from 'recharts'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
// Color palette
|
// Color palette
|
||||||
const COLORS = ['#0d6efd', '#198754', '#ffc107', '#dc3545', '#6c757d', '#0dcaf0', '#6610f2', '#d63384']
|
const COLORS = ['#0d6efd', '#198754', '#ffc107', '#dc3545', '#6c757d', '#0dcaf0', '#6610f2', '#d63384']
|
||||||
@@ -166,23 +166,25 @@ function Summary({ startDate, endDate }) {
|
|||||||
<div className="card-header">Sent vs Received</div>
|
<div className="card-header">Sent vs Received</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
{messageTypeData.length > 0 ? (
|
{messageTypeData.length > 0 ? (
|
||||||
<ResponsiveContainer width="100%" height={200}>
|
<ResponsiveContainer width="100%" height={240}>
|
||||||
<PieChart>
|
<PieChart>
|
||||||
<Pie
|
<Pie
|
||||||
data={messageTypeData}
|
data={messageTypeData}
|
||||||
cx="50%"
|
cx="50%"
|
||||||
cy="50%"
|
cy="45%"
|
||||||
innerRadius={40}
|
innerRadius={40}
|
||||||
outerRadius={80}
|
outerRadius={70}
|
||||||
paddingAngle={5}
|
paddingAngle={5}
|
||||||
dataKey="value"
|
dataKey="value"
|
||||||
label={({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`}
|
label={({ percent }) => `${(percent * 100).toFixed(0)}%`}
|
||||||
|
labelLine={true}
|
||||||
>
|
>
|
||||||
{messageTypeData.map((entry, index) => (
|
{messageTypeData.map((entry, index) => (
|
||||||
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
||||||
))}
|
))}
|
||||||
</Pie>
|
</Pie>
|
||||||
<Tooltip />
|
<Tooltip formatter={(value, name) => [value.toLocaleString(), name]} />
|
||||||
|
<Legend />
|
||||||
</PieChart>
|
</PieChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState } from 'react'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Modal, Button, Form, Alert, Spinner, ProgressBar } from 'react-bootstrap'
|
import { Modal, Button, Form, Alert, Spinner, ProgressBar } from 'react-bootstrap'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
function Upload({ onClose, onSuccess }) {
|
function Upload({ onClose, onSuccess }) {
|
||||||
const [files, setFiles] = useState([])
|
const [files, setFiles] = useState([])
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createContext, useContext, useState, useEffect } from 'react'
|
import { createContext, useContext, useState, useEffect } from 'react'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8081/api'
|
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8085/api'
|
||||||
|
|
||||||
const AuthContext = createContext(null)
|
const AuthContext = createContext(null)
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,7 @@ import react from '@vitejs/plugin-react'
|
|||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
server: {
|
||||||
|
port: 5175,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ import (
|
|||||||
func CustomCORSMiddleware() echo.MiddlewareFunc {
|
func CustomCORSMiddleware() echo.MiddlewareFunc {
|
||||||
allowedOrigins := map[string]bool{
|
allowedOrigins := map[string]bool{
|
||||||
"http://localhost:5173": true,
|
"http://localhost:5173": true,
|
||||||
|
"http://localhost:5175": true,
|
||||||
"http://localhost:3000": true,
|
"http://localhost:3000": true,
|
||||||
"http://localhost:8081": true,
|
"http://localhost:8085": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ func main() {
|
|||||||
go func() {
|
go func() {
|
||||||
port := os.Getenv("PORT")
|
port := os.Getenv("PORT")
|
||||||
if port == "" {
|
if port == "" {
|
||||||
port = "8081"
|
port = "8085"
|
||||||
}
|
}
|
||||||
pprofPort := "6060"
|
pprofPort := "6060"
|
||||||
logger.Info("Memory profiling available", "url", "http://localhost:"+pprofPort+"/debug/pprof/")
|
logger.Info("Memory profiling available", "url", "http://localhost:"+pprofPort+"/debug/pprof/")
|
||||||
@@ -161,7 +161,7 @@ func main() {
|
|||||||
|
|
||||||
port := os.Getenv("PORT")
|
port := os.Getenv("PORT")
|
||||||
if port == "" {
|
if port == "" {
|
||||||
port = "8081"
|
port = "8085"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create HTTP server with longer timeouts for large file uploads
|
// Create HTTP server with longer timeouts for large file uploads
|
||||||
|
|||||||
Reference in New Issue
Block a user