fix url, build

dev
gman 6 months ago
parent cd9a95b09e
commit 2add6f4d24

@ -46,11 +46,11 @@
}
location /api/ {
location https://postamates.spatialsystems.ru/api/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://0.0.0.0:DJANGO_PORT/api/;
proxy_pass http://0.0.0.0:DJANGO_PORThttps://postamates.spatialsystems.ru/api/;
}
location /admin/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

@ -0,0 +1,10 @@
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 2 2"
width="2"
height="2"
>
<g>
<circle cx="1" cy="1" r="0.5" fill="#26a2a2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 176 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,17 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="24"
height="24"
>
<g>
<polygon fill="#3B555E"
points="19.6,24 21.4,24 22.5,23.9 23,23.8 23.5,23.4 23.8,22.9 24,22.3 24,20.4 24,1.9 23.9,1.4 23.6,0.8
23.3,0.4 22.9,0.1 22.3,0 14.2,0 8.9,0 11.2,4.6 19.5,4.5 19.6,4.5 "
/>
<polygon fill="#E63941"
points="13.6,6.4 17.7,6.4 16.2,9.4 14.1,14.2 12.3,18.4 11.7,18.4 9.8,14.5 6.8,8.8 4.5,4.5 4.7,23.9 1.7,24
1,23.8 0.5,23.2 0.2,22.7 0,22.1 0,1.8 0.1,1.3 0.4,0.8 0.8,0.4 1.1,0.2 1.4,0.1 2,0.1 7,0.1 11.9,10.6 "
/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

22
dist/index.html vendored

@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link href="/favicon.ico" rel="icon"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>PostNet by Spatial</title>
<script crossorigin src="/assets/index.eee895f6.js" type="module"></script>
<link href="/assets/index.0353450f.css" rel="stylesheet">
</head>
<body>
<div id="root"></div>
<head>
<meta charset="UTF-8" />
<link href="/favicon.ico" rel="icon"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PostNet by Spatial</title>
<script type="module" crossorigin src="/assets/index.b030c1fc.js"></script>
<link rel="stylesheet" href="/assets/index.c34137ad.css">
</head>
<body>
<div id="root"></div>
</body>
</body>
</html>

19
dist/vite.svg vendored

@ -1,18 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img"
class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257">
<defs>
<linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%">
<stop offset="0%" stop-color="#41D1FF"></stop>
<stop offset="100%" stop-color="#BD34FE"></stop>
</linearGradient>
<linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%">
<stop offset="0%" stop-color="#FFEA83"></stop>
<stop offset="8.333%" stop-color="#FFDD35"></stop>
<stop offset="100%" stop-color="#FFA800"></stop>
</linearGradient>
</defs>
<path fill="url(#IconifyId1813088fe1fbc01fb466)"
d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path>
<path fill="url(#IconifyId1813088fe1fbc01fb467)"
d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -1,12 +1,12 @@
import { AutoComplete, Input } from "antd";
import { useQuery } from "@tanstack/react-query";
import { SearchOutlined } from "@ant-design/icons";
import { api, useDbTableName } from "../api";
import { useQuery } from "@tanstack/react-query";
import { AutoComplete, Input } from "antd";
import { useEffect, useMemo, useRef, useState } from "react";
import { useMap } from "react-map-gl";
import parse from "wellknown";
import { usePopup } from "../stores/usePopup.js";
import { api, useDbTableName } from "../api";
import { useClickedPointConfig } from "../stores/useClickedPointConfig.js";
import { usePopup } from "../stores/usePopup.js";
function useDebounce(value, delay) {
const [debouncedValue, setDebouncedValue] = useState(value);
@ -35,7 +35,7 @@ export const AddressSearch = ({ autoFocus = false }) => {
["address", debouncedValue],
async () => {
const result = await api.get(
`/api/${dbTable}/search_address?page_size=100&address=${debouncedValue}`
`https://postamates.spatialsystems.ru/api/${dbTable}/search_address?page_size=100&address=${debouncedValue}`
);
return result.data;

@ -1,12 +1,11 @@
import {Points} from "./Points";
import {Layer, Source} from "react-map-gl";
import {aoLayer, rayonLayer} from "./layers-config";
import {BASE_URL} from "../../api";
import {PVZ} from "./PVZ";
import {OtherPostamates} from "./OtherPostamates";
import {SelectedRegion} from "./SelectedRegion";
import {transliterate} from "../../utils.js";
import {useUpdateLayerCounter} from "../../stores/useUpdateLayerCounter.js";
import { Layer, Source } from "react-map-gl";
import { useUpdateLayerCounter } from "../../stores/useUpdateLayerCounter.js";
import { transliterate } from "../../utils.js";
import { aoLayer, rayonLayer } from "./layers-config";
import { OtherPostamates } from "./OtherPostamates";
import { Points } from "./Points";
import { PVZ } from "./PVZ";
import { SelectedRegion } from "./SelectedRegion";
export const Layers = ({ postGroups, otherGroups }) => {
const { updateCounter, updatePVZLayer } = useUpdateLayerCounter();
@ -16,7 +15,7 @@ export const Layers = ({ postGroups, otherGroups }) => {
<Source
id="ao"
type="vector"
tiles={[`${BASE_URL}/martin/public.service_ao/{z}/{x}/{y}.pbf`]}
tiles={["https://postamates.spatialsystems.ru/martin/public.service_ao/{z}/{x}/{y}.pbf"]}
>
<Layer
{...aoLayer}
@ -29,7 +28,7 @@ export const Layers = ({ postGroups, otherGroups }) => {
<Source
id="rayon"
type="vector"
tiles={[`${BASE_URL}/martin/public.service_rayon/{z}/{x}/{y}.pbf`]}
tiles={["https://postamates.spatialsystems.ru/martin/public.service_rayon/{z}/{x}/{y}.pbf"]}
>
<Layer
{...rayonLayer}
@ -47,7 +46,7 @@ export const Layers = ({ postGroups, otherGroups }) => {
id="pvz"
key={`pvz-${updateCounter}-${updatePVZLayer}`}
type="vector"
tiles={[`${BASE_URL}/martin/public.service_post_and_pvz/{z}/{x}/{y}.pbf`]}
tiles={["https://postamates.spatialsystems.ru/martin/public.service_post_and_pvz/{z}/{x}/{y}.pbf"]}
>
{postGroups?.map((item) => {
return item.groups.map((itemGroup) =>
@ -64,7 +63,7 @@ export const Layers = ({ postGroups, otherGroups }) => {
id="other"
key={`other-${updateCounter}-${updatePVZLayer}`}
type="vector"
tiles={[`${BASE_URL}/martin/public.service_otherobjects/{z}/{x}/{y}.pbf`]}
tiles={["https://postamates.spatialsystems.ru/martin/public.service_otherobjects/{z}/{x}/{y}.pbf"]}
>
{otherGroups && otherGroups.map((item) => {
return item.groups.map((itemGroup) =>

@ -1,14 +1,17 @@
import { Line } from "react-chartjs-2";
import { useQuery } from "@tanstack/react-query";
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip as ChartTooltip,
Legend, PointElement, LineElement, BarController,
BarController,
BarElement,
CategoryScale,
Chart as ChartJS,
Tooltip as ChartTooltip,
Legend,
LinearScale,
LineElement,
PointElement,
Title,
} from 'chart.js';
import { useQuery } from "@tanstack/react-query";
import { Line } from "react-chartjs-2";
import { api } from "../api.js";
ChartJS.register(
@ -62,7 +65,7 @@ export const PointChart = ({ point }) => {
["mean-data"],
async () => {
const { data } = await api.get(
`/api/avg_bi_values/`
`https://postamates.spatialsystems.ru/api/avg_bi_values/`
);
return data;

@ -3,7 +3,7 @@ import { Button, Popover, Tooltip } from "antd";
export function SignOut() {
// const { data } = useQuery(["profile"], async () => {
// const { data } = await api.get("/api/me/");
// const { data } = await api.get("https://postamates.spatialsystems.ru/api/me/");
// return data;
// });

@ -48,7 +48,7 @@ export const getPoints = async (params, region, dbTable = "placement_points", si
const resultParams = enrichParamsWithRegionFilter(params, region);
const { data } = await api.get(
`/api/${dbTable}/?${resultParams.toString()}`, { signal }
`https://postamates.spatialsystems.ru/api/${dbTable}/?${resultParams.toString()}`, { signal }
);
return data;
@ -58,7 +58,7 @@ export const exportPoints = async (params, region, dbTable = "placement_points")
const resultParams = enrichParamsWithRegionFilter(params, region);
const { data } = await api.get(
`/api/${dbTable}/to_excel/?${resultParams.toString()}`,
`https://postamates.spatialsystems.ru/api/${dbTable}/to_excel/?${resultParams.toString()}`,
{ responseType: "arraybuffer" }
);
@ -67,7 +67,7 @@ export const exportPoints = async (params, region, dbTable = "placement_points")
export const downloadImportTemplate = async () => {
const { data } = await api.get(
'/api/pre_placement_points/download_template/',
'https://postamates.spatialsystems.ru/api/pre_placement_points/download_template/',
{ responseType: "arraybuffer" }
);
@ -78,7 +78,7 @@ export const uploadPointsFile = async (file, config) => {
const formData = new FormData();
formData.append("file", file);
const { data } = await api.post(
`/api/pre_placement_points/load_matching_file/`,
`https://postamates.spatialsystems.ru/api/pre_placement_points/load_matching_file/`,
formData,
config
);
@ -90,7 +90,7 @@ export const importPoints = async (id) => {
const formData = new FormData();
formData.append("id", id);
const { data } = await api.post(
`/api/pre_placement_points/start_matching/`,
`https://postamates.spatialsystems.ru/api/pre_placement_points/start_matching/`,
formData
);
@ -99,7 +99,7 @@ export const importPoints = async (id) => {
export const getImportStatus = async () => {
const { data } = await api.get(
`/api/pre_placement_points/import_status/`
`https://postamates.spatialsystems.ru/api/pre_placement_points/import_status/`
);
return data;
@ -199,7 +199,7 @@ export const useMergePointsToDb = () => {
return useMutation({
mutationFn: () => {
return api.post(
`/api/pre_placement_points/move_points/`
`https://postamates.spatialsystems.ru/api/pre_placement_points/move_points/`
);
},
});
@ -209,7 +209,7 @@ export const useGetPermissions = () => {
return "editor"
// const { setImportMode } = useMode();
// return useQuery(["permissions"], async () => {
// const { data } = await api.get("/api/me/");
// const { data } = await api.get("https://postamates.spatialsystems.ru/api/me/");
// if (data?.groups?.includes("postnet_editor")) {
// return "editor";
@ -228,7 +228,7 @@ export const useUpdatePostamatId = () => {
return useMutation({
mutationFn: (params) => {
return api.put(
`/api/placement_points/update_postamat_id/?${params.toString()}`
`https://postamates.spatialsystems.ru/api/placement_points/update_postamat_id/?${params.toString()}`
);
},
});
@ -236,7 +236,7 @@ export const useUpdatePostamatId = () => {
export const getLastMLRun = async () => {
const { data } = await api.get(
`/api/placement_points/last_time_ml_run/`
`https://postamates.spatialsystems.ru/api/placement_points/last_time_ml_run/`
);
return data;
@ -244,7 +244,7 @@ export const getLastMLRun = async () => {
export const startML = async () => {
const { data } = await api.get(
`/api/placement_points/start/`
`https://postamates.spatialsystems.ru/api/placement_points/start/`
);
return data;
@ -252,7 +252,7 @@ export const startML = async () => {
export const getPostamatesAndPvzGroups = async () => {
const { data } = await api.get(
`/api/postamate_and_pvz_groups/`
`https://postamates.spatialsystems.ru/api/postamate_and_pvz_groups/`
);
return data;
@ -269,7 +269,7 @@ export const usePostamatesAndPvzGroups = () => {
export const getOtherGroups = async () => {
const { data } = await api.get(
`/api/other_object_groups/`
`https://postamates.spatialsystems.ru/api/other_object_groups/`
);
return data;
@ -304,7 +304,7 @@ export const useGetPendingPointsRange = (dbTable) => {
["prediction-max-min", dbTable],
async () => {
const { data, isInitialLoading, isFetching } = await api.get(
`/api/${dbTable}/filters/${statusFilter}`
`https://postamates.spatialsystems.ru/api/${dbTable}/filters/${statusFilter}`
);
return { data, isLoading: isInitialLoading || isFetching };
},
@ -348,7 +348,7 @@ export const useGetPopupPoints = (features) => {
});
const { data } = await api.get(
`/api/${dbTable}/?${params.toString()}`
`https://postamates.spatialsystems.ru/api/${dbTable}/?${params.toString()}`
);
return data.results;
@ -366,7 +366,7 @@ export const deletePoint = async (id) => {
const formData = new FormData();
formData.append("ids", id);
await api.delete(
`/api/pre_placement_points/delete_points/`,
`https://postamates.spatialsystems.ru/api/pre_placement_points/delete_points/`,
{ data: formData }
)
}

@ -1,11 +1,11 @@
import { Empty, TreeSelect } from "antd";
import { Title } from "./Title";
import { useMap } from "react-map-gl";
import { useQuery } from "@tanstack/react-query";
import getBbox from "@turf/bbox";
import { polygon as getPolygon } from "@turf/helpers";
import { api } from "../api";
import { Empty, TreeSelect } from "antd";
import { useMap } from "react-map-gl";
import parse from "wellknown";
import { useQuery } from "@tanstack/react-query";
import { api } from "../api";
import { Title } from "./Title";
const { TreeNode } = TreeSelect;
@ -27,7 +27,7 @@ export const useGetRegions = () => {
return useQuery(
["regions"],
async () => {
const { data } = await api.get("/api/ao_rayons/");
const { data } = await api.get("https://postamates.spatialsystems.ru/api/ao_rayons/");
return data;
},
{

@ -9,7 +9,7 @@ export const useUpdateStatus = ({ onSuccess }) => {
return useMutation({
mutationFn: (params) => {
return api.put(
`/api/${dbTable}/update_status/?${params.toString()}`
`https://postamates.spatialsystems.ru/api/${dbTable}/update_status/?${params.toString()}`
);
},
onSuccess: () => {

@ -1,16 +1,16 @@
import { RegionSelect } from "../../../components/RegionSelect";
import { useWorkingPointsFilters } from "../../../stores/useWorkingPointsFilters";
import { DeltaTrafficSlider } from "./DeltaSlider";
import { FactTrafficSlider } from "./FactTrafficSlider";
import { AgeSlider } from "./AgeSlider";
import { ClearFiltersButton } from "../../../components/ClearFiltersButton";
import { getDynamicActiveFilters } from "../utils";
import { Spin } from "antd";
import { useQuery } from "@tanstack/react-query";
import { Spin } from "antd";
import { useEffect } from "react";
import { api, useDbTableName } from "../../../api.js";
import { ClearFiltersButton } from "../../../components/ClearFiltersButton";
import { RegionSelect } from "../../../components/RegionSelect";
import { STATUSES } from "../../../config.js";
import { useEffect } from "react";
import { useWorkingPointsFilters } from "../../../stores/useWorkingPointsFilters";
import { workingFilterHasChanged } from "../../../utils.js";
import { getDynamicActiveFilters } from "../utils";
import { AgeSlider } from "./AgeSlider";
import { DeltaTrafficSlider } from "./DeltaSlider";
import { FactTrafficSlider } from "./FactTrafficSlider";
const useGetDataRange = () => {
const dbTable = useDbTableName();
@ -18,7 +18,7 @@ const useGetDataRange = () => {
["working-max-min"],
async () => {
const { data } = await api.get(
`/api/${dbTable}/filters?status[]=${STATUSES.working}`
`https://postamates.spatialsystems.ru/api/${dbTable}/filters?status[]=${STATUSES.working}`
);
return data;

@ -1,6 +1,6 @@
import { useClickedPointConfig } from "../../stores/useClickedPointConfig";
import { useQuery } from "@tanstack/react-query";
import { api } from "../../api";
import { useClickedPointConfig } from "../../stores/useClickedPointConfig";
export const useGetClickedPoint = (enabled, onSuccess) => {
const { clickedPointConfig } = useClickedPointConfig();
@ -13,7 +13,7 @@ export const useGetClickedPoint = (enabled, onSuccess) => {
});
const { data } = await api.get(
`/api/placement_points?${params.toString()}`
`https://postamates.spatialsystems.ru/api/placement_points?${params.toString()}`
);
return data;

@ -13,7 +13,6 @@ export default defineConfig(({ mode }) => {
plugins: [svgr(), react()],
server: {
proxy: {
"/api": {target: "https://postamates.spatialsystems.ru/api", changeOrigin: true},
"/realms": "https://kk.dev.selftech.ru/",
},
},

Loading…
Cancel
Save