diff --git a/assets/js/common.ts b/assets/js/common.ts index 9b8b45a..17510ac 100644 --- a/assets/js/common.ts +++ b/assets/js/common.ts @@ -69,7 +69,16 @@ function createSid(): string { return arr[0].toString(36) + arr[1].toString(36) } -console.log("sid: ", createSid()) +function getSid(): string { + sid = localStorage.getItem('api.sessionid') + if (!sid) { + sid = createSid() + localStorage.setItem('api.sessionid', sid) + } + return sid +} + +console.log("sid: ", getSid()) async function dopoll(app: typeof appdata) { while (true) { diff --git a/layouts/shortcodes/pv/input-textline.html b/layouts/shortcodes/pv/input-textline.html index 104ad25..fc3a003 100644 --- a/layouts/shortcodes/pv/input-textline.html +++ b/layouts/shortcodes/pv/input-textline.html @@ -1,11 +1,10 @@ {{- $type := .Get "type" | default "text" -}} {{- $name := .Get "name" | default "textline" -}} {{- $default := .Get "default" | default "" -}} -{{- $attrs := .Get "attrs" | default "" -}} -{{- $onchange := .Get "onchange" | default "" -}}
- + {{- with .Get "onchange" }} @change="{{ . }}"{{ end }} />