This commit is contained in:
Fred Boniface 2023-05-08 21:31:47 +01:00
parent a2afa9f500
commit 9973da52a6
8 changed files with 24 additions and 15 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/*
Auth process: User Requests Key => Server emails key to user =>
user opens link to auth.html =>

View File

@ -1,14 +1,15 @@
hideLoading()
// eslint-disable-next-line no-unused-vars
async function fetchEntry(){ // This can be condensed
showLoading()
var name = document.getElementById('name')
var crs = document.getElementById('3alpha')
var nlc = document.getElementById('nlc')
var tiploc = document.getElementById('tiploc')
var stanox = document.getElementById('stanox')
let name = document.getElementById('name')
let crs = document.getElementById('3alpha')
let nlc = document.getElementById('nlc')
let tiploc = document.getElementById('tiploc')
let stanox = document.getElementById('stanox')
var values = {
let values = {
name: name.value,
crs: crs.value,
nlc: nlc.value,
@ -71,19 +72,19 @@ async function displayData(data){
vibe('ok')
try {
document.getElementById('name').value = data['0']['NLCDESC']
} catch (err) {}
} catch (err) {log(err)}
try {
document.getElementById('3alpha').value = data['0']['3ALPHA']
} catch (err) {}
} catch (err) {log(err)}
try {
document.getElementById('nlc').value = data['0']['NLC']
} catch (err) {}
} catch (err) {log(err)}
try {
document.getElementById('tiploc').value = data['0']['TIPLOC']
} catch (err) {}
} catch (err) {log(err)}
try {
document.getElementById('stanox').value = data['0']['STANOX']
} catch (err) {}
} catch (err) {log(err)}
}
}

View File

@ -11,6 +11,7 @@ async function pageInit() {
hideLoading() // From lib.main
}
// eslint-disable-next-line no-unused-vars
async function gotoBoard(station){
vibe('ok')
window.location.assign(`${window.location.origin}/board.html?stn=${station}`)

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
init()
async function init() {

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/* All Page Init */
const version = '2.0.2'
@ -130,9 +131,10 @@ async function getApi(path,auth = false) {
let apiVer = 'v1'
let url = `${window.location.origin}/api/${apiVer}/${path}`
log(`getApi: Fetching from endpoint: ${url}, Auth=${auth}`)
let options
if (auth) {
let key = localStorage.getItem('uuid')
var options = {
options = {
method: 'GET',
redirect: 'follow',
headers: {
@ -140,7 +142,7 @@ async function getApi(path,auth = false) {
}
}
} else {
var options = {
options = {
method: 'GET',
redirect: 'follow'
}

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
hideLoading()
versionDisplay()
showHideAuthNotice()

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
//
// Init:
//

View File

@ -15,12 +15,13 @@ async function init() { // Gets query string and then fetch API response and pas
log('init: Staff Version not supported yet.')
log('init: Unable to proceed.')
} else {
let data
try {
var data = await publicLdb(stn)
data = await publicLdb(stn)
setLoadingDesc(`${stn.toUpperCase()}\nParsing Data`)
log('simple-board.init: Fetched LDB Data', 'INFO')
} catch (err) {
var data = 'err'
data = 'err'
setLoadingDesc('Waiting\nConnection')
log(`simple-board.init: Error fetching data: ${err}`, 'ERR')
}