Compare commits
3
Commits
latest
...
4a978de905
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a978de905 | ||
|
|
f5bcf28f7e | ||
|
|
ab45c8da8e |
@@ -0,0 +1,24 @@
|
||||
name: Frontend CI/CD v2
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build-test-publish-and-deploy:
|
||||
uses: OrgTJWater/ci-templates/.gitea/workflows/container-cd.yml@main
|
||||
with:
|
||||
image_name: gitea.waternetwork.cn/orgtjwater/tjwaterfrontend_refine
|
||||
dockerfile: Dockerfile
|
||||
build_context: .
|
||||
build_args: |
|
||||
NEXT_PUBLIC_BACKEND_URL=${{ vars.NEXT_PUBLIC_BACKEND_URL }}
|
||||
NEXT_PUBLIC_MAP_URL=${{ vars.NEXT_PUBLIC_MAP_URL }}
|
||||
deploy_service: frontend
|
||||
deploy_host: 192.168.1.114
|
||||
secrets:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DEV_DEPLOY_SSH_KEY: ${{ secrets.DEV_DEPLOY_SSH_KEY }}
|
||||
@@ -15,6 +15,11 @@ RUN \
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
ARG NEXT_PUBLIC_BACKEND_URL
|
||||
ARG NEXT_PUBLIC_MAP_URL
|
||||
ENV NEXT_PUBLIC_BACKEND_URL=${NEXT_PUBLIC_BACKEND_URL} \
|
||||
NEXT_PUBLIC_MAP_URL=${NEXT_PUBLIC_MAP_URL}
|
||||
|
||||
COPY --from=deps /app/refine/node_modules ./node_modules
|
||||
|
||||
COPY . .
|
||||
|
||||
@@ -16,9 +16,16 @@ interface LayerItem {
|
||||
}
|
||||
|
||||
const LayerControl: React.FC = () => {
|
||||
const map = useMap();
|
||||
const data = useData();
|
||||
if (!data) return;
|
||||
if (!data) return null;
|
||||
|
||||
return <LayerControlContent data={data} />;
|
||||
};
|
||||
|
||||
const LayerControlContent: React.FC<{
|
||||
data: NonNullable<ReturnType<typeof useData>>;
|
||||
}> = ({ data }) => {
|
||||
const map = useMap();
|
||||
const {
|
||||
deckLayer,
|
||||
isContourLayerAvailable,
|
||||
|
||||
@@ -174,15 +174,19 @@ const hexToRgba = (hex: string) => {
|
||||
: "rgba(0, 0, 0, 1)";
|
||||
};
|
||||
|
||||
const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
|
||||
layerStyleStates,
|
||||
setLayerStyleStates,
|
||||
}) => {
|
||||
const map = useMap();
|
||||
const StyleEditorPanel: React.FC<StyleEditorPanelProps> = (props) => {
|
||||
const data = useData();
|
||||
if (!data) {
|
||||
return <div>Loading...</div>; // 或其他占位符
|
||||
}
|
||||
|
||||
return <StyleEditorPanelContent {...props} data={data} />;
|
||||
};
|
||||
|
||||
const StyleEditorPanelContent: React.FC<
|
||||
StyleEditorPanelProps & { data: NonNullable<ReturnType<typeof useData>> }
|
||||
> = ({ layerStyleStates, setLayerStyleStates, data }) => {
|
||||
const map = useMap();
|
||||
const {
|
||||
currentJunctionCalData,
|
||||
currentPipeCalData,
|
||||
|
||||
@@ -38,17 +38,37 @@ interface TimelineProps {
|
||||
schemeType?: string;
|
||||
}
|
||||
|
||||
const Timeline: React.FC<TimelineProps> = ({
|
||||
const Timeline: React.FC<TimelineProps> = (props) => {
|
||||
const data = useData();
|
||||
if (
|
||||
!data ||
|
||||
data.setCurrentTime === undefined ||
|
||||
data.currentTime === undefined ||
|
||||
data.selectedDate === undefined ||
|
||||
data.setSelectedDate === undefined
|
||||
) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
return <TimelineContent {...props} data={data} />;
|
||||
};
|
||||
|
||||
const TimelineContent: React.FC<
|
||||
TimelineProps & { data: NonNullable<ReturnType<typeof useData>> }
|
||||
> = ({
|
||||
schemeDate,
|
||||
timeRange,
|
||||
disableDateSelection = false,
|
||||
schemeName = "",
|
||||
schemeType = "burst_Analysis",
|
||||
data,
|
||||
}) => {
|
||||
const data = useData();
|
||||
if (!data) {
|
||||
return <div>Loading...</div>; // 或其他占位符
|
||||
}
|
||||
const readyData = data as typeof data & {
|
||||
currentTime: NonNullable<typeof data.currentTime>;
|
||||
setCurrentTime: NonNullable<typeof data.setCurrentTime>;
|
||||
selectedDate: NonNullable<typeof data.selectedDate>;
|
||||
setSelectedDate: NonNullable<typeof data.setSelectedDate>;
|
||||
};
|
||||
const {
|
||||
currentTime,
|
||||
setCurrentTime,
|
||||
@@ -58,15 +78,7 @@ const Timeline: React.FC<TimelineProps> = ({
|
||||
setCurrentPipeCalData,
|
||||
junctionText,
|
||||
pipeText,
|
||||
} = data;
|
||||
if (
|
||||
setCurrentTime === undefined ||
|
||||
currentTime === undefined ||
|
||||
selectedDate === undefined ||
|
||||
setSelectedDate === undefined
|
||||
) {
|
||||
return <div>Loading...</div>; // 或其他占位符
|
||||
}
|
||||
} = readyData;
|
||||
const { open } = useNotification();
|
||||
|
||||
const [isPlaying, setIsPlaying] = useState<boolean>(false);
|
||||
|
||||
@@ -27,15 +27,23 @@ interface ToolbarProps {
|
||||
queryType?: string; // 可选的查询类型参数
|
||||
HistoryPanel?: React.FC<any>; // 可选的自定义历史数据面板
|
||||
}
|
||||
const Toolbar: React.FC<ToolbarProps> = ({
|
||||
const Toolbar: React.FC<ToolbarProps> = (props) => {
|
||||
const data = useData();
|
||||
if (!data) return null;
|
||||
|
||||
return <ToolbarContent {...props} data={data} />;
|
||||
};
|
||||
|
||||
const ToolbarContent: React.FC<
|
||||
ToolbarProps & { data: NonNullable<ReturnType<typeof useData>> }
|
||||
> = ({
|
||||
hiddenButtons,
|
||||
queryType,
|
||||
HistoryPanel,
|
||||
data,
|
||||
}) => {
|
||||
const map = useMap();
|
||||
const data = useData();
|
||||
const { open } = useNotification();
|
||||
if (!data) return null;
|
||||
const { currentTime, selectedDate, schemeName } = data;
|
||||
const [activeTools, setActiveTools] = useState<string[]>([]);
|
||||
const [highlightFeatures, setHighlightFeatures] = useState<Feature[]>([]);
|
||||
|
||||
@@ -59,13 +59,21 @@ interface TimelineProps {
|
||||
schemeName?: string;
|
||||
}
|
||||
|
||||
const Timeline: React.FC<TimelineProps> = ({
|
||||
disableDateSelection = false,
|
||||
}) => {
|
||||
const Timeline: React.FC<TimelineProps> = (props) => {
|
||||
const data = useData();
|
||||
if (!data) {
|
||||
return <div>Loading...</div>; // 或其他占位符
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
return <TimelineContent {...props} data={data} />;
|
||||
};
|
||||
|
||||
const TimelineContent: React.FC<
|
||||
TimelineProps & { data: NonNullable<ReturnType<typeof useData>> }
|
||||
> = ({
|
||||
disableDateSelection = false,
|
||||
data,
|
||||
}) => {
|
||||
const { open } = useNotification();
|
||||
const {
|
||||
predictionResults,
|
||||
|
||||
Reference in New Issue
Block a user