mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Merge pull request #1 from chriswritescode-dev/fix-env
Fix env for docker
This commit is contained in:
9 files changed
+17
-14
No files matched your search
+2
-2
@@ -44,9 +44,9 @@ MAX_UPLOAD_SIZE_MB=50
|
||||
DEBUG=false
|
||||
|
||||
# ============================================
|
||||
# Frontend Configuration (for development)
|
||||
# Frontend Configuration (REQUIRED)
|
||||
# ============================================
|
||||
# Backend API URL - frontend connects to this
|
||||
# Note: In development, Vite proxies /api requests to the backend
|
||||
# Must include full URL with port (e.g., http://localhost:8080)
|
||||
VITE_API_URL=http://localhost:8080
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { settingsApi } from "./settings";
|
||||
import axios from "axios";
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || "http://localhost:5001";
|
||||
import { API_BASE_URL } from "@/constants/api";
|
||||
|
||||
export interface Model {
|
||||
id: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Repo } from './types'
|
||||
import { API_BASE_URL } from '@/constants/api'
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_URL ?? 'http://localhost:5001'
|
||||
const API_BASE = API_BASE_URL
|
||||
|
||||
export async function createRepo(
|
||||
repoUrl: string,
|
||||
|
||||
@@ -7,8 +7,7 @@ import type {
|
||||
CreateOpenCodeConfigRequest,
|
||||
UpdateOpenCodeConfigRequest
|
||||
} from './types/settings'
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:5001'
|
||||
import { API_BASE_URL } from '@/constants/api'
|
||||
|
||||
export const settingsApi = {
|
||||
getSettings: async (userId = 'default'): Promise<SettingsResponse> => {
|
||||
|
||||
@@ -8,8 +8,9 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
||||
import { FolderOpen, Upload, RefreshCw, X } from 'lucide-react'
|
||||
import type { FileInfo } from '@/types/files'
|
||||
import { API_BASE_URL } from '@/constants/api'
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:5001'
|
||||
const API_BASE = API_BASE_URL
|
||||
|
||||
// Hook to detect mobile screens
|
||||
const useIsMobile = () => {
|
||||
|
||||
@@ -2,8 +2,9 @@ import { useState } from 'react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Download, Copy, X, Edit3, Save, X as XIcon } from 'lucide-react'
|
||||
import type { FileInfo } from '@/types/files'
|
||||
import { API_BASE_URL } from '@/constants/api'
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:5001'
|
||||
const API_BASE = API_BASE_URL
|
||||
|
||||
interface FilePreviewProps {
|
||||
file: FileInfo
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export const API_BASE_URL = import.meta.env.VITE_API_URL || ''
|
||||
|
||||
export const OPENCODE_API_ENDPOINT = '/api/opencode'
|
||||
@@ -17,12 +17,12 @@ export default defineConfig({
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 5173,
|
||||
proxy: {
|
||||
proxy: process.env.VITE_API_URL ? {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
target: process.env.VITE_API_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
} : undefined,
|
||||
},
|
||||
build: {
|
||||
assetsInlineLimit: 4096,
|
||||
|
||||
@@ -36,7 +36,7 @@ fi
|
||||
echo "✅ OpenCode TUI is installed"
|
||||
|
||||
# Create workspace directory if it doesn't exist
|
||||
WORKSPACE_PATH="${HOME}/.opencode-workspace"
|
||||
WORKSPACE_PATH="./workspace"
|
||||
if [ ! -d "$WORKSPACE_PATH" ]; then
|
||||
echo "📁 Creating workspace directory at $WORKSPACE_PATH..."
|
||||
mkdir -p "$WORKSPACE_PATH/repos"
|
||||
@@ -70,4 +70,4 @@ echo ""
|
||||
echo "🚀 To start development:"
|
||||
echo " npm run dev # Start both backend and frontend"
|
||||
echo " npm run dev:backend # Start backend only"
|
||||
echo " npm run dev:frontend # Start frontend only"
|
||||
echo " npm run dev:frontend # Start frontend only"
|
||||
Reference in new issue
Block a user