Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f01971d5c1 | ||
|
|
46e1ed6e3b | ||
|
|
809253ab6e | ||
|
|
4c78fb587d | ||
|
|
9f1caacc5d | ||
|
|
c89f47321a | ||
|
|
38646e56df | ||
|
|
9dfb0ca7a3 | ||
|
|
cbc1f0f6cc | ||
|
|
c55fa2e7d6 | ||
|
|
1cdf65ff08 | ||
|
|
4306ffcf3d | ||
|
|
d006bf7628 | ||
|
|
554f1470c8 | ||
|
|
490e6168ff | ||
|
|
709e14e501 | ||
|
|
fe295beb7f | ||
|
|
39cf7159e4 | ||
|
|
e87ed7cd68 | ||
|
|
e54ce881b7 | ||
|
|
180cdb750e | ||
|
|
e730b5ace3 | ||
|
|
0b6f6cb8fa | ||
|
|
eb8e1683fb | ||
|
|
e7b680aeb1 | ||
|
|
a7ec8b9489 | ||
|
|
23b9e1a1f0 | ||
|
|
dd7aee01ed | ||
|
|
bf773a58f0 | ||
|
|
ac08aef65c | ||
|
|
03fa976526 | ||
|
|
64852bca9f | ||
|
|
fbad913311 | ||
|
|
685a32ee30 | ||
|
|
75f491520b | ||
|
|
a1c96ab2e7 | ||
|
|
d9543c4a24 | ||
|
|
3ddbdbda6d | ||
|
|
ae26c073e1 | ||
|
|
1a1d2b594c | ||
|
|
3e52a14c0a | ||
|
|
63fa6bc2ab | ||
|
|
e51429a0bb | ||
|
|
10347e8e18 | ||
|
|
83a1cd2205 | ||
|
|
5f4a3c55cc | ||
|
|
9be06cd305 | ||
|
|
2ebeb14f0e | ||
|
|
0dbf4b0b07 | ||
|
|
096c2d401d | ||
|
|
2d08128cb7 | ||
|
|
a7906026d5 | ||
|
|
10b4a7223c | ||
|
|
1e3a0edb7d | ||
|
|
6b782f3538 | ||
|
|
19d3a12469 | ||
|
|
151be0e635 | ||
|
|
031a92db3f | ||
|
|
e8dfc2e552 | ||
|
|
36c13e159d | ||
|
|
a922f7e914 | ||
|
|
98ad434b36 | ||
|
|
739a9a3a4b | ||
|
|
2989c66a65 | ||
|
|
a6f4c85231 | ||
|
|
a31c44eb7b |
No files matched your search
@@ -0,0 +1,2 @@
|
||||
PROXY_URL=
|
||||
VITE_APP_TOKEN=
|
||||
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
tsconfig.json
|
||||
public/config.js
|
||||
vite.config.ts
|
||||
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/typescript"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"node_modules",
|
||||
"build",
|
||||
"generateVersionFile.cjs",
|
||||
"config.template.js"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json",
|
||||
"tsconfigRootDir": "./"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"import",
|
||||
"@typescript-eslint",
|
||||
"react-hooks",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"import/default": "off",
|
||||
"import/no-named-as-default": "off",
|
||||
"prettier/prettier": "off",
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"react/jsx-filename-extension": [
|
||||
1,
|
||||
{
|
||||
"extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".tsx"
|
||||
]
|
||||
}
|
||||
],
|
||||
"react/jsx-one-expression-per-line": "off",
|
||||
"react/prop-types": 0,
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"off"
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": [
|
||||
"off",
|
||||
null
|
||||
],
|
||||
"@typescript-eslint/no-non-null-assertion": [
|
||||
"off"
|
||||
],
|
||||
"import/no-unresolved": "error",
|
||||
"no-unused-vars": "off"
|
||||
},
|
||||
"settings": {
|
||||
"import/parsers": {
|
||||
"@typescript-eslint/parser": [
|
||||
".ts",
|
||||
".tsx"
|
||||
]
|
||||
},
|
||||
"react": {
|
||||
"version": "detect"
|
||||
},
|
||||
"import/resolver": {
|
||||
"typescript": {
|
||||
"alwaysTryTypes": true
|
||||
},
|
||||
"node": {
|
||||
"extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".ts",
|
||||
".tsx"
|
||||
],
|
||||
"moduleDirectory": [
|
||||
"node_modules",
|
||||
"src/"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
name: Create and publish a Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
attestations: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Get version from tag
|
||||
id: version_reader
|
||||
run: |
|
||||
VERSION=${GITHUB_REF_NAME#v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: docker-container
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version_reader.outputs.version }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
labels: |
|
||||
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
|
||||
org.opencontainers.image.version=${{ steps.version_reader.outputs.version }}
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
|
||||
subject-digest: ${{ steps.push.outputs.digest }}
|
||||
push-to-registry: true
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
.idea/
|
||||
dist/
|
||||
build/
|
||||
node_modules/
|
||||
src/**/*.jsx
|
||||
tests/__coverage__/
|
||||
tests/**/*.jsx
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/releases
|
||||
!.yarn/plugins
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
.pnp.*
|
||||
.env
|
||||
version.json
|
||||
@@ -0,0 +1,3 @@
|
||||
include:
|
||||
- project: '$CI_PROJECT_PATH'
|
||||
file: '/ci-isp-ui.yml'
|
||||
@@ -0,0 +1,3 @@
|
||||
build
|
||||
cfg
|
||||
/config.template.js
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"trailingComma": "none",
|
||||
"tabWidth": 2,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "preserve",
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"bracketSameLine": false,
|
||||
"proseWrap": "never",
|
||||
"htmlWhitespaceSensitivity": "strict",
|
||||
"plugins": ["@trivago/prettier-plugin-sort-imports"],
|
||||
"useTabs": false,
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.tsx",
|
||||
"options": {
|
||||
"parser": "typescript"
|
||||
}
|
||||
}
|
||||
],
|
||||
"importOrder": [
|
||||
"^@core/(.*)$",
|
||||
"^@assets/(.*)$",
|
||||
"^@constants/(.*)$",
|
||||
"^@ui/(.*)$",
|
||||
"^@widgets/(.*)$",
|
||||
"^@components/(.*)$",
|
||||
"^@modules/(.*)$",
|
||||
"^@pages/(.*)$",
|
||||
"^@utils/(.*)$",
|
||||
"^@hooks/(.*)$",
|
||||
"^@services/(.*)$",
|
||||
"^@stores/(.*)$",
|
||||
"^@routes/(.*)$",
|
||||
"^@type/(.*)$",
|
||||
"^./*.*.ts",
|
||||
"^[./]",
|
||||
".(scss|css)$"
|
||||
],
|
||||
"importOrderSeparation": true
|
||||
}
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
## 0.21.13
|
||||
- Исправлено поведение, при котором происходила лишняя прокрутка в Column при первом выборе элемента
|
||||
## 0.21.12
|
||||
- добавлен скрипт для сборки и публикации образа в `GitHub Contaier Registry`
|
||||
## 0.21.11
|
||||
- Добавлено отображение версии приложение в шапку меню
|
||||
## 0.21.10
|
||||
- Исправлено "мерцание" экрана "Переменные" при загрузке страницы
|
||||
- Исправлено неверное поведение инпута "поиск приложения по токену" при его очистке
|
||||
- Запрещена возможность отправки пустого значения в инпуте "поиск приложения по токену"
|
||||
- Обновлена библиотека isp-admin-ui-kit
|
||||
## 0.21.9
|
||||
- Обновлены цвета для темной темы
|
||||
- Исправлены цвета текста для темной темы
|
||||
- Исправлено отображение resize-handle для темной темы
|
||||
## 0.21.8
|
||||
- Обновлена версия библиотеки isp-admin-ui-kit(Добавленн поиск приложения по токену и поправлен баг скроллов по всему приоекту)
|
||||
## 0.21.7
|
||||
- Обновлена библиотека компонентов Antd
|
||||
- Исправлено неверное поведение всплывающих подсказок
|
||||
## 0.21.6
|
||||
- Обновлена версия библиотеки isp-ui-kit(высота и скрол меню, сортировка и высота в Column)
|
||||
- Обновлена версия библиотеки isp-admin-ui-kit(По вкладке "Доступы приложений" по кнопке сохранить добавлено модальное окно)
|
||||
## 0.21.5
|
||||
- Обновлена версия библиотеки isp-ui-kit(Блокировка кнопки сохранить на странице редактирвоания конфига)
|
||||
## 0.21.4
|
||||
- Обновлена версия библиотеки isp-ui-kit(Добавлено редактирвоание ID приложений)
|
||||
## 0.21.3
|
||||
- Обновлена версия библиотеки isp-admin-ui-kit (Для переименования конфига использован новый метод)
|
||||
- Обновлена версия библиотеки isp-ui-kit
|
||||
(Добавлено редактирование ID приложений
|
||||
Добавлено кол-во элементов в Column,
|
||||
Добавлена возможность добавлять иконку в заголовок столбца,
|
||||
Изменен тип label для всех компонентов формы, фикс скроллов)
|
||||
## 0.21.2
|
||||
- Обновлена версия библиотеки isp-ui-kit
|
||||
## 0.21.1
|
||||
- Обновлена версия библиотеки isp-admin-ui-kit
|
||||
## 0.21.0
|
||||
- Добавлены разрешения для страниц проекта
|
||||
## 0.20.0
|
||||
- Добавлена страница работы с переменными
|
||||
## 0.19.1
|
||||
- Обновлена версия ui библиотек
|
||||
## 0.19.0
|
||||
- Замена компонента App на компонент AdminBase из библиотеки
|
||||
- Удален весь код, дублирующий компонент AdminBase
|
||||
## 0.18.9
|
||||
- Исправлены дополнительные параметры подключения в форме
|
||||
## 0.18.8
|
||||
- Добавлено кеширование статики для nginx
|
||||
## 0.18.7
|
||||
- Включена поддержка кэширования зависимостей через Docker
|
||||
- Добавлен файл конфигурации nginx
|
||||
## 0.18.6
|
||||
- Обновлена версия библиотеки isp-ui-kit
|
||||
## 0.18.5
|
||||
- Изолирование стилей в ConfirmConfigModal
|
||||
## 0.18.4
|
||||
- Правка стилей модальных окон
|
||||
## 0.18.3
|
||||
- Изменен репозиторий библиотеки isp-ui-kit
|
||||
- Обновлена версия библиотеки isp-ui-kit
|
||||
## 0.18.2
|
||||
- Добавлено закрытие модального окна после изменения пароля
|
||||
- Добавлен рефеч данных профиля пос после обновления роли
|
||||
- Исправлена верстка модального окна
|
||||
- Добавлено отправка формы на странице логина по нажатии Enter
|
||||
## 0.18.1
|
||||
- В разделе модули в таблице подключений модуля для key строк в таблице добавлено id
|
||||
## 0.18.0
|
||||
- Исправлено редактирование JSON в конфиге
|
||||
## 0.17.3
|
||||
- Обновлены зависимости в package.json
|
||||
## 0.17.1
|
||||
- Обновлена библиотека isp-ui-kit
|
||||
## 0.17.0
|
||||
- Codemirror заменен на MonacoEditor
|
||||
## 0.16.0
|
||||
- Добавлена форма на страницу редактора конфигов
|
||||
## 0.15.1
|
||||
- Изменен цвет компонента Tag в ActiveConfigurationsTable
|
||||
- Изменена иконка редакторивания конфига на <FormOutlined />
|
||||
## 0.15.0
|
||||
- Добавлены placeholder для поиска в первом столбце
|
||||
- Добавлен заголовок первого столбца на экране Модули
|
||||
- Изменен интервал поллинга для get_modules на 5 секунд
|
||||
- Изменена логика работы редиректа после окончания сессии
|
||||
## 0.14.2
|
||||
- Исправлено появление экрана после логина
|
||||
- На экране ошибки добавлена кнопка "На главную"
|
||||
- Внутренние улучшения кода
|
||||
## 0.14.1
|
||||
- Исправлено отображение времени создания на странице Токенов
|
||||
## 0.14.0
|
||||
- Для первого столбца добавлен поиск по id элемента
|
||||
## 0.13.4
|
||||
- Установлен monaco-editor для избежания загрузки сторонних файлов при открытии редактора
|
||||
- Удалена в редакторе кода всплывашка Невалидный JSON
|
||||
- В редакторе конфига исправлено добавление новых key, новых элементов масивов
|
||||
## 0.13.3
|
||||
- Добавлено отображение id приложения на экранах страниц 'Приложения' и 'Доступы приложений'
|
||||
- Добавлено фиксирование в localStorage открытое или закрытое меню
|
||||
- Исправлена очистка localStorage после протухания или удаления токена
|
||||
- Исправлены стили для субменю, которые влияли на отображение разрешенных и неразрешенных пунктов меню
|
||||
## 0.13.2
|
||||
- Обновление пермишенов
|
||||
## 0.13.1
|
||||
- В LoginPage исправлен background для темной темы
|
||||
## 0.13.0
|
||||
- Добавлена темная тема
|
||||
## 0.12.6
|
||||
- Добавлены кропки "удалить/добавть" в JsonView
|
||||
- Добавлен скролл к JsonView
|
||||
- Добавлена обработка ошибок к изменению конфига
|
||||
## 0.12.5
|
||||
- Исправлено неверное поведение показа меню
|
||||
- Добавлена страница NotFoundPage
|
||||
## 0.12.4
|
||||
- Уменьшен размер бандла
|
||||
## 0.12.3
|
||||
- Добавлена логика изменения пароля
|
||||
## 0.12.2
|
||||
- Добавлена возможность копирования конфига
|
||||
## 0.12.1
|
||||
- Исправлен шрифт в редакторах кода
|
||||
- Исправлены перерисовки экрана "Модули"
|
||||
## 0.12.0
|
||||
- Добавлена страница редактирования/создания конфига
|
||||
## 0.11.5
|
||||
- Обновлена библиотека isp-ui-kit
|
||||
- Убраны лишние столбцы на странице токенов
|
||||
- Исправлено поведение модального окна на странице Группы приложений
|
||||
- Убран лишний скролл
|
||||
- Различные улучшения дизайна страницы Приложений
|
||||
- Убран Ховер в таблицах на экране Модули
|
||||
- Улучшена ui-логика блокировки/разблокировки пользователя
|
||||
- Добавлена обработка ошибок с существующими значения на экране "Пользователи", "Роли"
|
||||
- Исправлена обработки ошибки 401 на экране логина
|
||||
- Исправлено моргание страницы Модулей
|
||||
## 0.11.4
|
||||
- Правки для прода
|
||||
## 0.11.3
|
||||
- Обновлена версия библиотеки isp-ui-kit
|
||||
## 0.11.2
|
||||
- Обновлен Column
|
||||
- Перенесен Header
|
||||
- Правки стилей для прода
|
||||
## 0.11.1
|
||||
- Проверка на пермишены заменена на компонент CanEdit
|
||||
## 0.11.0
|
||||
- Добавлена страница Конфигураций
|
||||
- Добавлена страница сравнения версий
|
||||
- Исправлен цвет фона на Страницах профиля и Доступов приложения
|
||||
- Исправлен отступ от тега "Внутренний"
|
||||
## 0.10.1
|
||||
- В index.html добавлен config.js
|
||||
- Добавлены динамические стили для админок
|
||||
## 0.10.0
|
||||
- Добавлена страница 'Модули'
|
||||
## 0.9.0
|
||||
- Добавлена страница приложений
|
||||
## 0.8.1
|
||||
- Перенос UserMenu в список главного меню в Layout
|
||||
## 0.8.0
|
||||
- Добавлена страница 'Роли'
|
||||
## 0.7.0
|
||||
- Добавлена страница 'Сессии'
|
||||
## 0.6.0
|
||||
- Добавлена страница 'Просмотр журналов ИБ'
|
||||
## 0.5.0
|
||||
- Добавлена страница 'Пользователи' и страница редактирования пользователя
|
||||
## 0.4.0
|
||||
- Добавлен экран управления доступами приложений
|
||||
- Исправлены корневые стили приложения
|
||||
- Обновлена поддержка пользовательских разрешений для страниц
|
||||
- Добавлена локализация Antd
|
||||
## 0.3.2
|
||||
- Добавлен generateVersionFile.cjs
|
||||
## 0.3.1
|
||||
-Добавлена обработка ошибок в интерсепторсе
|
||||
## 0.3.0
|
||||
- Добавлен экран Профиля
|
||||
- Добавлено хранилище ролей
|
||||
- Изменен пакетный менеджер на npm
|
||||
- Улучшения стилей приложения
|
||||
## 0.2.6
|
||||
- Добавлено модальное окно
|
||||
## 0.2.5
|
||||
- UserMenu изменен и перенесен из Header в Menu из Layout, удален Header
|
||||
## 0.2.4
|
||||
- Изменен Layout
|
||||
## 0.2.3
|
||||
- Добавлен экран входа
|
||||
## 0.2.2
|
||||
- Добавлен редирект после логина
|
||||
## 0.2.1
|
||||
- ThemeProvider заменен на ConfigProvider в компоненте <App>
|
||||
## 0.2.0
|
||||
- Добавлены роли и приватный роутер
|
||||
## 0.1.0
|
||||
- Инициализирован проект
|
||||
- Добавлена темная тема antd
|
||||
- Добавлен layout
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
ARG NODE_VERSION=lts
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine as base
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
FROM base as deps
|
||||
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
npm ci --omit=dev
|
||||
|
||||
FROM deps as build
|
||||
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine-slim as final
|
||||
RUN rm -f /etc/nginx/conf.d/default.conf
|
||||
COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
|
||||
COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui
|
||||
|
||||
COPY entrypoint.sh /opt/msp/isp-admin-ui/entrypoint.sh
|
||||
ENTRYPOINT ["/opt/msp/isp-admin-ui/entrypoint.sh"]
|
||||
@@ -0,0 +1,21 @@
|
||||
FROM dockerhub.mos.ru/mosos/arbat:15.5 as builder-deps
|
||||
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y nodejs14 yarn
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
RUN yarn config set "strict-ssl" false
|
||||
RUN yarn config set "registry" https://repo-mirror.mos.ru/repository/yarn-central/
|
||||
RUN yarn config list
|
||||
RUN yarn --ignore-engines install
|
||||
COPY . ./
|
||||
RUN sed -i 's/github.com/repo-mirror.mos.ru\/repository\/raw-github/g' package.json
|
||||
RUN sed -i 's/registry.yarnpkg.com/repo-mirror.mos.ru\/repository\/yarn-central/g' yarn.lock
|
||||
RUN yarn --ignore-engines build
|
||||
|
||||
FROM dockerhub.mos.ru/mosos/arbat:15.5
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
|
||||
RUN echo "Europe/Moscow" > /etc/timezone
|
||||
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y nginx
|
||||
|
||||
COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
|
||||
COPY --from=build-deps /usr/src/app/build /opt/msp/isp-admin-ui
|
||||
@@ -1,93 +1,31 @@
|
||||
# isp-admin-ui
|
||||
# React + TypeScript + Vite
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
|
||||
Currently, two official plugins are available:
|
||||
|
||||
## Getting started
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
## Expanding the ESLint configuration
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
||||
|
||||
## Add your files
|
||||
- Configure the top-level `parserOptions` property like this:
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin https://gitlab.txix.ru/isp/isp-admin-ui.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```js
|
||||
export default {
|
||||
// other rules...
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
project: ['./tsconfig.json', './tsconfig.node.json'],
|
||||
tsconfigRootDir: __dirname
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](https://gitlab.txix.ru/isp/isp-admin-ui/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
||||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
||||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
||||
1
|
||||
@@ -0,0 +1,56 @@
|
||||
server {
|
||||
listen 8001;
|
||||
server_name localhost;
|
||||
root /opt/msp/isp-admin-ui/;
|
||||
|
||||
location / {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache"; # Для совместимости с HTTP/1.0
|
||||
expires off;
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
|
||||
location /api {
|
||||
client_max_body_size 10M;
|
||||
|
||||
proxy_pass http://isp-gate-service:9003;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
location /assets/ {
|
||||
gzip on;
|
||||
gzip_comp_level 6;
|
||||
gzip_min_length 256;
|
||||
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
||||
gzip_vary on;
|
||||
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
||||
|
||||
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
||||
}
|
||||
|
||||
# Кэширование для шрифтов и изображений (1 неделя)
|
||||
location ~* \.(?:ico|png|jpg|jpeg|svg|gif|webp|ttf|woff|woff2|otf|eot)$ {
|
||||
gzip on;
|
||||
gzip_comp_level 6;
|
||||
gzip_min_length 256;
|
||||
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
||||
gzip_vary on;
|
||||
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
||||
|
||||
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
||||
}
|
||||
|
||||
# Кэширование JS и CSS (1 неделя)
|
||||
location ~* \.(?:js|css)$ {
|
||||
gzip on;
|
||||
gzip_comp_level 6;
|
||||
gzip_min_length 256;
|
||||
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
||||
gzip_vary on;
|
||||
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
||||
|
||||
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONFIG_PATH="/opt/msp/isp-admin-ui/config.js"
|
||||
|
||||
cat <<EOF > $CONFIG_PATH
|
||||
// DON'T TOUCH
|
||||
// THIS FILE FOR PRODUCTION BUILD
|
||||
|
||||
window.config = {
|
||||
ENABLE_PASSWORD_LOGIN: ${ENABLE_PASSWORD_LOGIN:-true},
|
||||
APP_TOKEN: '${APP_TOKEN:-"default_token"}',
|
||||
};
|
||||
EOF
|
||||
|
||||
|
||||
exec nginx -g "daemon off;"
|
||||
@@ -0,0 +1,33 @@
|
||||
const fs = require('fs');
|
||||
const packageJson = require('./package.json');
|
||||
|
||||
function writeJsonFile(filePath, data) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(data));
|
||||
}
|
||||
|
||||
function readHtmlFile(filePath) {
|
||||
return fs.readFileSync(filePath, 'utf8');
|
||||
}
|
||||
|
||||
function writeHtmlFile(filePath, data) {
|
||||
fs.writeFileSync(filePath, data);
|
||||
}
|
||||
|
||||
const welcomePagePath = 'build/index.html';
|
||||
|
||||
let indexHtml = readHtmlFile(welcomePagePath);
|
||||
|
||||
const scriptTagRegex = /<script type="module">window\.AppVersion\s*=\s*'.*';<\/script>/;
|
||||
const scriptTag = `<script type="module">window.AppVersion = '${packageJson.version}';</script>`;
|
||||
indexHtml = indexHtml
|
||||
.replace(scriptTagRegex, '')
|
||||
.replace('</head>', `${scriptTag}</head>`);
|
||||
|
||||
writeHtmlFile(welcomePagePath, indexHtml);
|
||||
|
||||
const versionData = {
|
||||
version: packageJson.version,
|
||||
};
|
||||
|
||||
writeJsonFile('build/version.json', versionData);
|
||||
writeJsonFile('version.json', versionData);
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Панель Администратора</title>
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
<script type="module">
|
||||
window.AppVersion = APP_VERSION
|
||||
</script>
|
||||
<script src="/config.js"></script>
|
||||
<title>Панель администратора</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+13812
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"name": "isp-admin-ui",
|
||||
"private": true,
|
||||
"version": "0.21.13",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "vite build && node generateVersionFile.cjs",
|
||||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||
"prepare": "husky || true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@monaco-editor/react": "^4.6.0",
|
||||
"@reduxjs/toolkit": "^2.2.3",
|
||||
"axios": "^1.7.7",
|
||||
"dayjs": "^1.11.10",
|
||||
"isp-admin-ui-kit": "^0.9.0",
|
||||
"isp-ui-kit": "^0.20.7",
|
||||
"monaco-editor": "^0.52.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.51.2",
|
||||
"react-redux": "^9.1.0",
|
||||
"react-resizable": "^3.0.5",
|
||||
"react-router-dom": "^6.22.3",
|
||||
"simplebar": "^6.2.5",
|
||||
"simplebar-react": "^3.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
"@types/deep-equal": "^1.0.4",
|
||||
"@types/lodash.clonedeep": "^4.5.9",
|
||||
"@types/node": "^20.12.4",
|
||||
"@types/react": "^18.2.74",
|
||||
"@types/react-dom": "^18.2.24",
|
||||
"@types/react-resizable": "^3.0.7",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
||||
"@typescript-eslint/parser": "^7.5.0",
|
||||
"@vitejs/plugin-legacy": "^5.3.2",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"@vitejs/plugin-react-swc": "^3.6.0",
|
||||
"antd": "5.25.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.6",
|
||||
"husky": "^9.0.11",
|
||||
"prettier": "^3.2.5",
|
||||
"sass": "1.74.1",
|
||||
"terser": "^5.30.3",
|
||||
"typescript": "^5.4.3",
|
||||
"vite": "^5.4.10",
|
||||
"vite-bundle-visualizer": "^1.2.1",
|
||||
"vite-plugin-node-polyfills": "^0.21.0",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svgr": "^4.2.0",
|
||||
"vite-tsconfig-paths": "^4.3.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "eslint --fix .",
|
||||
"pre-push": "eslint --fix ."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { loader } from '@monaco-editor/react'
|
||||
import { setupListeners } from '@reduxjs/toolkit/query'
|
||||
import dayjs from 'dayjs'
|
||||
import 'dayjs/locale/ru'
|
||||
import * as monaco from 'monaco-editor'
|
||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
||||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
||||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { Provider } from 'react-redux'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { AdminBase, baseSetupStore } from 'isp-admin-ui-kit'
|
||||
|
||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
||||
|
||||
import 'react-resizable/css/styles.css'
|
||||
import 'simplebar-react/dist/simplebar.min.css'
|
||||
|
||||
self.MonacoEnvironment = {
|
||||
getWorker(_, label) {
|
||||
if (label === 'json') {
|
||||
return new jsonWorker()
|
||||
}
|
||||
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||
return new cssWorker()
|
||||
}
|
||||
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||
return new htmlWorker()
|
||||
}
|
||||
if (label === 'typescript' || label === 'javascript') {
|
||||
return new tsWorker()
|
||||
}
|
||||
return new editorWorker()
|
||||
}
|
||||
}
|
||||
|
||||
loader.config({ monaco })
|
||||
|
||||
loader.init().then()
|
||||
|
||||
dayjs.locale('ru')
|
||||
const store = baseSetupStore()
|
||||
setupListeners(store.dispatch)
|
||||
const root = createRoot(document.getElementById('root') as HTMLElement)
|
||||
|
||||
root.render(
|
||||
<Provider store={store}>
|
||||
<BrowserRouter>
|
||||
<AdminBase />
|
||||
</BrowserRouter>
|
||||
</Provider>
|
||||
)
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/// <reference types="vite/client" />
|
||||
declare const APP_VERSION: string
|
||||
declare module 'json-schema-view-js'
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@assets/*": ["src/assets/*"],
|
||||
"@constants/*": ["src/constants/*"],
|
||||
"@ui/*": ["src/ui/*"],
|
||||
"@widgets/*": ["src/widgets/*"],
|
||||
"@components/*": ["src/components/*"],
|
||||
"@modules/*": ["src/modules/*"],
|
||||
"@hooks/*": ["src/hooks/*"],
|
||||
"@pages/*": ["src/pages/*"],
|
||||
"@services/*": ["src/services/*"],
|
||||
"@stores/*": ["src/stores/*"],
|
||||
"@type/*": ["src/type/*"],
|
||||
"@utils/*": ["src/utils/*"],
|
||||
"@routes/*": ["src/routes/*"]
|
||||
},
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
grep version package.json | sed 's/.*"version": "\(.*\)".*/\1/'
|
||||
@@ -0,0 +1,46 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
||||
import svgr from 'vite-plugin-svgr'
|
||||
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
return {
|
||||
optimizeDeps: { exclude: [] },
|
||||
define: {
|
||||
__APP_ENV__: env.APP_ENV,
|
||||
APP_VERSION: JSON.stringify(process.env.npm_package_version)
|
||||
},
|
||||
build: {
|
||||
minify: 'esbuild',
|
||||
sourcemap: mode !== 'production',
|
||||
outDir: 'build',
|
||||
chunkSizeWarningLimit: 1600,
|
||||
commonjsOptions: { transformMixedEsModules: true },
|
||||
esbuild: {
|
||||
target: 'es2020',
|
||||
legalComments: 'none'
|
||||
}
|
||||
},
|
||||
server: {
|
||||
watch: {
|
||||
usePolling: true
|
||||
},
|
||||
host: true,
|
||||
strictPort: true,
|
||||
port: 8000,
|
||||
proxy: {
|
||||
'/api': env.PROXY_URL
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
svgr(),
|
||||
tsconfigPaths(),
|
||||
nodePolyfills({ globals: { process: true } })
|
||||
]
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user