fix(staging): fixed front
This commit is contained in:
parent
b5ed947730
commit
4dbc3828fd
@ -1,5 +1,8 @@
|
|||||||
|
let _props = null;
|
||||||
|
|
||||||
AppSettingsPage({
|
AppSettingsPage({
|
||||||
build(props) {
|
build(props) {
|
||||||
|
_props = props;
|
||||||
const storage = props.settingsStorage.getItem("TOTPs");
|
const storage = props.settingsStorage.getItem("TOTPs");
|
||||||
const totpEntrys = GetTOTPList(storage);
|
const totpEntrys = GetTOTPList(storage);
|
||||||
|
|
||||||
@ -42,14 +45,18 @@ function GetTOTPList(storage){
|
|||||||
let totpEntrys = [];
|
let totpEntrys = [];
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
storage.forEach((element) => {
|
storage.forEach((element) => {
|
||||||
|
const elementId = counter;
|
||||||
const textInput = TextInput({
|
const textInput = TextInput({
|
||||||
placeholder: "otplink",
|
placeholder: "otplink",
|
||||||
label: "Change OTP link",
|
label: "Change OTP link",
|
||||||
labelStyle: {
|
labelStyle: {
|
||||||
backgroundColor: "#14213D",
|
backgroundColor: "#14213D",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
width: "70vw",
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
margin: "10px",
|
margin: "10px",
|
||||||
|
flexGrow: 1,
|
||||||
fontSize: "20px",
|
fontSize: "20px",
|
||||||
color: "#E5E5E5",
|
color: "#E5E5E5",
|
||||||
borderRadius: "5px"
|
borderRadius: "5px"
|
||||||
@ -69,11 +76,12 @@ function GetTOTPList(storage){
|
|||||||
const delButton = Button(
|
const delButton = Button(
|
||||||
{
|
{
|
||||||
onClick: (el) => {
|
onClick: (el) => {
|
||||||
storage = storage.filter(x => storage.indexOf(x) != counter - 1)
|
storage = storage.filter(x => storage.indexOf(x) != elementId)
|
||||||
|
updateStorage(storage)
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: "#ba181b",
|
backgroundColor: "#ba181b",
|
||||||
fontSize: "20px",
|
fontSize: "18px",
|
||||||
color: "#ffffff",
|
color: "#ffffff",
|
||||||
height: "fit-content",
|
height: "fit-content",
|
||||||
margin: "10px"
|
margin: "10px"
|
||||||
@ -101,7 +109,8 @@ function GetTOTPList(storage){
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
[textBig, text, View({style: {
|
[textBig, text, View({style: {
|
||||||
display: "flex"
|
display: "grid",
|
||||||
|
gridTemplateColumns: "1fr 100px"
|
||||||
}}, [textInput, delButton])]
|
}}, [textInput, delButton])]
|
||||||
);
|
);
|
||||||
totpEntrys.push({ text: text, view: view });
|
totpEntrys.push({ text: text, view: view });
|
||||||
@ -109,4 +118,8 @@ function GetTOTPList(storage){
|
|||||||
});
|
});
|
||||||
|
|
||||||
return totpEntrys.map(x => x.view);
|
return totpEntrys.map(x => x.view);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateStorage(storage){
|
||||||
|
_props.settingsStorage.setItem('TOTPs', storage)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user