mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-01 19:27:51 +00:00
firmware query
This commit is contained in:
@@ -1,8 +1,23 @@
|
||||
import React from 'react';
|
||||
import { Firmware as FirmwarePage } from '@tip-wlan/wlan-cloud-ui-library';
|
||||
import { useQuery } from '@apollo/react-hooks';
|
||||
import { Alert } from 'antd';
|
||||
import { GET_ALL_FIRMWARE } from 'graphql/queries';
|
||||
import { Firmware as FirmwarePage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
|
||||
|
||||
const Firmware = () => {
|
||||
return <FirmwarePage />;
|
||||
const { data, error, loading } = useQuery(GET_ALL_FIRMWARE);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<Alert message="Error" description="Failed to load Firmware data." type="error" showIcon />
|
||||
);
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
return <FirmwarePage firmwareData={data && data.getAllFirmware} />;
|
||||
};
|
||||
|
||||
export default Firmware;
|
||||
|
||||
@@ -223,3 +223,17 @@ export const GET_ALL_STATUS = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_ALL_FIRMWARE = gql`
|
||||
query GetAllFirmware {
|
||||
getAllFirmware {
|
||||
id
|
||||
modelId
|
||||
versionName
|
||||
description
|
||||
filename
|
||||
commit
|
||||
releaseDate
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user