import { Divider, Group, Stack, TagsInput, TextInput } from '@mantine/core'; import { useLocalStorage } from '@mantine/hooks'; import { useState } from 'react'; import type { GridlerColumns } from '../components/Column'; import { APIAdaptorGoLangv2 } from '../components/APIAdaptorGoLangv2'; import { Gridler } from '../Gridler'; export const GridlerGoAPIExampleEventlog = () => { const [apiUrl, setApiUrl] = useLocalStorage({ defaultValue: 'http://localhost:8080/api', key: 'apiurl', }); const [apiKey, setApiKey] = useLocalStorage({ defaultValue: '', key: 'apikey' }); const [selectRow, setSelectRow] = useState(''); const [values, setValues] = useState>>([]); const columns: GridlerColumns = [ { id: 'id_process', title: 'RID', width: 100, }, { id: 'process', title: 'Process', tooltip: (buffer) => { return `Process: ${buffer?.process}\nType: ${buffer?.processtype}\nStatus: ${buffer?.status}`; }, width: 200, }, { id: 'processtype', title: 'Type', }, { disableSort: true, id: 'status', title: 'Status', width: 100, }, ]; return (

Demo Using Go API Adaptor

setApiUrl(e.target.value)} value={apiUrl} /> setApiKey(e.target.value)} value={apiKey} /> { return [ ...(defaultItems ?? []), // { // id: 'test', // label: `Test -${id}`, // onClick: () => { // console.log('Test clicked', row, col); // }, // }, ]; }} keyField="id_process" onChange={(v) => { //console.log('GridlerGoAPIExampleEventlog onChange', v); setValues(v); }} sections={{ bottom:
bottom
, left:
L
, right:
R
, top:
top
, }} selectedRow={selectRow ? parseInt(selectRow, 10) : undefined} selectMode="row" uniqueid="gridtest" values={values} >
setSelectRow(e.target.value)} placeholder="row" value={selectRow} w="90px" /> setValues(str.map((v) => ({ id_process: String(v) })))} placeholder="Values" value={values.map((v) => String(v?.id_process))} /> ;
); };