mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Fix height calculation for different DPI
This commit is contained in:
parent
b84bc82c02
commit
b34caf2683
|
@ -234,21 +234,20 @@ class RSFormViewSet(viewsets.GenericViewSet, generics.ListAPIView, generics.Retr
|
||||||
@action(detail=True, methods=['post'])
|
@action(detail=True, methods=['post'])
|
||||||
def check(self, request, pk):
|
def check(self, request, pk):
|
||||||
''' Endpoint: Check RSLang expression against schema context. '''
|
''' Endpoint: Check RSLang expression against schema context. '''
|
||||||
schema = s.PyConceptAdapter(self._get_schema())
|
|
||||||
serializer = s.ExpressionSerializer(data=request.data)
|
serializer = s.ExpressionSerializer(data=request.data)
|
||||||
serializer.is_valid(raise_exception=True)
|
serializer.is_valid(raise_exception=True)
|
||||||
expression = serializer.validated_data['expression']
|
expression = serializer.validated_data['expression']
|
||||||
|
schema = s.PyConceptAdapter(self._get_schema())
|
||||||
result = pyconcept.check_expression(json.dumps(schema.data), expression)
|
result = pyconcept.check_expression(json.dumps(schema.data), expression)
|
||||||
return Response(json.loads(result))
|
return Response(json.loads(result))
|
||||||
|
|
||||||
@action(detail=True, methods=['post'])
|
@action(detail=True, methods=['post'])
|
||||||
def resolve(self, request, pk):
|
def resolve(self, request, pk):
|
||||||
''' Endpoint: Resolve refenrces in text against schema terms context. '''
|
''' Endpoint: Resolve refenrces in text against schema terms context. '''
|
||||||
schema = self._get_schema()
|
|
||||||
serializer = s.TextSerializer(data=request.data)
|
serializer = s.TextSerializer(data=request.data)
|
||||||
serializer.is_valid(raise_exception=True)
|
serializer.is_valid(raise_exception=True)
|
||||||
text = serializer.validated_data['text']
|
text = serializer.validated_data['text']
|
||||||
resolver = schema.resolver()
|
resolver = self._get_schema().resolver()
|
||||||
resolver.resolve(text)
|
resolver.resolve(text)
|
||||||
return Response(status=200, data=s.ResolverSerializer(resolver).data)
|
return Response(status=200, data=s.ResolverSerializer(resolver).data)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { urls } from '../utils/constants';
|
||||||
|
|
||||||
function Footer() {
|
function Footer() {
|
||||||
return (
|
return (
|
||||||
<footer className='z-50 px-4 pt-2 pb-4 text-sm select-none whitespace-nowrap clr-footer'>
|
<footer className='z-50 px-4 py-2 text-sm select-none whitespace-nowrap clr-footer'>
|
||||||
<div className='flex items-stretch justify-center w-full gap-4 mx-auto'>
|
<div className='flex items-stretch justify-center w-full gap-4 mx-auto'>
|
||||||
<div className='underline'>
|
<div className='underline'>
|
||||||
<Link to='/library' tabIndex={-1}>Библиотека</Link> <br/>
|
<Link to='/library' tabIndex={-1}>Библиотека</Link> <br/>
|
||||||
|
|
|
@ -58,14 +58,14 @@ export const ThemeState = ({ children }: ThemeStateProps) => {
|
||||||
const mainHeight = useMemo(
|
const mainHeight = useMemo(
|
||||||
() => {
|
() => {
|
||||||
return !noNavigation ?
|
return !noNavigation ?
|
||||||
'calc(100vh - 8rem)'
|
'calc(100vh - 7rem - 2px)'
|
||||||
: '100vh';
|
: '100vh';
|
||||||
}, [noNavigation]);
|
}, [noNavigation]);
|
||||||
|
|
||||||
const viewportHeight = useMemo(
|
const viewportHeight = useMemo(
|
||||||
() => {
|
() => {
|
||||||
return !noNavigation ?
|
return !noNavigation ?
|
||||||
'calc(100vh - 3.9rem)'
|
'calc(100vh - 3rem - 2px)'
|
||||||
: '100vh';
|
: '100vh';
|
||||||
}, [noNavigation]);
|
}, [noNavigation]);
|
||||||
|
|
||||||
|
|
|
@ -338,8 +338,8 @@ function EditorTermGraph({ onOpenEdit, onCreateCst, onDeleteCst }: EditorTermGra
|
||||||
const canvasHeight = useMemo(
|
const canvasHeight = useMemo(
|
||||||
() => {
|
() => {
|
||||||
return !noNavigation ?
|
return !noNavigation ?
|
||||||
'calc(100vh - 10.1rem)'
|
'calc(100vh - 9.8rem - 4px)'
|
||||||
: 'calc(100vh - 2.1rem)';
|
: 'calc(100vh - 3rem - 4px)';
|
||||||
}, [noNavigation]);
|
}, [noNavigation]);
|
||||||
|
|
||||||
const dismissedStyle = useCallback(
|
const dismissedStyle = useCallback(
|
||||||
|
@ -460,7 +460,7 @@ function EditorTermGraph({ onOpenEdit, onCreateCst, onDeleteCst }: EditorTermGra
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full h-full overflow-auto'>
|
<div className='w-full h-full overflow-auto border'>
|
||||||
<div
|
<div
|
||||||
className='relative'
|
className='relative'
|
||||||
style={{width: canvasWidth, height: canvasHeight, borderBottomWidth: noNavigation ? '1px': ''}}
|
style={{width: canvasWidth, height: canvasHeight, borderBottomWidth: noNavigation ? '1px': ''}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user