disabling buttons if there is a error

main
alex 2023-09-12 18:53:41 +02:00
parent a7c1780070
commit d16e1e8f86
3 changed files with 25 additions and 7 deletions

View File

@ -162,7 +162,13 @@
"role.title": "Rolle", "role.title": "Rolle",
"groupId.title": "Gruppen ID" "groupId.title": "Gruppen ID"
}, },
"card": { "checkbox": { "info": "INFO", "error": "FEHLER" } }, "card": {
"checkbox": {
"autoScroll": "Auto scroll",
"info": "INFO",
"error": "FEHLER"
}
},
"tooltip": { "tooltip": {
"previous": "Vorige", "previous": "Vorige",
"next": "Nächste" "next": "Nächste"

View File

@ -162,7 +162,13 @@
"role.title": "Role", "role.title": "Role",
"groupId.title": "Group ID" "groupId.title": "Group ID"
}, },
"card": { "checkbox": { "info": "INFO", "error": "ERROR" } }, "card": {
"checkbox": {
"autoScroll": "Auto scroll",
"info": "INFO",
"error": "ERROR"
}
},
"tooltip": { "tooltip": {
"previous": "Previous", "previous": "Previous",
"next": "Next" "next": "Next"

View File

@ -1,5 +1,4 @@
import { ReloadOutlined } from "@ant-design/icons"; import { Card, Checkbox, Col, Row, Select, Spin } from "antd";
import { Card, Checkbox, Col, Row, Select, Space, Spin, Tooltip } from "antd";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { Constants, myFetch } from "../../utils"; import { Constants, myFetch } from "../../utils";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@ -122,9 +121,13 @@ export default function LogCard({
useEffect(() => { useEffect(() => {
// scroll to bottom // scroll to bottom
if (checkboxAutoScrollChecked && virtuosoRef.current !== undefined) { if (
checkboxAutoScrollChecked &&
virtuosoRef.current !== undefined &&
virtuosoRef.current.scrollToIndex !== null
) {
virtuosoRef.current.scrollToIndex({ virtuosoRef.current.scrollToIndex({
index: logs.length - 5, index: logs.length - 1,
align: "start", align: "start",
behavior: "auto", behavior: "auto",
}); });
@ -148,11 +151,12 @@ export default function LogCard({
setCheckboxAutoScrollChecked(e.target.checked) setCheckboxAutoScrollChecked(e.target.checked)
} }
> >
Auto scroll {t("logCard.card.checkbox.autoScroll")}
</Checkbox> </Checkbox>
</Col> </Col>
<Col> <Col>
<Checkbox <Checkbox
disabled={customResult !== undefined}
checked={checkboxInfoChecked} checked={checkboxInfoChecked}
onChange={(e) => setCheckboxInfoChecked(e.target.checked)} onChange={(e) => setCheckboxInfoChecked(e.target.checked)}
> >
@ -161,6 +165,7 @@ export default function LogCard({
</Col> </Col>
<Col> <Col>
<Checkbox <Checkbox
disabled={customResult !== undefined}
checked={checkboxErrorChecked} checked={checkboxErrorChecked}
onChange={(e) => setCheckboxErrorChecked(e.target.checked)} onChange={(e) => setCheckboxErrorChecked(e.target.checked)}
> >
@ -170,6 +175,7 @@ export default function LogCard({
<Col> <Col>
<Select <Select
disabled={customResult !== undefined}
style={{ width: 120 }} style={{ width: 120 }}
options={availableDates} options={availableDates}
value={selectedDate} value={selectedDate}