add vector upsert ability

This commit is contained in:
Henry
2023-11-16 18:34:17 +00:00
parent 9205a29787
commit 44cadc1cc3
108 changed files with 10019 additions and 4726 deletions
@@ -123,7 +123,14 @@ const NodeInfoDialog = ({ show, dialogProps, onCancel }) => {
</div>
)}
{getNodeConfigApi.data && getNodeConfigApi.data.length > 0 && (
<TableViewOnly rows={getNodeConfigApi.data} columns={Object.keys(getNodeConfigApi.data[0]).slice(-3)} />
<TableViewOnly
rows={getNodeConfigApi.data.map((obj) => {
// eslint-disable-next-line
const { node, nodeId, ...rest } = obj
return rest
})}
columns={Object.keys(getNodeConfigApi.data[0]).slice(-3)}
/>
)}
</DialogContent>
</Dialog>
+7 -8
View File
@@ -1,11 +1,11 @@
import PropTypes from 'prop-types'
import { TableContainer, Table, TableHead, TableCell, TableRow, TableBody, Paper } from '@mui/material'
export const TableViewOnly = ({ columns, rows }) => {
export const TableViewOnly = ({ columns, rows, sx }) => {
return (
<>
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label='simple table'>
<Table sx={{ minWidth: 650, ...sx }} aria-label='simple table'>
<TableHead>
<TableRow>
{columns.map((col, index) => (
@@ -16,11 +16,9 @@ export const TableViewOnly = ({ columns, rows }) => {
<TableBody>
{rows.map((row, index) => (
<TableRow key={index} sx={{ '&:last-child td, &:last-child th': { border: 0 } }}>
{Object.keys(row)
.slice(-3)
.map((key, index) => (
<TableCell key={index}>{row[key]}</TableCell>
))}
{Object.keys(row).map((key, index) => (
<TableCell key={index}>{row[key]}</TableCell>
))}
</TableRow>
))}
</TableBody>
@@ -32,5 +30,6 @@ export const TableViewOnly = ({ columns, rows }) => {
TableViewOnly.propTypes = {
rows: PropTypes.array,
columns: PropTypes.array
columns: PropTypes.array,
sx: PropTypes.object
}