Compare commits
4 Commits
9d12b1960c
...
ae1f9b284f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae1f9b284f | ||
|
|
409057cef2 | ||
|
|
2c51785157 | ||
|
|
6be4a0de14 |
@@ -1,7 +1,10 @@
|
|||||||
**/node_modules/
|
node_modules
|
||||||
**/dist
|
.next
|
||||||
|
out
|
||||||
|
build
|
||||||
.git
|
.git
|
||||||
npm-debug.log
|
.env*.local
|
||||||
.coverage
|
README.md
|
||||||
.coverage.*
|
docker-compose.yml
|
||||||
.env
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
15
.env
Normal file
15
.env
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
KEYCLOAK_CLIENT_ID=
|
||||||
|
KEYCLOAK_CLIENT_SECRET=
|
||||||
|
KEYCLOAK_ISSUER=
|
||||||
|
NEXTAUTH_SECRET=
|
||||||
|
NEXTAUTH_URL=
|
||||||
|
|
||||||
|
# 为前端暴露的变量添加 NEXT_PUBLIC_ 前缀
|
||||||
|
NEXT_PUBLIC_BACKEND_URL=
|
||||||
|
NEXT_PUBLIC_MAP_URL=
|
||||||
|
NEXT_PUBLIC_MAP_WORKSPACE=
|
||||||
|
NEXT_PUBLIC_MAP_EXTENT=
|
||||||
|
# NEXT_PUBLIC_MAP_AVAILABLE_LAYERS="junctions, pipes, reservoirs, scada"
|
||||||
|
NEXT_PUBLIC_NETWORK_NAME=
|
||||||
|
NEXT_PUBLIC_MAPBOX_TOKEN=
|
||||||
|
NEXT_PUBLIC_TIANDITU_TOKEN=
|
||||||
18
Dockerfile
18
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM refinedev/node:18 AS base
|
FROM refinedev/node:22 AS base
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
|
|
||||||
@@ -15,6 +15,16 @@ RUN \
|
|||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|
||||||
|
# 只定义 ARG 接收来自构建命令或 docker-compose.yaml 的参数
|
||||||
|
# Next.js 在 build 时会自动读取同名的 ARG 作为环境变量
|
||||||
|
ARG NEXT_PUBLIC_BACKEND_URL
|
||||||
|
ARG NEXT_PUBLIC_MAP_URL
|
||||||
|
ARG NEXT_PUBLIC_MAP_WORKSPACE
|
||||||
|
ARG NEXT_PUBLIC_MAP_EXTENT
|
||||||
|
ARG NEXT_PUBLIC_NETWORK_NAME
|
||||||
|
ARG NEXT_PUBLIC_MAPBOX_TOKEN
|
||||||
|
ARG NEXT_PUBLIC_TIANDITU_TOKEN
|
||||||
|
|
||||||
COPY --from=deps /app/refine/node_modules ./node_modules
|
COPY --from=deps /app/refine/node_modules ./node_modules
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -23,7 +33,7 @@ RUN npm run build
|
|||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
COPY --from=builder /app/refine/public ./public
|
COPY --from=builder /app/refine/public ./public
|
||||||
|
|
||||||
@@ -37,7 +47,7 @@ USER refine
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME "0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
@@ -285,6 +285,9 @@ const AnalysisParameters: React.FC = () => {
|
|||||||
try {
|
try {
|
||||||
await axios.get(`${config.BACKEND_URL}/api/v1/burst_analysis/`, {
|
await axios.get(`${config.BACKEND_URL}/api/v1/burst_analysis/`, {
|
||||||
params,
|
params,
|
||||||
|
paramsSerializer: {
|
||||||
|
indexes: null, // 移除数组索引,即由 burst_ID[] 变为 burst_ID
|
||||||
|
},
|
||||||
});
|
});
|
||||||
// 更新弹窗为成功状态
|
// 更新弹窗为成功状态
|
||||||
open?.({
|
open?.({
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const AnalysisParameters: React.FC = () => {
|
|||||||
const [drainageFeature, setDrainageFeature] = useState<Feature | null>(null);
|
const [drainageFeature, setDrainageFeature] = useState<Feature | null>(null);
|
||||||
|
|
||||||
const [startTime, setStartTime] = useState<Dayjs | null>(dayjs(new Date()));
|
const [startTime, setStartTime] = useState<Dayjs | null>(dayjs(new Date()));
|
||||||
const [flushFlow, setFlushFlow] = useState<number>(0);
|
const [flushFlow, setFlushFlow] = useState<number>(200);
|
||||||
const [duration, setDuration] = useState<number>(3600);
|
const [duration, setDuration] = useState<number>(3600);
|
||||||
|
|
||||||
const [selectionMode, setSelectionMode] = useState<'none' | 'valve' | 'drainage'>('none');
|
const [selectionMode, setSelectionMode] = useState<'none' | 'valve' | 'drainage'>('none');
|
||||||
@@ -401,7 +401,7 @@ const AnalysisParameters: React.FC = () => {
|
|||||||
<Box className="flex gap-2">
|
<Box className="flex gap-2">
|
||||||
<Box className="flex-1">
|
<Box className="flex-1">
|
||||||
<Typography variant="subtitle2" className="mb-1 font-medium">
|
<Typography variant="subtitle2" className="mb-1 font-medium">
|
||||||
冲洗流量
|
冲洗流量 (CMH)
|
||||||
</Typography>
|
</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
fullWidth
|
fullWidth
|
||||||
@@ -436,7 +436,7 @@ const AnalysisParameters: React.FC = () => {
|
|||||||
!schemeName.trim() ||
|
!schemeName.trim() ||
|
||||||
!drainageNode ||
|
!drainageNode ||
|
||||||
!startTime ||
|
!startTime ||
|
||||||
!flushFlow ||
|
// !flushFlow ||
|
||||||
!duration
|
!duration
|
||||||
}
|
}
|
||||||
className="bg-blue-600 hover:bg-blue-700"
|
className="bg-blue-600 hover:bg-blue-700"
|
||||||
|
|||||||
Reference in New Issue
Block a user