Compare commits
14 Commits
f60451ecb1
...
bur-35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d95dbc5b9d | ||
|
|
36276297a6 | ||
|
|
19b1eb3d8a | ||
|
|
b58b5102b2 | ||
|
|
221552104f | ||
| 0f38229ad0 | |||
| faccdf734a | |||
| 8522d35d90 | |||
| 96ca70d9f9 | |||
|
|
c44534bf66 | ||
|
|
594a3c2a2a | ||
| 34ab5d4a6f | |||
|
|
3e3d2cdec3 | ||
|
|
33b9b3f4bd |
@@ -1,6 +1,7 @@
|
|||||||
VITE_CLOUD_API_URL=http://localhost:3101
|
branch=
|
||||||
|
DEV_API_URL=http://localhost:3101
|
||||||
VITE_DIAGRAM_API_URL=http://localhost:3002
|
VITE_DIAGRAM_API_URL=http://localhost:3002
|
||||||
VITE_TOIR_LIGHT_ORIGIN=https://toir-light.greact.ru
|
VITE_TOIR_LIGHT_ORIGIN=https://toir-light.greact.ru
|
||||||
VITE_KEYCLOAK_URL=
|
VITE_KEYCLOAK_URL=https://sso.greact.ru
|
||||||
VITE_KEYCLOAK_REALM=
|
VITE_KEYCLOAK_REALM=toir
|
||||||
VITE_KEYCLOAK_CLIENT_ID=
|
VITE_KEYCLOAK_CLIENT_ID=localhost
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
VITE_CLOUD_API_URL=http://localhost:3101
|
|
||||||
VITE_DIAGRAM_API_URL=http://localhost:3002
|
|
||||||
|
|
||||||
# Если эти переменные не заданы, greact.drill.ui работает без SSO для локальной разработки.
|
|
||||||
VITE_KEYCLOAK_URL=https://sso.greact.ru
|
|
||||||
VITE_KEYCLOAK_REALM=toir
|
|
||||||
VITE_KEYCLOAK_CLIENT_ID=drill-ui-frontend
|
|
||||||
|
|
||||||
# Origin встроенного ТОиР light. По умолчанию используется https://toir-light.greact.ru.
|
|
||||||
VITE_TOIR_LIGHT_ORIGIN=https://toir-light.greact.ru
|
|
||||||
@@ -7,13 +7,11 @@ FROM node:22-alpine AS build
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
ARG VITE_CLOUD_API_URL
|
|
||||||
ARG VITE_DIAGRAM_API_URL
|
ARG VITE_DIAGRAM_API_URL
|
||||||
ARG VITE_TOIR_LIGHT_ORIGIN
|
ARG VITE_TOIR_LIGHT_ORIGIN
|
||||||
ARG VITE_KEYCLOAK_URL
|
ARG VITE_KEYCLOAK_URL
|
||||||
ARG VITE_KEYCLOAK_REALM
|
ARG VITE_KEYCLOAK_REALM
|
||||||
ARG VITE_KEYCLOAK_CLIENT_ID
|
ARG VITE_KEYCLOAK_CLIENT_ID
|
||||||
ENV VITE_CLOUD_API_URL=$VITE_CLOUD_API_URL
|
|
||||||
ENV VITE_DIAGRAM_API_URL=$VITE_DIAGRAM_API_URL
|
ENV VITE_DIAGRAM_API_URL=$VITE_DIAGRAM_API_URL
|
||||||
ENV VITE_TOIR_LIGHT_ORIGIN=$VITE_TOIR_LIGHT_ORIGIN
|
ENV VITE_TOIR_LIGHT_ORIGIN=$VITE_TOIR_LIGHT_ORIGIN
|
||||||
ENV VITE_KEYCLOAK_URL=$VITE_KEYCLOAK_URL
|
ENV VITE_KEYCLOAK_URL=$VITE_KEYCLOAK_URL
|
||||||
|
|||||||
19
docker-compose.dev.yml
Normal file
19
docker-compose.dev.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
services:
|
||||||
|
drill-ui-dev:
|
||||||
|
container_name: container-drill-ui${branch:+-${branch}}
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
VITE_DIAGRAM_API_URL: ${VITE_DIAGRAM_API_URL}
|
||||||
|
VITE_TOIR_LIGHT_ORIGIN: ${VITE_TOIR_LIGHT_ORIGIN}
|
||||||
|
VITE_KEYCLOAK_URL: ${VITE_KEYCLOAK_URL}
|
||||||
|
VITE_KEYCLOAK_REALM: ${VITE_KEYCLOAK_REALM}
|
||||||
|
VITE_KEYCLOAK_CLIENT_ID: ${VITE_KEYCLOAK_CLIENT_ID}
|
||||||
|
expose:
|
||||||
|
- "80"
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy:
|
||||||
|
external: true
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
services:
|
services:
|
||||||
drill-ui:
|
drill-ui:
|
||||||
|
container_name: container-drill-ui${branch:+-${branch}}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
VITE_CLOUD_API_URL: ${VITE_CLOUD_API_URL}
|
|
||||||
VITE_DIAGRAM_API_URL: ${VITE_DIAGRAM_API_URL}
|
VITE_DIAGRAM_API_URL: ${VITE_DIAGRAM_API_URL}
|
||||||
VITE_TOIR_LIGHT_ORIGIN: ${VITE_TOIR_LIGHT_ORIGIN}
|
VITE_TOIR_LIGHT_ORIGIN: ${VITE_TOIR_LIGHT_ORIGIN}
|
||||||
VITE_KEYCLOAK_URL: ${VITE_KEYCLOAK_URL}
|
VITE_KEYCLOAK_URL: ${VITE_KEYCLOAK_URL}
|
||||||
@@ -11,7 +11,9 @@ services:
|
|||||||
VITE_KEYCLOAK_CLIENT_ID: ${VITE_KEYCLOAK_CLIENT_ID}
|
VITE_KEYCLOAK_CLIENT_ID: ${VITE_KEYCLOAK_CLIENT_ID}
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
external:
|
proxy:
|
||||||
true
|
external: true
|
||||||
|
|||||||
@@ -7,5 +7,10 @@ server {
|
|||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
|
|
||||||
|
# отключаем кеширование вообще пока активная разработка
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires "0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
export type AvgPointValue = [time: number, avg: number, min: number, max: number, count: number];
|
export type AvgPointValue = [time: number, avg: number, min: number, max: number, count: number];
|
||||||
|
|
||||||
export type TooltipParam = {
|
export type TooltipParam = {
|
||||||
|
color?: string;
|
||||||
marker?: string;
|
marker?: string;
|
||||||
seriesName?: string;
|
seriesName?: string;
|
||||||
value?: unknown;
|
value?: unknown;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export function formatTooltip(params: unknown): string {
|
|||||||
const value = item.value as AvgPointValue;
|
const value = item.value as AvgPointValue;
|
||||||
return [
|
return [
|
||||||
'<div class="chart-tooltip-row">',
|
'<div class="chart-tooltip-row">',
|
||||||
`<span>${item.marker ?? ''}${item.seriesName ?? ''}</span>`,
|
`<span class="chart-tooltip-label" style="--chart-tooltip-marker-color:${item.color ?? 'currentColor'};">${item.seriesName ?? ''}</span>`,
|
||||||
'<strong>',
|
'<strong>',
|
||||||
`min ${formatChartValue(value[2])} · avg ${formatChartValue(value[1])} · max ${formatChartValue(value[3])}`,
|
`min ${formatChartValue(value[2])} · avg ${formatChartValue(value[1])} · max ${formatChartValue(value[3])}`,
|
||||||
value[4] > 1 ? ` · ${value[4]} точек` : '',
|
value[4] > 1 ? ` · ${value[4]} точек` : '',
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ export function createHistoryChartOptions({
|
|||||||
legend: {
|
legend: {
|
||||||
type: 'scroll',
|
type: 'scroll',
|
||||||
top: 0,
|
top: 0,
|
||||||
|
icon: 'rect',
|
||||||
|
itemWidth: 18,
|
||||||
|
itemHeight: 3,
|
||||||
data: legendData,
|
data: legendData,
|
||||||
textStyle: { color: '#cbd5e1' },
|
textStyle: { color: '#cbd5e1' },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -93,7 +93,11 @@ export function createSeriesOptions(points: HistoryPoint[], index: number, label
|
|||||||
color,
|
color,
|
||||||
},
|
},
|
||||||
emphasis: {
|
emphasis: {
|
||||||
focus: 'series',
|
disabled: true,
|
||||||
|
lineStyle: {
|
||||||
|
width: 1.8,
|
||||||
|
color,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
z: 3,
|
z: 3,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export const cloudApiUrl = import.meta.env.VITE_CLOUD_API_URL as string;
|
/** Базовый путь cloud API; маршрутизация на бэкенд — на уровне реверс-прокси. */
|
||||||
|
export const cloudApiUrl = '/api';
|
||||||
export const diagramApiUrl = import.meta.env.VITE_DIAGRAM_API_URL as string;
|
export const diagramApiUrl = import.meta.env.VITE_DIAGRAM_API_URL as string;
|
||||||
export const toirLightOrigin = import.meta.env.VITE_TOIR_LIGHT_ORIGIN as string;
|
export const toirLightOrigin = import.meta.env.VITE_TOIR_LIGHT_ORIGIN as string;
|
||||||
export const keycloakUrl = import.meta.env.VITE_KEYCLOAK_URL;
|
export const keycloakUrl = import.meta.env.VITE_KEYCLOAK_URL;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-tooltip-row span {
|
.chart-tooltip-label {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #cbd5e1;
|
color: #cbd5e1;
|
||||||
@@ -44,6 +44,16 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chart-tooltip-label::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 18px;
|
||||||
|
height: 3px;
|
||||||
|
margin-right: 6px;
|
||||||
|
vertical-align: middle;
|
||||||
|
background: var(--chart-tooltip-marker-color, currentColor);
|
||||||
|
}
|
||||||
|
|
||||||
.chart-tooltip-row strong {
|
.chart-tooltip-row strong {
|
||||||
color: #f8fafc;
|
color: #f8fafc;
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
|
|||||||
1
src/vite-env.d.ts
vendored
1
src/vite-env.d.ts
vendored
@@ -1,7 +1,6 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly VITE_CLOUD_API_URL?: string;
|
|
||||||
readonly VITE_DIAGRAM_API_URL?: string;
|
readonly VITE_DIAGRAM_API_URL?: string;
|
||||||
readonly VITE_TOIR_LIGHT_ORIGIN?: string;
|
readonly VITE_TOIR_LIGHT_ORIGIN?: string;
|
||||||
readonly VITE_KEYCLOAK_URL?: string;
|
readonly VITE_KEYCLOAK_URL?: string;
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig, loadEnv } from 'vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => {
|
||||||
plugins: [react()],
|
const { DEV_API_URL } = loadEnv(mode, '.', '');
|
||||||
build: {
|
|
||||||
chunkSizeWarningLimit: 700,
|
return {
|
||||||
},
|
plugins: [react()],
|
||||||
server: {
|
build: {
|
||||||
port: 5173,
|
chunkSizeWarningLimit: 700,
|
||||||
proxy: {
|
},
|
||||||
'/api': {
|
server: {
|
||||||
target: 'https://beta.backend.drill.greact.ru',
|
port: 5173,
|
||||||
changeOrigin: true,
|
proxy: {
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
'/api': {
|
||||||
|
target: DEV_API_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user