Compare commits
4 Commits
19af3ff07a
...
ace3d53a2e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ace3d53a2e | ||
![]() |
5922c28fa7 | ||
![]() |
3996673d9f | ||
![]() |
80e0849eaf |
|
@ -54,6 +54,7 @@ db.sqlite3-journal
|
||||||
# React
|
# React
|
||||||
.DS_*
|
.DS_*
|
||||||
*.log
|
*.log
|
||||||
|
*.tsbuildinfo
|
||||||
logs
|
logs
|
||||||
**/*.backup.*
|
**/*.backup.*
|
||||||
**/*.back.*
|
**/*.back.*
|
||||||
|
|
6
.github/workflows/frontend.yml
vendored
6
.github/workflows/frontend.yml
vendored
|
@ -18,12 +18,11 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [18.x]
|
node-version: [22.x]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -33,9 +32,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache-dependency-path: rsconcept/frontend/package-lock.json
|
cache-dependency-path: rsconcept/frontend/package-lock.json
|
||||||
cache: 'npm'
|
cache: "npm"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
|
npm install -g typescript vite jest
|
||||||
npm ci
|
npm ci
|
||||||
npm run build --if-present
|
npm run build --if-present
|
||||||
- name: Test
|
- name: Test
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -47,6 +47,7 @@ db.sqlite3-journal
|
||||||
# React
|
# React
|
||||||
.DS_*
|
.DS_*
|
||||||
*.log
|
*.log
|
||||||
|
*.tsbuildinfo
|
||||||
logs
|
logs
|
||||||
**/*.backup.*
|
**/*.backup.*
|
||||||
**/*.back.*
|
**/*.back.*
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# ============ Multi-stage build ===========
|
# ============ Multi-stage build ===========
|
||||||
# ==========================================
|
# ==========================================
|
||||||
FROM ubuntu:jammy as python-base
|
FROM ubuntu:jammy AS python-base
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ RUN apt-get update -qq && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ========= Builder ==============
|
# ========= Builder ==============
|
||||||
FROM python-base as builder
|
FROM python-base AS builder
|
||||||
|
|
||||||
# Set env variables
|
# Set env variables
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
@ -65,9 +65,10 @@ RUN pip install --no-cache /wheels/* && \
|
||||||
rm -rf /wheels
|
rm -rf /wheels
|
||||||
|
|
||||||
# Copy application sources and setup permissions
|
# Copy application sources and setup permissions
|
||||||
COPY apps/ ./apps
|
|
||||||
COPY project/ ./project
|
COPY project/ ./project
|
||||||
|
COPY shared/ ./shared
|
||||||
COPY fixtures/ ./fixtures
|
COPY fixtures/ ./fixtures
|
||||||
|
COPY apps/ ./apps
|
||||||
COPY manage.py entrypoint.sh ./
|
COPY manage.py entrypoint.sh ./
|
||||||
RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.sh && \
|
RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.sh && \
|
||||||
chmod +x $APP_HOME/entrypoint.sh && \
|
chmod +x $APP_HOME/entrypoint.sh && \
|
||||||
|
|
|
@ -2,4 +2,3 @@
|
||||||
|
|
||||||
VITE_PORTAL_BACKEND=http://localhost:8000
|
VITE_PORTAL_BACKEND=http://localhost:8000
|
||||||
VITE_PORTAL_FRONT_PORT=3000
|
VITE_PORTAL_FRONT_PORT=3000
|
||||||
VITE_PORTAL_FRONT_HTTPS=false
|
|
||||||
|
|
|
@ -1,24 +1,28 @@
|
||||||
# ======== Multi-stage base ==========
|
# ======== Multi-stage base ==========
|
||||||
FROM node:bullseye-slim as node-base
|
FROM node:22-bookworm-slim AS node-base
|
||||||
RUN apt-get update -qq && \
|
RUN apt-get update -qq && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ======= Build =======
|
# ======= Build =======
|
||||||
ARG BUILD_TYPE=production
|
ARG BUILD_TYPE=production
|
||||||
FROM node-base as builder
|
FROM node-base AS builder
|
||||||
|
|
||||||
WORKDIR /result
|
WORKDIR /result
|
||||||
|
|
||||||
|
RUN npm install -g typescript vite
|
||||||
|
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
COPY ./env/.env.$BUILD_TYPE ./
|
COPY ./env/.env.$BUILD_TYPE ./
|
||||||
RUN rm -rf ./env
|
RUN rm -rf ./env
|
||||||
|
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# ========= Server =======
|
# ========= Server =======
|
||||||
FROM node-base as product-server
|
FROM node-base AS product-server
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# ======== Multi-stage base ==========
|
# ======== Multi-stage base ==========
|
||||||
FROM node:bullseye-slim as node-base
|
FROM node:bullseye-slim AS node-base
|
||||||
RUN apt-get update -qq && \
|
RUN apt-get update -qq && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ========= Server =======
|
# ========= Server =======
|
||||||
FROM node-base as product-server
|
FROM node-base AS product-server
|
||||||
ARG BUILD_TYPE=production
|
ARG BUILD_TYPE=production
|
||||||
|
|
||||||
WORKDIR /home
|
WORKDIR /home
|
||||||
|
|
1
rsconcept/frontend/env/.env.development
vendored
1
rsconcept/frontend/env/.env.development
vendored
|
@ -2,4 +2,3 @@
|
||||||
|
|
||||||
VITE_PORTAL_BACKEND=http://localhost:8002
|
VITE_PORTAL_BACKEND=http://localhost:8002
|
||||||
VITE_PORTAL_FRONT_PORT=3002
|
VITE_PORTAL_FRONT_PORT=3002
|
||||||
VITE_PORTAL_FRONT_HTTPS=false
|
|
||||||
|
|
1
rsconcept/frontend/env/.env.production
vendored
1
rsconcept/frontend/env/.env.production
vendored
|
@ -2,4 +2,3 @@
|
||||||
|
|
||||||
VITE_PORTAL_BACKEND=https://api.portal.acconcept.ru
|
VITE_PORTAL_BACKEND=https://api.portal.acconcept.ru
|
||||||
VITE_PORTAL_FRONT_PORT=443
|
VITE_PORTAL_FRONT_PORT=443
|
||||||
VITE_PORTAL_FRONT_HTTPS=true
|
|
||||||
|
|
1
rsconcept/frontend/env/.env.production.local
vendored
1
rsconcept/frontend/env/.env.production.local
vendored
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
VITE_PORTAL_BACKEND=https://localhost:8001
|
VITE_PORTAL_BACKEND=https://localhost:8001
|
||||||
VITE_PORTAL_FRONT_PORT=3001
|
VITE_PORTAL_FRONT_PORT=3001
|
||||||
VITE_PORTAL_FRONT_HTTPS=true
|
|
||||||
|
|
||||||
|
|
1305
rsconcept/frontend/package-lock.json
generated
1305
rsconcept/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -15,16 +15,16 @@ interface DataLoaderProps extends CProps.AnimatedDiv {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
function DataLoader({ id, isLoading, hasNoData, error, children, ...restProps }: DataLoaderProps) {
|
function DataLoader({ id, isLoading, hasNoData, error, className, children, ...restProps }: DataLoaderProps) {
|
||||||
return (
|
return (
|
||||||
<AnimatePresence mode='wait'>
|
<AnimatePresence mode='wait'>
|
||||||
{!isLoading && !error && !hasNoData ? (
|
{!isLoading && !error && !hasNoData ? (
|
||||||
<AnimateFade id={id} key={`${id}-data`} {...restProps}>
|
<AnimateFade id={id} key={`${id}-data`} className={className} {...restProps}>
|
||||||
{children}
|
{children}
|
||||||
</AnimateFade>
|
</AnimateFade>
|
||||||
) : null}
|
) : null}
|
||||||
{!isLoading && !error && hasNoData ? (
|
{!isLoading && !error && hasNoData ? (
|
||||||
<AnimateFade key={`${id}-no-data`} {...restProps}>
|
<AnimateFade key={`${id}-no-data`} className='w-full text-center p-1' {...restProps}>
|
||||||
Данные не загружены
|
Данные не загружены
|
||||||
</AnimateFade>
|
</AnimateFade>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { OssLoader } from '@/models/OssLoader';
|
||||||
function useOssDetails({ target }: { target?: string }) {
|
function useOssDetails({ target }: { target?: string }) {
|
||||||
const { loading: userLoading } = useAuth();
|
const { loading: userLoading } = useAuth();
|
||||||
const [schema, setInner] = useState<IOperationSchema | undefined>(undefined);
|
const [schema, setInner] = useState<IOperationSchema | undefined>(undefined);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(target != undefined);
|
||||||
const [error, setError] = useState<ErrorData>(undefined);
|
const [error, setError] = useState<ErrorData>(undefined);
|
||||||
|
|
||||||
function setSchema(data?: IOperationSchemaData) {
|
function setSchema(data?: IOperationSchemaData) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { RSFormLoader } from '@/models/RSFormLoader';
|
||||||
function useRSFormDetails({ target, version }: { target?: string; version?: string }) {
|
function useRSFormDetails({ target, version }: { target?: string; version?: string }) {
|
||||||
const { loading: userLoading } = useAuth();
|
const { loading: userLoading } = useAuth();
|
||||||
const [schema, setInnerSchema] = useState<IRSForm | undefined>(undefined);
|
const [schema, setInnerSchema] = useState<IRSForm | undefined>(undefined);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(target != undefined);
|
||||||
const [error, setError] = useState<ErrorData>(undefined);
|
const [error, setError] = useState<ErrorData>(undefined);
|
||||||
|
|
||||||
function setSchema(data?: IRSFormData) {
|
function setSchema(data?: IRSFormData) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ function ViewSideLocation({ folderTree, active, setActive: setActive, toggleFold
|
||||||
animate={{ ...animateSideView.animate }}
|
animate={{ ...animateSideView.animate }}
|
||||||
exit={{ ...animateSideView.exit }}
|
exit={{ ...animateSideView.exit }}
|
||||||
>
|
>
|
||||||
<div className='h-[2.08rem] flex justify-between items-center pr-1'>
|
<div className='h-[2.08rem] flex justify-between items-center pr-1 pl-[0.125rem]'>
|
||||||
<BadgeHelp
|
<BadgeHelp
|
||||||
topic={HelpTopic.UI_LIBRARY}
|
topic={HelpTopic.UI_LIBRARY}
|
||||||
className={clsx(PARAMETER.TOOLTIP_WIDTH, 'text-sm')}
|
className={clsx(PARAMETER.TOOLTIP_WIDTH, 'text-sm')}
|
||||||
|
|
|
@ -62,6 +62,7 @@ function LoginPage() {
|
||||||
autoFocus
|
autoFocus
|
||||||
required
|
required
|
||||||
allowEnter
|
allowEnter
|
||||||
|
spellCheck={false}
|
||||||
value={username}
|
value={username}
|
||||||
onChange={event => setUsername(event.target.value)}
|
onChange={event => setUsername(event.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -95,6 +95,7 @@ function FormSignup() {
|
||||||
autoComplete='username'
|
autoComplete='username'
|
||||||
required
|
required
|
||||||
label='Имя пользователя (логин)'
|
label='Имя пользователя (логин)'
|
||||||
|
spellCheck={false}
|
||||||
pattern={patterns.login}
|
pattern={patterns.login}
|
||||||
title='Минимум 3 знака. Латинские буквы и цифры. Не может начинаться с цифры'
|
title='Минимум 3 знака. Латинские буквы и цифры. Не может начинаться с цифры'
|
||||||
value={username}
|
value={username}
|
||||||
|
@ -128,6 +129,7 @@ function FormSignup() {
|
||||||
id='email'
|
id='email'
|
||||||
autoComplete='email'
|
autoComplete='email'
|
||||||
required
|
required
|
||||||
|
spellCheck={false}
|
||||||
label='Электронная почта (email)'
|
label='Электронная почта (email)'
|
||||||
title='электронная почта в корректном формате, например: i.petrov@mycompany.ru.com'
|
title='электронная почта в корректном формате, например: i.petrov@mycompany.ru.com'
|
||||||
value={email}
|
value={email}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6",
|
"target": "ES2022",
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"lib": ["ES2020", "dom", "dom.iterable"],
|
"lib": ["ES2022", "dom", "dom.iterable"],
|
||||||
"module": "esnext",
|
"module": "ES2022",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,11 @@ export default ({ mode }: { mode: string }) => {
|
||||||
...process.env,
|
...process.env,
|
||||||
...loadEnv(mode, process.cwd())
|
...loadEnv(mode, process.cwd())
|
||||||
};
|
};
|
||||||
const enableHttps = process.env.VITE_PORTAL_FRONT_HTTPS === 'true';
|
|
||||||
return defineConfig({
|
return defineConfig({
|
||||||
appType: 'spa',
|
appType: 'spa',
|
||||||
plugins: [react(), muteWarningsPlugin(warningsToIgnore)],
|
plugins: [react(), muteWarningsPlugin(warningsToIgnore)],
|
||||||
server: {
|
server: {
|
||||||
port: Number(process.env.VITE_PORTAL_FRONT_PORT),
|
port: Number(process.env.VITE_PORTAL_FRONT_PORT)
|
||||||
https: enableHttps
|
|
||||||
},
|
},
|
||||||
publicDir: 'public',
|
publicDir: 'public',
|
||||||
build: {
|
build: {
|
||||||
|
|
|
@ -2,25 +2,14 @@
|
||||||
# FOR DEVELOPEMENT BUILDS ONLY!
|
# FOR DEVELOPEMENT BUILDS ONLY!
|
||||||
$container= Read-Host -Prompt "Enter backend container name: "
|
$container= Read-Host -Prompt "Enter backend container name: "
|
||||||
|
|
||||||
$backend = Resolve-Path -Path "$PSScriptRoot\..\..\rsconcept\backend"
|
|
||||||
|
|
||||||
function PopulateDevData() {
|
function PopulateDevData() {
|
||||||
ImportInitialData
|
ImportInitialData
|
||||||
CreateAdmin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ImportInitialData() {
|
function ImportInitialData() {
|
||||||
docker exec `
|
docker exec `
|
||||||
-it $container `
|
-it $container `
|
||||||
python3.12 manage.py loaddata $backend\fixtures\InitialData.json
|
python3.12 manage.py loaddata ./fixtures/InitialData.json
|
||||||
}
|
|
||||||
|
|
||||||
function CreateAdmin() {
|
|
||||||
docker exec `
|
|
||||||
-e DJANGO_SUPERUSER_USERNAME=admin `
|
|
||||||
-e DJANGO_SUPERUSER_PASSWORD=1234 `
|
|
||||||
-e DJANGO_SUPERUSER_EMAIL=admin@admin.com `
|
|
||||||
-it $container python3.12 manage.py createsuperuser --noinput
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PopulateDevData
|
PopulateDevData
|
||||||
|
|
Loading…
Reference in New Issue
Block a user