Починил ошибки в консоли

jwt
Rinsvent 1 year ago
parent 3e8f3943dc
commit c852ef14dd
  1. 1
      components/elements/commands/index.tsx
  2. 10
      components/elements/processes/index.tsx
  3. 5
      components/elements/tokens/index.tsx

@ -34,6 +34,7 @@ export default function Commands() {
}, [value])
let variants = commands.map((command: CommandInterface, index: number) => command.name);
variants.push('')
let callback = (name: string, optionList: Record<string, any>, argumentList: Record<string, any>) => {
setOptionList(optionList)

@ -53,8 +53,8 @@ export default function Processes() {
const [commands, setCommands] = useState<CommandInterface[]>([]);
const [page, setPage] = useState<number>(0);
const [count, setCount] = useState<number>(0);
const [type, setType] = useState<string | null>('');
const [name, setName] = useState<string | null>('');
const [type, setType] = useState<string>('');
const [name, setName] = useState<string>('');
const [loading, setLoading] = useState<boolean>(true);
const [modalLoading, setModalLoading] = useState<boolean>(true);
const [action, setAction] = useState<Action | null>(null);
@ -65,6 +65,7 @@ export default function Processes() {
const api = useApi()
let variants = commands.map((command: CommandInterface, index: number) => command.name);
variants.push('')
let refreshCommands = async () => {
const { data: commands } = await api.useMemory().getCommands()
@ -199,10 +200,10 @@ export default function Processes() {
<Autocomplete
value={type}
onChange={(event: any, newValue: string | null) => {
setType(newValue);
setType(newValue || '');
}}
disablePortal
options={['None', "Running", "History"]}
options={['None', "Running", "History", '']}
renderInput={(params) => <TextField {...params} label="Type"/>}
/>
</Grid>
@ -302,6 +303,7 @@ export default function Processes() {
component="div"
count={count}
rowsPerPage={20}
rowsPerPageOptions={[10, 20, 50, 100]}
page={page}
onPageChange={handleChangePage}
/>

@ -30,7 +30,7 @@ export default function Tokens() {
let variants = tokens.map((token, index) => ({
...token,
label: token.host
label: `${token.host} [${token.id}]`
}));
useEffect(() => {
@ -42,9 +42,10 @@ export default function Tokens() {
<Grid container>
<Grid item xs={2}>
<Autocomplete
freeSolo
value={{
...token,
label: token?.host ?? ''
label: token?.host ? `${token.host} [${token.id}]` : ''
}}
onChange={(event: any, newValue: any) => {
console.log('newValue', newValue);

Loading…
Cancel
Save