work in progross: modules with focused responsibilities
This commit is contained in:
parent
ffc3915e65
commit
4145c323b8
4 changed files with 18 additions and 5 deletions
|
@ -2,6 +2,10 @@ import { createApp } from './lib/petite-vue.es.js'
|
||||||
import { pageid } from '@params'
|
import { pageid } from '@params'
|
||||||
console.log("pageid:", pageid)
|
console.log("pageid:", pageid)
|
||||||
|
|
||||||
|
// import { config, pvapp } from './common'
|
||||||
|
import { api, polling } from './settings'
|
||||||
|
// pvapp.run(config(api, polling))
|
||||||
|
|
||||||
const apiUrl = '/api/system/poll/service/pclt-0001'
|
const apiUrl = '/api/system/poll/service/pclt-0001'
|
||||||
|
|
||||||
const appdata = {
|
const appdata = {
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
// imported by tsc via "import {...} from @params".
|
// imported by tsc via "import {...} from @params".
|
||||||
// Hugo / ESBuild will provide js.Build params in @params
|
// Hugo / ESBuild will provide js.Build params in @params
|
||||||
// (see layout/partials/js.html).
|
// (see layout/partials/js.html).
|
||||||
export const pageid = 'fileid-dummy'
|
export const pageid = 'pageid-dummy'
|
||||||
export const apipath = 'apipath-dummy'
|
export const apipath = 'apipath-dummy'
|
||||||
|
|
9
assets/js/settings.ts
Normal file
9
assets/js/settings.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
export const api = {
|
||||||
|
path: '/api'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const polling = {
|
||||||
|
msgbase: ['system', 'poll'],
|
||||||
|
class: 'service',
|
||||||
|
item: 'pclt001'
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{{- $pageid := or .Params.Pageid .File.UniqueID "unknown" -}}
|
{{- if $jsmod := .Params.JsModule -}}
|
||||||
{{- with $jsmod := .Params.JsModule -}}
|
{{- $pageid := or .Params.Pageid (and .File .File.UniqueID) "unknown" -}}
|
||||||
|
{{- $params := dict "pageid" $pageid -}}
|
||||||
{{- $js := resources.Get (printf "js/%s" $jsmod) | js.Build (
|
{{- $js := resources.Get (printf "js/%s" $jsmod) | js.Build (
|
||||||
dict "minify" false
|
dict "minify" false "params" $params) -}}
|
||||||
"params" (dict "pageid" $pageid)) -}}
|
|
||||||
<script src="{{ $js.Permalink }}" defer></script>
|
<script src="{{ $js.Permalink }}" defer></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue