allow setting of default domain on page level

This commit is contained in:
Helmut Merz 2023-03-15 15:41:47 +01:00
parent 36abaf6f74
commit f674fca741
3 changed files with 5 additions and 3 deletions

View file

@ -75,7 +75,7 @@ function exec() {
}
this.output += '\n' + value
console.log('exec:', value)
sendMsg(conf, [conf.domain, this.action, this.name, data.id], data)
sendMsg(conf, [this.domain, this.action, this.name, data.id], data)
}
function handle(msg) {
@ -83,7 +83,7 @@ function handle(msg) {
const [ domain, action, class_, item ] = msg.path.split('/')
//console.log('msgbase: ', domain, action, class_, item)
// TODO: check message parts (using default values), select handler fct
const comp = this.components[class_ || data]
const comp = this.components[class_ || 'data']
if (domain && domain != comp.domain) {
return
}

View file

@ -9,6 +9,8 @@ date: 2023-03-14
author: helmutm
draft: false
weight: 100
api:
domain: system
---
cyberscopes example site - Login Form

View file

@ -1,6 +1,6 @@
{{- $name := .Get "name" | default "data" -}}
{{- $action := .Get "action" | default "data" -}}
{{- $domain := .Get "domain" -}}
{{- $domain := .Get "domain" | default $.Page.Params.api.domain -}}
{{- $comp := .Get "component" | default "Data" -}}
<div v-scope="{{ $comp }}('{{ $name }}', '{{ $action }}', '{{ $domain }}')">
{{ .Inner }}