Fix missing closing tag in nightscout plugin and reduce svg size
This commit is contained in:
@@ -8,7 +8,7 @@ export default function({faker, url}) {
|
|||||||
const directionArray = ["SingleUp", "DoubleUp", "FortyFiveUp", "Flat", "FortyFiveDown", "SingleDown", "DoubleDown"]
|
const directionArray = ["SingleUp", "DoubleUp", "FortyFiveUp", "Flat", "FortyFiveDown", "SingleDown", "DoubleDown"]
|
||||||
return ({
|
return ({
|
||||||
status:200,
|
status:200,
|
||||||
data:[{
|
data:new Array(12).fill(null).map(_ => ({
|
||||||
_id:faker.git.commitSha().substring(0, 23),
|
_id:faker.git.commitSha().substring(0, 23),
|
||||||
device:"xDrip-DexcomG5",
|
device:"xDrip-DexcomG5",
|
||||||
date:lastInterval,
|
date:lastInterval,
|
||||||
@@ -23,7 +23,7 @@ export default function({faker, url}) {
|
|||||||
noise:1,
|
noise:1,
|
||||||
sysTime:new Date(lastInterval).toISOString(),
|
sysTime:new Date(lastInterval).toISOString(),
|
||||||
utcOffset:faker.random.number({min:-12, max:14})*60,
|
utcOffset:faker.random.number({min:-12, max:14})*60,
|
||||||
}],
|
})),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
//Load inputs
|
//Load inputs
|
||||||
let {url, datapoints, lowalert, highalert, urgentlowalert, urgenthighalert} = imports.metadata.plugins.nightscout.inputs({data, account, q})
|
let {url, datapoints, lowalert, highalert, urgentlowalert, urgenthighalert} = imports.metadata.plugins.nightscout.inputs({data, account, q})
|
||||||
|
|
||||||
if (!url || url === "https://example.herokuapp.com") throw "Nightscout site URL isn't set!"
|
if (!url || url === "https://example.herokuapp.com") throw {error:{message:"Nightscout site URL isn't set!"}}
|
||||||
if (url.substring(url.length - 1) !== "/") url += "/"
|
if (url.substring(url.length - 1) !== "/") url += "/"
|
||||||
if (url.substring(0, 7) === "http://") url = `https://${url.substring(7)}`
|
if (url.substring(0, 7) === "http://") url = `https://${url.substring(7)}`
|
||||||
if (url.substring(0, 8) !== "https://") url = `https://${url}`
|
if (url.substring(0, 8) !== "https://") url = `https://${url}`
|
||||||
@@ -43,6 +43,8 @@
|
|||||||
}
|
}
|
||||||
//Handle errors
|
//Handle errors
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
if (error.error?.message)
|
||||||
|
throw error
|
||||||
throw {error:{message:"An error occured", instance:error}}
|
throw {error:{message:"An error occured", instance:error}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user