mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-06-07 05:57:41 +00:00
Update VodafoneDE.js
Add CallYa Amount
This commit is contained in:
parent
69f4b440fe
commit
becd8d38cf
1 changed files with 19 additions and 2 deletions
|
@ -3,9 +3,11 @@
|
||||||
// icon-color: red; icon-glyph: broadcast-tower;
|
// icon-color: red; icon-glyph: broadcast-tower;
|
||||||
|
|
||||||
/**************
|
/**************
|
||||||
Version 1.2.1
|
Version 1.2.2
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
v1.2.2:
|
||||||
|
- Add CallYa Amount
|
||||||
v1.2.1:
|
v1.2.1:
|
||||||
- Code '40100' added for CallYa Tariff
|
- Code '40100' added for CallYa Tariff
|
||||||
v1.2.0:
|
v1.2.0:
|
||||||
|
@ -222,6 +224,15 @@ async function getUsage(user, pass, number) {
|
||||||
throw new Error(ErrorMsg)
|
throw new Error(ErrorMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let amount
|
||||||
|
if (res['serviceUsageVBO']['usageAccounts'][0]['details']['amount'] === undefined) {
|
||||||
|
const ErrorMsgDetails = "Can't find amount."
|
||||||
|
console.log(ErrorMsgDetails)
|
||||||
|
throw new Error(ErrorMsgDetails)
|
||||||
|
}else{
|
||||||
|
amount = res['serviceUsageVBO']['usageAccounts'][0]['details']['amount']
|
||||||
|
}
|
||||||
|
|
||||||
let datenvolumen;
|
let datenvolumen;
|
||||||
if (datenContainer.usage.length == 1) {
|
if (datenContainer.usage.length == 1) {
|
||||||
datenvolumen = datenContainer.usage[0]
|
datenvolumen = datenContainer.usage[0]
|
||||||
|
@ -252,6 +263,7 @@ async function getUsage(user, pass, number) {
|
||||||
total: datenvolumen.total,
|
total: datenvolumen.total,
|
||||||
used: datenvolumen.used,
|
used: datenvolumen.used,
|
||||||
remaining: datenvolumen.remaining,
|
remaining: datenvolumen.remaining,
|
||||||
|
amount: amount,
|
||||||
endDate
|
endDate
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -374,11 +386,16 @@ if (data !== undefined) {
|
||||||
totalValuesText.centerAlignText()
|
totalValuesText.centerAlignText()
|
||||||
totalValuesText.textColor = new Color(textColor)
|
totalValuesText.textColor = new Color(textColor)
|
||||||
|
|
||||||
|
let strAmount = ""
|
||||||
|
if (data.amount) {
|
||||||
|
strAmount = ` - ${data.amount} €`
|
||||||
|
}
|
||||||
|
|
||||||
// Remaining Days
|
// Remaining Days
|
||||||
if (data.endDate) {
|
if (data.endDate) {
|
||||||
widget.addSpacer(5)
|
widget.addSpacer(5)
|
||||||
let remainingDays = getTimeRemaining(data.endDate).days + 1
|
let remainingDays = getTimeRemaining(data.endDate).days + 1
|
||||||
let remainingDaysText = widget.addText(`${remainingDays} Tage verleibend`)
|
let remainingDaysText = widget.addText(`${remainingDays} Tage verleibend${strAmount}`)
|
||||||
remainingDaysText.font = Font.mediumSystemFont(8)
|
remainingDaysText.font = Font.mediumSystemFont(8)
|
||||||
remainingDaysText.centerAlignText()
|
remainingDaysText.centerAlignText()
|
||||||
remainingDaysText.textColor = new Color(textColor)
|
remainingDaysText.textColor = new Color(textColor)
|
||||||
|
|
Loading…
Add table
Reference in a new issue