diff --git a/src/api/index.js b/src/api/index.js index b570e6c..9fcce80 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -9,7 +9,7 @@ function checkAuth(token){ return token==='DUMMYTOKEN'; } -function fetchdb(token){ +async function fetchdb(token){ //fetch(`${server}/api/userdb`).then() let xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", `${server}/api/userdb`, false ); // false for synchronous request @@ -22,8 +22,8 @@ function parsedb(raw){ let lines = raw.split('\n'); let users = []; lines.map((l,line)=>{ - let [uid, first_name, last_name, rfid_uid, user_pin, enabled] = l.split(';'); - users.push({ line, uid, first_name, last_name, rfid_uid, user_pin, enabled: enabled === '1' }); + let [uid, first_name, last_name, rfid_uid, user_pin, active] = l.split([';']); + users.push({ line, uid, first_name, last_name, rfid_uid, user_pin, enabled: active[0]==='1' }); }); return users; diff --git a/src/components/Pageselector/index.jsx b/src/components/Pageselector/index.jsx index 1f7dc0a..d675384 100644 --- a/src/components/Pageselector/index.jsx +++ b/src/components/Pageselector/index.jsx @@ -1,15 +1,15 @@ import { h } from "preact"; - +import { Link } from "preact-router"; const Pageselector = (props) => { var items = []; if(!isNaN(props.start)&&!isNaN(props.end)&&!isNaN(props.current)) for(var i=props.start; i<=props.end; i++){ - items.push(
  • {i}
  • ); + items.push(
  • {i}
  • ); } - items.push(
  • >
  • ); + //items.push(
  • >
  • ); return (