feat(staging): adding support of app-side service and settings app (part 1)

This commit is contained in:
Savely Savianok
2024-12-21 17:56:45 +03:00
parent f16700a9db
commit f21678b219
5 changed files with 54 additions and 68 deletions

View File

@@ -1,7 +1,37 @@
import { gettext } from 'i18n'
AppSettingsPage({
build() {
console.log(gettext('example'))
build(props) {
const storage = props.settingsStorage.getItem('TOTPs')
//props.settingsStorage.setItem('TOTPS')
console.log(storage)
const totpButtons = []
storage.forEach(element => {
totpButtons.push(
View({
style:
{
textAlign: "center",
marginBottom: "10px"
}
},
[Button({
style: { width: "95%" },
label: `${element.issuer}: ${element.client}`,
onClick: (el) => {
props.settingsStorage.setItem("TOTPs", storage)
}
}), Text({
align: 'center',
}, `${element.hashType} | ${element.digits} digits | ${element.fetchTime} seconds | offset ${element.timeOffset} seconds`)]))
});
var sec = Section({}, [
View({
style: { textAlign: "center" }
},
Text({
align: 'center',
}, 'TOTPS:'))
,
...totpButtons])
return sec;
}
})