start with login page; nopoll config param; handle: check message 'class'
This commit is contained in:
parent
1aa76a59c8
commit
4bbc3cad0a
7 changed files with 45 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
||||||
import { createApp } from 'petite-vue'
|
import { createApp } from 'petite-vue'
|
||||||
|
|
||||||
import { api, polling } from './settings'
|
import { pageid, domain, nopoll } from '@params'
|
||||||
import { pageid, domain } from '@params'
|
|
||||||
|
|
||||||
type Config = {
|
type Config = {
|
||||||
apiurl: string
|
apiurl: string
|
||||||
|
@ -10,6 +9,7 @@ type Config = {
|
||||||
itemid: string
|
itemid: string
|
||||||
sid: string
|
sid: string
|
||||||
iid: string
|
iid: string
|
||||||
|
nopoll: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export function config (api, polling): Config {
|
export function config (api, polling): Config {
|
||||||
|
@ -21,7 +21,8 @@ export function config (api, polling): Config {
|
||||||
domain: domain,
|
domain: domain,
|
||||||
itemid: urlparams.get('id'),
|
itemid: urlparams.get('id'),
|
||||||
sid: getSid(),
|
sid: getSid(),
|
||||||
iid: createRandString(1)
|
iid: createRandString(1),
|
||||||
|
nopoll: nopoll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ export const pvapp = {
|
||||||
run(conf: Config) {
|
run(conf: Config) {
|
||||||
appdata.conf = conf
|
appdata.conf = conf
|
||||||
createApp(appdata).mount()
|
createApp(appdata).mount()
|
||||||
if (appdata.conf.pollurl) {
|
if (appdata.conf.pollurl && !appdata.conf.nopoll) {
|
||||||
appdata.poll()
|
appdata.poll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +85,10 @@ function handle(msg) {
|
||||||
const [ domain, action, class_, item ] = msg.path.split('/')
|
const [ domain, action, class_, item ] = msg.path.split('/')
|
||||||
//console.log('msgbase: ', domain, action, class_, item)
|
//console.log('msgbase: ', domain, action, class_, item)
|
||||||
// TODO: check message parts (using default values), select handler fct
|
// TODO: check message parts (using default values), select handler fct
|
||||||
Object.assign(this.components[class_ || 'data'].data, data)
|
const comp = this.components[class_ || data]
|
||||||
|
if (comp != undefined) {
|
||||||
|
Object.assign(comp.data, data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// basic functions - move to api.ts
|
// basic functions - move to api.ts
|
||||||
|
|
|
@ -10,4 +10,4 @@ export const domain = 'domain-dummy'
|
||||||
export const action = 'action-dummy'
|
export const action = 'action-dummy'
|
||||||
export const class_ = 'class-dummy'
|
export const class_ = 'class-dummy'
|
||||||
|
|
||||||
export const nopolling = false
|
export const nopoll = false
|
||||||
|
|
|
@ -5,8 +5,8 @@ export const api = {
|
||||||
//export const polling = null // suppress polling
|
//export const polling = null // suppress polling
|
||||||
|
|
||||||
export const polling = {
|
export const polling = {
|
||||||
msgbase: ['system', 'poll', 'service', 'pclt-0001']
|
//msgbase: ['system', 'poll', 'service', 'pclt-0001']
|
||||||
//msgbase: ['system', 'poll', 'session']
|
msgbase: ['system', 'poll', 'session']
|
||||||
//msgbase: ['system', 'poll', 'interaction']
|
//msgbase: ['system', 'poll', 'interaction']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ params:
|
||||||
api:
|
api:
|
||||||
domain: demo
|
domain: demo
|
||||||
module: main.ts
|
module: main.ts
|
||||||
|
nopoll: false
|
||||||
|
|
||||||
taxonomies:
|
taxonomies:
|
||||||
domain: domains
|
domain: domains
|
||||||
|
|
29
exampleSite/content/app/login.md
Normal file
29
exampleSite/content/app/login.md
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
title: Login
|
||||||
|
summary: Enter Login data
|
||||||
|
img:
|
||||||
|
pageid: app-login
|
||||||
|
domains: [App]
|
||||||
|
topics: [Examples]
|
||||||
|
date: 2023-03-14
|
||||||
|
author: helmutm
|
||||||
|
draft: false
|
||||||
|
weight: 100
|
||||||
|
api:
|
||||||
|
domain: system
|
||||||
|
nopoll: false
|
||||||
|
---
|
||||||
|
|
||||||
|
cyberscopes example site - Login Form
|
||||||
|
|
||||||
|
{{< pv/fieldset name="login" >}}
|
||||||
|
|
||||||
|
Login: {{< pv/input-textline name="login" attrs="autofocus" >}}
|
||||||
|
Password: {{< pv/input-textline type="password" name="password" >}}
|
||||||
|
{{< pv/button label="Login" >}}
|
||||||
|
|
||||||
|
{{< /pv/fieldset >}}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
{{< pv/debug >}}
|
|
@ -1,7 +1,8 @@
|
||||||
{{- if $jsmod := $.Param "api.module" -}}
|
{{- if $jsmod := $.Param "api.module" -}}
|
||||||
{{- $pageid := or .Params.Pageid (and .File .File.UniqueID) "unknown" -}}
|
{{- $pageid := or .Params.Pageid (and .File .File.UniqueID) "unknown" -}}
|
||||||
{{- $params := dict "pageid" $pageid
|
{{- $params := dict "pageid" $pageid
|
||||||
"domain" ($.Param "api.domain") -}}
|
"domain" ($.Param "api.domain")
|
||||||
|
"nopoll" ($.Param "api.nopoll") | default false -}}
|
||||||
{{- $js := resources.Get (printf "js/%s" $jsmod) | js.Build (
|
{{- $js := resources.Get (printf "js/%s" $jsmod) | js.Build (
|
||||||
dict "minify" false "params" $params) -}}
|
dict "minify" false "params" $params) -}}
|
||||||
<script src="{{ $js.Permalink }}" defer></script>
|
<script src="{{ $js.Permalink }}" defer></script>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<div @vue:mounted="mounted('conf')">
|
<div @vue:mounted="mounted('conf')">
|
||||||
<div>item id: {| conf.itemid |}</div>
|
<div>item id: {| conf.itemid |}</div>
|
||||||
<div>session id: {| conf.sid |}</div>
|
<div>session id: {| conf.sid |}</div>
|
||||||
|
<div>interaction id: {| conf.iid |}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div @vue:mounted="mounted('output')">
|
<div @vue:mounted="mounted('output')">
|
||||||
|
|
Loading…
Add table
Reference in a new issue