one more step towards clean configuration and setup

This commit is contained in:
Helmut Merz 2023-02-24 21:04:53 +01:00
parent 4145c323b8
commit ba2a58353c
3 changed files with 10 additions and 5 deletions

View file

@ -6,7 +6,11 @@ console.log("pageid:", pageid)
import { api, polling } from './settings' import { api, polling } from './settings'
// pvapp.run(config(api, polling)) // pvapp.run(config(api, polling))
const apiUrl = '/api/system/poll/service/pclt-0001' const [domain, action, class_, item] = Object.values(polling)
const pollUrl = `${api.path}/${domain}/${action}/${class_}/${item}`
console.log("pollUrl:", pollUrl)
//const apiUrl = '/api/system/poll/service/pclt-0001'
const appdata = { const appdata = {
$delimiters: ['{|', '|}'], $delimiters: ['{|', '|}'],
@ -46,6 +50,6 @@ async function dopoll(obj: typeof appdata, url: string) {
} }
function poll() { function poll() {
dopoll(this, apiUrl) dopoll(this, pollUrl)
} }

View file

@ -3,7 +3,8 @@ export const api = {
} }
export const polling = { export const polling = {
msgbase: ['system', 'poll'], domain: 'system',
action: 'poll',
class: 'service', class: 'service',
item: 'pclt001' item: 'pclt-0001'
} }

View file

@ -5,7 +5,7 @@
"compilerOptions": { "compilerOptions": {
"noEmit": true, "noEmit": true,
"module": "es2022", "module": "es2022",
"lib": ["es2015", "dom"], "lib": ["es2017", "dom"],
"paths": { "paths": {
"@params": ["./params-tsc.ts"] "@params": ["./params-tsc.ts"]
} }