Skip to content

Commit

Permalink
improvements to autopilot.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed May 28, 2024
1 parent c6265ac commit b26aea1
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions src/views/endpoint/autopilot/AutopilotAddDevice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ Error.propTypes = {
const AddAPDevice = () => {
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()
const [autopilotData, setAutopilotdata] = useState([])
const completeColumns = [
{
name: 'Serial Number',
selector: (row) => row['serialNumber'],
sortable: true,
},
{
name: 'Status',
selector: (row) => row['status'],
sortable: true,
},
{
name: 'Error Code',
selector: (row) => row['errorCode'],
sortable: true,
},
{
name: 'Error Description',
selector: (row) => row['errorDescription'],
sortable: true,
},
]
const tableColumns = [
{
name: 'serialNumber',
Expand Down Expand Up @@ -267,8 +289,18 @@ const AddAPDevice = () => {
<CSpinner>Loading</CSpinner>
</CCallout>
)}
{postResults.isSuccess && <CCallout color="success">{postResults.data.Results}</CCallout>}
{autopilotData && (
{postResults.isSuccess && (
<>
<CCallout color="success">{postResults.data?.Results?.Status}</CCallout>
<CippTable
reportName="none"
tableProps={{ subheader: false }}
data={postResults.data?.Results?.Devices}
columns={completeColumns}
/>
</>
)}
{autopilotData && !postResults.isSuccess && (
<CippTable
reportName="none"
tableProps={{ subheader: false }}
Expand Down

0 comments on commit b26aea1

Please sign in to comment.