2024-05-20 13:33:14: merge [main:cbc2424bba8b53605d0eef5e6716b20406f9b312];

This commit is contained in:
txix committed 2024-05-20 13:33:14 +03:00
1 parent 98ad434b36
commit a922f7e914
53 files changed
+1811 -3261

No files matched your search

@@ -2,7 +2,7 @@
.access-list-tree{
overflow-y: scroll;
height: calc(100vh - 250px);
height: calc(100vh - 100px);
&__inner-tag{
margin-left: $basic-margin;
}
+24 -3
View File
@@ -1,9 +1,30 @@
.header {
display: flex;
align-items: center;
padding: 0 28px;
width: 100%;
height: 65px;
justify-content: space-between;
justify-content: center;
box-sizing: border-box;
}
line-height: 18px;
&__text {
margin: auto;
background: inherit;
-webkit-background-clip: text;
color: transparent;
filter: invert(1) grayscale(1);
font-size: 19px;
font-weight: 600;
font-family: 'PT Sans', sans-serif;
padding-right: 120px;
}
&__text-closed {
margin: auto;
background: inherit;
-webkit-background-clip: text;
color: transparent;
filter: invert(1) grayscale(1);
font-weight: 600;
font-family: 'PT Sans', sans-serif;
}
}
+2 -2
View File
@@ -1,3 +1,3 @@
export interface HeaderPropsType {
title: string
}
collapsed: boolean
}
+4 -23
View File
@@ -1,13 +1,10 @@
import { HomeOutlined } from '@ant-design/icons'
import { Breadcrumb } from 'antd'
import { HeaderPropsType } from '@widgets/Header/header.type.ts'
import { useAppSelector } from '@hooks/redux.ts'
import './header.scss'
const Header = ({ title }: HeaderPropsType) => {
const Header = ({ collapsed }: HeaderPropsType) => {
const {
ui: { name, primaryColor }
} = useAppSelector((state) => state.UIReducer)
@@ -19,25 +16,9 @@ const Header = ({ title }: HeaderPropsType) => {
backgroundColor: primaryColor
}}
>
<div>
<Breadcrumb
items={[
{
href: '/',
title: (
<>
<HomeOutlined />
<span>Главная</span>
</>
)
},
{
title: <span>{title}</span>
}
]}
/>
</div>
<span>{name}</span>
<span className={collapsed ? 'header__text-closed' : 'header__text'}>
{name}
</span>
</section>
)
}
+53
View File
@@ -0,0 +1,53 @@
import RefParser from '@apidevtools/json-schema-ref-parser'
import JSONSchemaView from 'json-schema-view-js'
import cloneDeep from 'lodash.clonedeep'
import React, { useEffect, useRef } from 'react'
import 'json-schema-view-js/dist/style.min.css'
interface JsonSchemaViewerProps {
schema: object
}
const JsonSchemaViewer: React.FC<JsonSchemaViewerProps> = ({ schema }) => {
const myRef = useRef<HTMLDivElement>(null)
useEffect(() => {
const schemas = cloneDeep(schema)
let isMounted = true
RefParser.dereference(
schemas,
{
dereference: {
circular: true
}
},
(err: any, dereferencedSchema: any) => {
if (isMounted) {
if (err) {
console.log(err)
} else {
const view = new JSONSchemaView(dereferencedSchema, 3)
if (myRef.current) {
myRef.current.appendChild(view.render())
}
}
}
}
)
return () => {
isMounted = false
if (myRef.current) {
while (myRef.current.firstChild) {
myRef.current.removeChild(myRef.current.firstChild)
}
}
}
}, [schema])
return <div ref={myRef} />
}
export default JsonSchemaViewer
@@ -8,6 +8,6 @@
border: 1px dashed $grey;
overflow-y: scroll;
height: calc(100vh - 160px);
height: calc(100vh - 100px);
}