fixed permission issue causing problems with simple export
This commit is contained in:
parent
7c5332662d
commit
b7e21a8fa1
3 changed files with 20 additions and 17 deletions
|
|
@ -78,7 +78,7 @@ export default function ArcGISDeviceData(props: Props) {
|
|||
|
||||
const getMeasurements = () => {
|
||||
if (useFlat) {
|
||||
deviceAPI.listSimpleJSON(device.id()).then(resp => {
|
||||
deviceAPI.listSimpleJSON(device.id(), as).then(resp => {
|
||||
downloadJSON(resp.data, "Device" + device.id() + ".json");
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -360,12 +360,21 @@ export default function Device(props: Props) {
|
|||
// } else {
|
||||
return (
|
||||
<Box padding={1}>
|
||||
<Grid container direction="row" alignItems="center">
|
||||
<Grid style={{ order: 5 }}>
|
||||
<Grid container direction="row" justifyContent="space-between" alignItems="center" width="100%">
|
||||
<Grid size={12}>
|
||||
<DeviceOverview
|
||||
device={device}
|
||||
components={[...components.values()]}
|
||||
usage={getUsage()}
|
||||
loading={isLoading}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid size={12}>
|
||||
<DeviceActions
|
||||
device={device}
|
||||
isPaused={isPaused()}
|
||||
components={getOrderedComponents()}
|
||||
components={[...components.values()]}
|
||||
//components={getOrderedComponents()}
|
||||
interactions={interactions}
|
||||
availablePositions={availablePositions}
|
||||
availableOffsets={availableOffsets}
|
||||
|
|
@ -376,16 +385,8 @@ export default function Device(props: Props) {
|
|||
isLoading={isLoading}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid style={{ order: 4 }}>
|
||||
<DeviceOverview
|
||||
device={device}
|
||||
components={[...components.values()]}
|
||||
usage={getUsage()}
|
||||
loading={isLoading}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{componentsTab()}
|
||||
</Grid>
|
||||
</Box>
|
||||
);
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ export interface IDeviceAPIContext {
|
|||
orderBy: string,
|
||||
as?: string
|
||||
) => Promise<AxiosResponse<pond.ListDeviceExportedMeasurementsResponse>>;
|
||||
listSimpleJSON: (device: number) => Promise<any>;
|
||||
listSimpleJSON: (device: number, as?: string) => Promise<any>;
|
||||
resetQuackCount: (id: number) => Promise<any>;
|
||||
resetQuackCountTx: (id: number) => Promise<any>;
|
||||
resetQuackCountTx1000: (id: number) => Promise<any>;
|
||||
|
|
@ -832,9 +832,11 @@ export default function DeviceProvider(props: PropsWithChildren<Props>) {
|
|||
);
|
||||
};
|
||||
|
||||
const listSimpleJSON = (device: number) => {
|
||||
const listSimpleJSON = (device: number, as?: string) => {
|
||||
let url = "/devices/" + device + "/measurements/exportSimple"
|
||||
if(as) url = url + "?as=" + as
|
||||
return new Promise<AxiosResponse>((resolve, reject) => {
|
||||
get(pondURL("/devices/" + device + "/measurements/exportSimple")).then(resp => {
|
||||
get(pondURL(url)).then(resp => {
|
||||
return resolve(resp)
|
||||
}).catch(err => {
|
||||
return reject(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue