2024-06-28 14:52:13: merge [main:483f760b403ae5c9d0cb5ace25a08bf0b5f41799];
This commit is contained in:
1 parent
0dbf4b0b07
commit
2ebeb14f0e
32 files changed
+113
-72
No files matched your search
@@ -10,11 +10,13 @@
|
||||
&__table {
|
||||
&__name-field {
|
||||
input {
|
||||
color: #606060;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
|
||||
&:focus-visible {
|
||||
color: var(--ant-color-text);
|
||||
padding: $basic-padding;
|
||||
border-radius: 4px;
|
||||
outline: 1px solid $blue-color;
|
||||
@@ -34,7 +36,7 @@
|
||||
|
||||
.active-config {
|
||||
tr {
|
||||
background: $blue-light;
|
||||
background: var(--ant-color-info-bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-3
@@ -1,8 +1,8 @@
|
||||
import { ConfigProvider } from 'antd'
|
||||
import ruRu from 'antd/locale/ru_RU'
|
||||
import { useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import { lightTheme } from '@constants/theme.ts'
|
||||
import { darkTheme, lightTheme } from '@constants/theme.ts'
|
||||
|
||||
import { Context } from '@stores/index.tsx'
|
||||
|
||||
@@ -12,10 +12,19 @@ import './app.scss'
|
||||
|
||||
const App = () => {
|
||||
const [themes, setTheme] = useState(lightTheme)
|
||||
const [changeTheme, setChangeTheme] = useState(
|
||||
localStorage.getItem('theme')
|
||||
? JSON.parse(localStorage.getItem('theme') || '')
|
||||
: true
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
setTheme(() => (changeTheme ? darkTheme : lightTheme))
|
||||
}, [changeTheme])
|
||||
|
||||
return (
|
||||
<div className="app">
|
||||
<Context.Provider value={{ setTheme }}>
|
||||
<Context.Provider value={{ setTheme, setChangeTheme, changeTheme }}>
|
||||
<ConfigProvider theme={themes} locale={ruRu}>
|
||||
<Routers />
|
||||
</ConfigProvider>
|
||||
|
||||
@@ -31,11 +31,6 @@
|
||||
|
||||
&__row {
|
||||
cursor: pointer;
|
||||
&.ant-table-row {
|
||||
&:hover td {
|
||||
background-color: white !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EditorState, EditorView } from '@uiw/react-codemirror'
|
||||
import { Button, Spin, Table } from 'antd'
|
||||
import { ColumnsType } from 'antd/es/table'
|
||||
import { FC, memo, useState } from 'react'
|
||||
import { FC, memo, useContext, useState } from 'react'
|
||||
import CodeMirrorMerge from 'react-codemirror-merge'
|
||||
|
||||
import Modal from '@widgets/Modal'
|
||||
@@ -20,6 +20,7 @@ import { VersionType } from '@type/version.type'
|
||||
import './compare-version-modal.scss'
|
||||
import dayjs from 'dayjs'
|
||||
import { dateFormats } from '@constants/date.ts'
|
||||
import { Context } from '@stores/index.tsx'
|
||||
|
||||
|
||||
const Original = CodeMirrorMerge.Original
|
||||
@@ -37,6 +38,7 @@ const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
||||
const { data: allUsers = [], isLoading: isUsersLoading } =
|
||||
userServiceApi.useGetAllUsersQuery()
|
||||
const { profile } = useAppSelector((state) => state.profileReducer)
|
||||
const { changeTheme } = useContext(Context)
|
||||
const isLoading = isVersionLoading || isUsersLoading
|
||||
if (isLoading) {
|
||||
return <Spin />
|
||||
@@ -79,7 +81,10 @@ const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
||||
<span> Версия: {selectedItem.configVersion}</span>
|
||||
<span>{config?.version ? `Текущая версия : ${config?.version}` : `Версия: ${config?.configVersion}`}</span>
|
||||
</div>
|
||||
<CodeMirrorMerge orientation="a-b">
|
||||
<CodeMirrorMerge
|
||||
orientation="a-b"
|
||||
theme={changeTheme ? 'dark' : 'light'}
|
||||
>
|
||||
<Original
|
||||
value={JSON.stringify(sortObject(selectedItem.data), null, 2)}
|
||||
/>
|
||||
@@ -95,7 +100,6 @@ const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
||||
) : (
|
||||
<div className="compare-version-modal__content__table">
|
||||
<Table
|
||||
rowClassName="compare-version-modal__content__table__row"
|
||||
size="small"
|
||||
columns={columns}
|
||||
pagination={{ pageSize: 30 }}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { FC } from 'react'
|
||||
import { FC, useContext } from 'react'
|
||||
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage'
|
||||
import Editor from '@monaco-editor/react'
|
||||
import { ConfigType } from '@pages/ModulesPage/module.type.ts'
|
||||
import { message } from 'antd'
|
||||
import { Context } from '@stores/index.tsx'
|
||||
|
||||
const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBtn= () => {}, bufConfig, setBufConfig }) => {
|
||||
const { changeTheme } = useContext(Context)
|
||||
const debounce = (func: (...args: any[]) => void, wait: number) => {
|
||||
let timeout: NodeJS.Timeout
|
||||
return (...args: []) => {
|
||||
@@ -44,7 +46,7 @@ const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({setDisableBt
|
||||
width="auto"
|
||||
height="100vh"
|
||||
language="json"
|
||||
theme="vs-white"
|
||||
theme={changeTheme ? 'vs-dark' : 'vs-white'}
|
||||
value={editorValue}
|
||||
onChange={handleChange}
|
||||
options={{
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { FC } from 'react'
|
||||
import { FC, useContext } from 'react'
|
||||
import {ConfigurationEditorPropsType} from '@pages/ConfigurationEditorPage'
|
||||
import { ReactJsonView } from 'isp-ui-kit'
|
||||
import {Spin} from 'antd'
|
||||
import { cleanEmptyParamsObject } from '@utils/objectUtils.ts'
|
||||
import { Context } from '@stores/index.tsx'
|
||||
|
||||
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading}) => {
|
||||
const { changeTheme } = useContext(Context)
|
||||
if (isCurrentConfigLoading) {
|
||||
return <Spin className="spin" />
|
||||
}
|
||||
@@ -19,9 +21,9 @@ const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig =
|
||||
|
||||
return (
|
||||
<ReactJsonView
|
||||
theme={ changeTheme ? 'twilight' : ''}
|
||||
onAdd={true}
|
||||
onDelete={({updated_src}: any) => handleEdit(updated_src)}
|
||||
|
||||
displayDataTypes={false}
|
||||
displayObjectSize={false}
|
||||
name={null}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { ReactJsonView } from 'isp-ui-kit'
|
||||
import { FC, memo } from 'react'
|
||||
import { FC, memo, useContext } from 'react'
|
||||
|
||||
import Modal from '@widgets/Modal'
|
||||
|
||||
import { ConfigurationPreviewModalPropsType } from '@components/ConfigurationPreviewModal/configuration-preview-modal.type.ts'
|
||||
|
||||
import './configuration-preview-modal.scss'
|
||||
import { Context } from '@stores/index.tsx'
|
||||
|
||||
|
||||
const ConfigurationPreviewModal: FC<ConfigurationPreviewModalPropsType> = ({
|
||||
@@ -14,6 +15,7 @@ const ConfigurationPreviewModal: FC<ConfigurationPreviewModalPropsType> = ({
|
||||
open,
|
||||
onClose
|
||||
}) => {
|
||||
const { changeTheme } = useContext(Context)
|
||||
const data = JSON.parse(JSON.stringify(config.data || {}))
|
||||
const configName = versionCompare
|
||||
? `Версия: ${config.configVersion}`
|
||||
@@ -22,6 +24,7 @@ const ConfigurationPreviewModal: FC<ConfigurationPreviewModalPropsType> = ({
|
||||
<div className="configuration-preview-modal">
|
||||
<Modal title={configName || ''} open={open} onClose={onClose}>
|
||||
<ReactJsonView
|
||||
theme={ changeTheme ? 'twilight' : ''}
|
||||
src={data}
|
||||
name={false}
|
||||
sortKeys={true}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
}
|
||||
|
||||
.ant-menu-title-content {
|
||||
color: #1B1B1B;
|
||||
padding-left: 10px
|
||||
}
|
||||
}
|
||||
@@ -30,7 +29,7 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
border-bottom: 1px solid lightgray;
|
||||
border-bottom: 1px solid var(--ant-color-border);
|
||||
border-radius: 0 !important;
|
||||
|
||||
& .ant-menu-submenu-title {
|
||||
|
||||
Reference in new issue
Block a user