Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b0c472950 | ||
|
|
c887872c3b | ||
|
|
efd36d0221 | ||
|
|
4684939e13 | ||
|
|
193ee20da4 |
@@ -318,7 +318,7 @@ class RegisterUser(BaseModel):
|
||||
username: str = Query(default=..., min_length=2, max_length=20)
|
||||
password: str = Query(default=..., min_length=8, max_length=50)
|
||||
password_repeat: str = Query(default=..., min_length=8, max_length=50)
|
||||
invitation_code: str | None = Query(default=None, min_length=1, max_length=256)
|
||||
invitation_code: str | None = Query(default=None, max_length=256)
|
||||
|
||||
|
||||
class CreateUser(BaseModel):
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -295,5 +295,58 @@ window._lnbitsUtils = {
|
||||
let decoder = new TextDecoder('utf-8')
|
||||
return decoder.decode(valueb)
|
||||
})
|
||||
},
|
||||
createWebSocket(endpoint, handlers, options = {}) {
|
||||
const {onMessage, onError, onOpen, onClose} = handlers
|
||||
const {autoParseJSON = true} = options
|
||||
|
||||
try {
|
||||
const url = new URL(window.location)
|
||||
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
url.pathname = `/api/v1/ws/${endpoint}`
|
||||
|
||||
const ws = new WebSocket(url)
|
||||
|
||||
ws.onmessage = async event => {
|
||||
try {
|
||||
const data = autoParseJSON ? JSON.parse(event.data) : event.data
|
||||
if (onMessage) {
|
||||
await onMessage(data, ws)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('WebSocket message parsing error:', err)
|
||||
if (onError) {
|
||||
onError(err, ws)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ws.onerror = error => {
|
||||
console.warn('WebSocket error:', error)
|
||||
if (onError) {
|
||||
onError(error, ws)
|
||||
}
|
||||
}
|
||||
|
||||
ws.onopen = event => {
|
||||
if (onOpen) {
|
||||
onOpen(event, ws)
|
||||
}
|
||||
}
|
||||
|
||||
ws.onclose = event => {
|
||||
if (onClose) {
|
||||
onClose(event, ws)
|
||||
}
|
||||
}
|
||||
|
||||
return ws
|
||||
} catch (err) {
|
||||
console.warn('WebSocket creation error:', err)
|
||||
if (onError) {
|
||||
onError(err, null)
|
||||
}
|
||||
throw err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,13 @@
|
||||
<div class="col-12 col-md-6">
|
||||
<q-select
|
||||
filled
|
||||
:options="[$t('second'), $t('minute'), $t('hour')]"
|
||||
:options="[
|
||||
{label: $t('second'), value: 'second'},
|
||||
{label: $t('minute'), value: 'minute'},
|
||||
{label: $t('hour'), value: 'hour'}
|
||||
]"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="formData.lnbits_rate_limit_unit"
|
||||
:label="$t('time_unit')"
|
||||
></q-select>
|
||||
|
||||
Reference in New Issue
Block a user