Commit 722d0366 by 同語 Committed by GitHub

fix(classic): fix classic web build failures

Merge pull request #5892 from QuantumNous/fix/classic-web-build
parents b6e8ff9d a1301039
WEB_DIR = ./web/default
WEB_CLASSIC_DIR = ./web/classic
BACKEND_DIR = .
API_DIR = .
DEV_WEB_DEFAULT_PORT ?= 5173
DEV_WEB_CLASSIC_PORT ?= 5174
DEV_COMPOSE_FILE = docker-compose.dev.yml
DEV_POSTGRES_SERVICE = postgres
DEV_BACKEND_SERVICE = new-api
DEV_API_SERVICE = new-api
DEV_POSTGRES_DB = new-api
DEV_POSTGRES_USER = root
DEV_SQLITE_PATH ?= one-api.db
.PHONY: all build-web build-web-classic build-all-web start-backend dev dev-api dev-api-rebuild dev-web dev-web-classic reset-setup
.PHONY: all build-web build-web-classic build-all-web start-api dev dev-api dev-api-rebuild dev-web dev-web-classic reset-setup
all: build-all-web start-backend
all: build-all-web start-api
build-web:
@echo "Building default web..."
......@@ -26,17 +26,17 @@ build-web-classic:
build-all-web: build-web build-web-classic
start-backend:
@echo "Starting backend dev server..."
@cd $(BACKEND_DIR) && go run main.go &
start-api:
@echo "Starting api dev server..."
@cd $(API_DIR) && go run main.go &
dev-api:
@echo "Starting backend services (docker)..."
@echo "Starting api services (docker)..."
@docker compose -f $(DEV_COMPOSE_FILE) up -d
dev-api-rebuild:
@echo "Rebuilding and starting backend service (docker)..."
@docker compose -f $(DEV_COMPOSE_FILE) up -d --build $(DEV_BACKEND_SERVICE)
@echo "Rebuilding and starting api service (docker)..."
@docker compose -f $(DEV_COMPOSE_FILE) up -d --build $(DEV_API_SERVICE)
dev-web:
@echo "Starting default web dev server..."
......@@ -60,15 +60,15 @@ reset-setup:
-c 'DELETE FROM setups;' \
-c 'DELETE FROM users WHERE role = 100;' \
-c "DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');"; \
echo "Restarting docker dev backend so setup status is recalculated..."; \
docker compose -f $(DEV_COMPOSE_FILE) restart $(DEV_BACKEND_SERVICE); \
echo "Restarting docker dev api so setup status is recalculated..."; \
docker compose -f $(DEV_COMPOSE_FILE) restart $(DEV_API_SERVICE); \
elif db_path="$${SQLITE_PATH:-$(DEV_SQLITE_PATH)}"; db_path="$${db_path%%\?*}"; [ -f "$$db_path" ]; then \
db_path="$${SQLITE_PATH:-$(DEV_SQLITE_PATH)}"; \
db_path="$${db_path%%\?*}"; \
echo "Detected local SQLite database: $$db_path"; \
sqlite3 "$$db_path" \
"DELETE FROM setups; DELETE FROM users WHERE role = 100; DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');"; \
echo "SQLite setup state reset. Restart the local backend process before testing the setup wizard."; \
echo "SQLite setup state reset. Restart the local api process before testing the setup wizard."; \
else \
echo "No running docker dev PostgreSQL or local SQLite database found."; \
echo "Start the dev stack with 'make dev-api', or set SQLITE_PATH/DEV_SQLITE_PATH to your local SQLite database."; \
......
......@@ -10,6 +10,10 @@ const semiUiDir = path.resolve(
path.dirname(require.resolve('@douyinfe/semi-ui')),
'../..',
)
const semiDateFnsDir = path.resolve(
semiUiDir,
'../semi-foundation/node_modules/date-fns',
)
export default defineConfig(({ envMode }) => {
const env = loadEnv({ mode: envMode, prefixes: ['VITE_'] })
......@@ -47,6 +51,7 @@ export default defineConfig(({ envMode }) => {
semiUiDir,
'dist/css/semi.css',
),
'date-fns': semiDateFnsDir,
},
},
html: {
......
......@@ -99,13 +99,12 @@ import {
SiOkta,
SiOpenid,
SiReddit,
SiSlack,
SiTelegram,
SiTwitch,
SiWechat,
SiX,
} from 'react-icons/si';
import { FaLinkedin } from 'react-icons/fa';
import { FaLinkedin, FaSlack } from 'react-icons/fa';
// 获取侧边栏Lucide图标组件
export function getLucideIcon(key, selected = false) {
......@@ -512,7 +511,7 @@ const oauthProviderIconMap = {
linkedin: FaLinkedin,
x: SiX,
twitter: SiX,
slack: SiSlack,
slack: FaSlack,
telegram: SiTelegram,
wechat: SiWechat,
keycloak: SiKeycloak,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment