integrando com nova api
This commit is contained in:
parent
90791036f9
commit
6395ec170e
@ -136,14 +136,16 @@ export default function Telemetria({userName, clients}: any) {
|
||||
setOpenSnackError(false)
|
||||
setOpenSnackSuccess(true)
|
||||
setOpen(false)
|
||||
setLoader(true)
|
||||
setLoader(false)
|
||||
htmlToCSV(html, "telemetria.csv")
|
||||
console.log('then')
|
||||
}).catch(res => {
|
||||
setSend(false)
|
||||
setLoader(false)
|
||||
setException(true)
|
||||
setOpenSnackError(true)
|
||||
setOpenSnackSuccess(false)
|
||||
console.log('catch')
|
||||
})
|
||||
}
|
||||
async function getChartData() {
|
||||
@ -156,9 +158,11 @@ export default function Telemetria({userName, clients}: any) {
|
||||
]
|
||||
}).then(res => {
|
||||
setDemRegXDemCon2(res.data.data)
|
||||
setTableData(res.data.data)
|
||||
htmlToCSV(html, "telemetria.csv")
|
||||
setLoader(false)
|
||||
})
|
||||
setLoader(true)
|
||||
setLoader(false)
|
||||
}
|
||||
|
||||
const [filters, setFilters] = useState()
|
||||
|
||||
@ -9,7 +9,7 @@ export async function getDemand(
|
||||
discretization: string
|
||||
) {
|
||||
const { '@smartAuth-token': token } = parseCookies()
|
||||
const { data } = await api.post('https://smart-energia-api.herokuapp.com/api/telemetry/demand', {
|
||||
const { data } = await api.post('/telemetry/demand', {
|
||||
"type": discretization,
|
||||
"filters": [
|
||||
{"type" : "=", "field": `med_5min.ponto`, "value": unity},
|
||||
|
||||
@ -8,7 +8,7 @@ export async function getPowerFactorData(
|
||||
endDate: Date,
|
||||
discretization: string
|
||||
) {
|
||||
const { data } = await api.post('http://smart-energia-api.herokuapp.com/api/telemetry/powerFactor', {
|
||||
const { data } = await api.post('/telemetry/powerFactor', {
|
||||
"type": discretization,
|
||||
"filters": [
|
||||
{"type" : "=", "field": "med_5min.ponto", "value": unity},
|
||||
|
||||
@ -13,7 +13,7 @@ export default function getAPIClient(ctx?: Pick<next.NextPageContext, 'req'> | {
|
||||
const { '@smartAuth-token': token } = parseCookies(ctx)
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: "https://smart-energia-api.herokuapp.com/api",
|
||||
baseURL: "https://smartenergiaapi.klupp.com.br/api",
|
||||
});
|
||||
|
||||
api.interceptors.request.use(config => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user