Skip to content

Commit 8647eba

Browse files
committed
Добавлены новые маршруты и схемы для управления переменными окружения в API.
- В swagger_api.json добавлены маршруты для получения, создания, удаления и перезагрузки переменных окружения. - Обновлены схемы данных для поддержки операций с переменными окружения, включая EnvironmentVariable и SetEnvironmentVariableRequest. - Внедрены новые компоненты и страницы для управления переменными окружения в интерфейсе. - Оптимизированы стили и структура компонентов MikuMonday для улучшения пользовательского интерфейса.
1 parent e9b6d5c commit 8647eba

File tree

76 files changed

+2308
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2308
-237
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: дробим большие страницы на мелкие компоненты с zustand-хранилищем
3+
alwaysApply: true
4+
---
5+
6+
- избегайте единого громоздкого файла страницы (например, `EnvironmentVariablesPage.tsx`); каждый крупный блок интерфейса выделяйте в отдельный компонент
7+
- размещайте дроблёные компоненты в поддиректории текущей страницы (`./components`, `./sections` или аналогичное имя), чтобы поддерживать близость логики и стилей
8+
- храните общий стейт, эффекты и бизнес-логику только в zustand-store: создайте hook вида `useEnvironmentVariablesStore` в соседнем файле и экспортируйте из него селекторы/экшены
9+
- в компонентах используйте селекторы `useXxxStore(state => state.someSlice)`; не прокидывайте эти данные через пропсы между дочерними элементами
10+
- через пропсы передавайте только уникальные идентификаторы, event-handlers или значения, которые по бизнес-причине не должны жить в store (например, локальный UI state модалки)
11+
- если компоненту нужны сразу несколько значений, объединяйте их селектором в одну выборку (`useXxxStore(state => ({ ... }))`), чтобы избежать лишних перерисовок
12+
- эффектные операции (загрузка, сохранение и т.п.) оформляйте как действия внутри zustand-store и вызывайте их из компонентов напрямую через селекторы, а не через промежуточные пропсы

api/swagger_api.json

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,6 +1503,198 @@
15031503
}
15041504
}
15051505
},
1506+
"/api/EnvironmentVariable": {
1507+
"get": {
1508+
"tags": [
1509+
"EnvironmentVariable"
1510+
],
1511+
"responses": {
1512+
"200": {
1513+
"description": "OK",
1514+
"content": {
1515+
"text/plain": {
1516+
"schema": {
1517+
"$ref": "#/components/schemas/EnvironmentVariableListOperationResult"
1518+
}
1519+
},
1520+
"application/json": {
1521+
"schema": {
1522+
"$ref": "#/components/schemas/EnvironmentVariableListOperationResult"
1523+
}
1524+
},
1525+
"text/json": {
1526+
"schema": {
1527+
"$ref": "#/components/schemas/EnvironmentVariableListOperationResult"
1528+
}
1529+
}
1530+
}
1531+
}
1532+
}
1533+
},
1534+
"post": {
1535+
"tags": [
1536+
"EnvironmentVariable"
1537+
],
1538+
"requestBody": {
1539+
"content": {
1540+
"application/json": {
1541+
"schema": {
1542+
"allOf": [
1543+
{
1544+
"$ref": "#/components/schemas/SetEnvironmentVariableRequest"
1545+
}
1546+
]
1547+
}
1548+
},
1549+
"text/json": {
1550+
"schema": {
1551+
"allOf": [
1552+
{
1553+
"$ref": "#/components/schemas/SetEnvironmentVariableRequest"
1554+
}
1555+
]
1556+
}
1557+
},
1558+
"application/*+json": {
1559+
"schema": {
1560+
"allOf": [
1561+
{
1562+
"$ref": "#/components/schemas/SetEnvironmentVariableRequest"
1563+
}
1564+
]
1565+
}
1566+
}
1567+
}
1568+
},
1569+
"responses": {
1570+
"200": {
1571+
"description": "OK",
1572+
"content": {
1573+
"text/plain": {
1574+
"schema": {
1575+
"$ref": "#/components/schemas/OperationResult"
1576+
}
1577+
},
1578+
"application/json": {
1579+
"schema": {
1580+
"$ref": "#/components/schemas/OperationResult"
1581+
}
1582+
},
1583+
"text/json": {
1584+
"schema": {
1585+
"$ref": "#/components/schemas/OperationResult"
1586+
}
1587+
}
1588+
}
1589+
}
1590+
}
1591+
}
1592+
},
1593+
"/api/EnvironmentVariable/{key}": {
1594+
"get": {
1595+
"tags": [
1596+
"EnvironmentVariable"
1597+
],
1598+
"parameters": [
1599+
{
1600+
"name": "key",
1601+
"in": "path",
1602+
"required": true,
1603+
"schema": {
1604+
"type": "string"
1605+
}
1606+
}
1607+
],
1608+
"responses": {
1609+
"200": {
1610+
"description": "OK",
1611+
"content": {
1612+
"text/plain": {
1613+
"schema": {
1614+
"$ref": "#/components/schemas/EnvironmentVariableOperationResult"
1615+
}
1616+
},
1617+
"application/json": {
1618+
"schema": {
1619+
"$ref": "#/components/schemas/EnvironmentVariableOperationResult"
1620+
}
1621+
},
1622+
"text/json": {
1623+
"schema": {
1624+
"$ref": "#/components/schemas/EnvironmentVariableOperationResult"
1625+
}
1626+
}
1627+
}
1628+
}
1629+
}
1630+
},
1631+
"delete": {
1632+
"tags": [
1633+
"EnvironmentVariable"
1634+
],
1635+
"parameters": [
1636+
{
1637+
"name": "key",
1638+
"in": "path",
1639+
"required": true,
1640+
"schema": {
1641+
"type": "string"
1642+
}
1643+
}
1644+
],
1645+
"responses": {
1646+
"200": {
1647+
"description": "OK",
1648+
"content": {
1649+
"text/plain": {
1650+
"schema": {
1651+
"$ref": "#/components/schemas/OperationResult"
1652+
}
1653+
},
1654+
"application/json": {
1655+
"schema": {
1656+
"$ref": "#/components/schemas/OperationResult"
1657+
}
1658+
},
1659+
"text/json": {
1660+
"schema": {
1661+
"$ref": "#/components/schemas/OperationResult"
1662+
}
1663+
}
1664+
}
1665+
}
1666+
}
1667+
}
1668+
},
1669+
"/api/EnvironmentVariable/reload": {
1670+
"post": {
1671+
"tags": [
1672+
"EnvironmentVariable"
1673+
],
1674+
"responses": {
1675+
"200": {
1676+
"description": "OK",
1677+
"content": {
1678+
"text/plain": {
1679+
"schema": {
1680+
"$ref": "#/components/schemas/OperationResult"
1681+
}
1682+
},
1683+
"application/json": {
1684+
"schema": {
1685+
"$ref": "#/components/schemas/OperationResult"
1686+
}
1687+
},
1688+
"text/json": {
1689+
"schema": {
1690+
"$ref": "#/components/schemas/OperationResult"
1691+
}
1692+
}
1693+
}
1694+
}
1695+
}
1696+
}
1697+
},
15061698
"/api/Framedata/characters": {
15071699
"get": {
15081700
"tags": [
@@ -7053,6 +7245,54 @@
70537245
},
70547246
"additionalProperties": false
70557247
},
7248+
"EnvironmentVariable": {
7249+
"required": [
7250+
"createdAt",
7251+
"key",
7252+
"updatedAt"
7253+
],
7254+
"type": "object",
7255+
"properties": {
7256+
"key": {
7257+
"type": "string"
7258+
},
7259+
"value": {
7260+
"type": "string",
7261+
"nullable": true
7262+
},
7263+
"description": {
7264+
"type": "string",
7265+
"nullable": true
7266+
},
7267+
"createdAt": {
7268+
"type": "string",
7269+
"format": "date-time"
7270+
},
7271+
"updatedAt": {
7272+
"type": "string",
7273+
"format": "date-time"
7274+
}
7275+
},
7276+
"additionalProperties": false
7277+
},
7278+
"EnvironmentVariableListOperationResult": {
7279+
"allOf": [
7280+
{
7281+
"$ref": "#/components/schemas/OperationResult"
7282+
}
7283+
],
7284+
"description": "Результат операции с данными типа EnvironmentVariable[]",
7285+
"x-generic-type-argument": "EnvironmentVariable[]"
7286+
},
7287+
"EnvironmentVariableOperationResult": {
7288+
"allOf": [
7289+
{
7290+
"$ref": "#/components/schemas/OperationResult"
7291+
}
7292+
],
7293+
"description": "Результат операции с данными типа EnvironmentVariable",
7294+
"x-generic-type-argument": "EnvironmentVariable"
7295+
},
70567296
"FollowerInfo": {
70577297
"required": [
70587298
"userId"
@@ -8572,6 +8812,26 @@
85728812
"description": "Результат операции с данными типа ServiceLog[]",
85738813
"x-generic-type-argument": "ServiceLog[]"
85748814
},
8815+
"SetEnvironmentVariableRequest": {
8816+
"required": [
8817+
"key"
8818+
],
8819+
"type": "object",
8820+
"properties": {
8821+
"key": {
8822+
"type": "string"
8823+
},
8824+
"value": {
8825+
"type": "string",
8826+
"nullable": true
8827+
},
8828+
"description": {
8829+
"type": "string",
8830+
"nullable": true
8831+
}
8832+
},
8833+
"additionalProperties": false
8834+
},
85758835
"StreamArchiveConfig": {
85768836
"required": [
85778837
"checkSpan",

0 commit comments

Comments
 (0)