provide setSid(); + minor clean-up input shortcode
This commit is contained in:
parent
94da069210
commit
c76426e13f
2 changed files with 13 additions and 5 deletions
|
@ -69,7 +69,16 @@ function createSid(): string {
|
||||||
return arr[0].toString(36) + arr[1].toString(36)
|
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) {
|
async function dopoll(app: typeof appdata) {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
{{- $type := .Get "type" | default "text" -}}
|
{{- $type := .Get "type" | default "text" -}}
|
||||||
{{- $name := .Get "name" | default "textline" -}}
|
{{- $name := .Get "name" | default "textline" -}}
|
||||||
{{- $default := .Get "default" | default "" -}}
|
{{- $default := .Get "default" | default "" -}}
|
||||||
{{- $attrs := .Get "attrs" | default "" -}}
|
|
||||||
{{- $onchange := .Get "onchange" | default "" -}}
|
|
||||||
<div>
|
<div>
|
||||||
<input type="{{ $type }}" name="{{ $name }}" {{ $attrs }}
|
<input type="{{ $type }}" name="{{ $name }}"
|
||||||
|
{{- with .Get "attrs" }} {{ . }}{{ end }}
|
||||||
v-model="data.{{ $name }}"
|
v-model="data.{{ $name }}"
|
||||||
@vue:mounted="data.{{ $name }} = '{{ $default }}'"
|
@vue:mounted="data.{{ $name }} = '{{ $default }}'"
|
||||||
@change="{{ $onchange }}" />
|
{{- with .Get "onchange" }} @change="{{ . }}"{{ end }} />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue