Rudder served from a remote host says it runs on your own computer, not that the engine is broken
The engine records the microphone of the machine it runs on, so a cloud dev server has none by design. Off loopback (and not the desktop app), an absent engine now reads "Runs on your computer" with where to open Rudder instead, rather than build instructions for a missing binary.
This commit is contained in:
parent
3f8790ffce
commit
dab3980fc2
1 changed files with 15 additions and 1 deletions
|
|
@ -28,6 +28,16 @@ const cfg = computed(() => {
|
|||
try { return props.profileConfig ? JSON.parse(props.profileConfig) : {} } catch { return {} }
|
||||
})
|
||||
const apiBase = computed(() => (cfg.value.apiBase || '/api/rudder').replace(/\/$/, ''))
|
||||
// The engine records THIS computer's microphone, so it can only ever run beside the reader: on a laptop's
|
||||
// dev server, or as the desktop app's sidecar. Served from anywhere else (a cloud dev server), an absent
|
||||
// engine is the expected state, not a failure, and the notice says where Rudder does work.
|
||||
const LOOPBACK = /^(localhost|127\.\d+\.\d+\.\d+|\[?::1\]?|tauri\.localhost)$/
|
||||
const onOwnComputer = computed(() => {
|
||||
try {
|
||||
if (/^https?:\/\//.test(apiBase.value)) return LOOPBACK.test(new URL(apiBase.value).hostname)
|
||||
return typeof location === 'undefined' || location.protocol === 'tauri:' || LOOPBACK.test(location.hostname)
|
||||
} catch { return true }
|
||||
})
|
||||
|
||||
const LANGUAGES = [
|
||||
['en-US', 'English (US)'], ['en-GB', 'English (UK)'], ['es-US', 'Spanish (US)'], ['es-ES', 'Spanish (Spain)'],
|
||||
|
|
@ -463,7 +473,7 @@ const statusText = computed(() => ({
|
|||
starting: 'Loading speech model… (about 20 s the first time)',
|
||||
ready: recording.value ? 'Listening' : 'Ready',
|
||||
error: 'Engine error',
|
||||
offline: 'Engine offline',
|
||||
offline: onOwnComputer.value ? 'Engine offline' : 'Runs on your computer',
|
||||
}[engine.value] || engine.value))
|
||||
|
||||
</script>
|
||||
|
|
@ -561,6 +571,10 @@ const statusText = computed(() => ({
|
|||
<p v-if="offCards.length" class="hint">Also available but switched off in Sound settings: {{ offCards.join(', ') }}. Turn it on there to use it here.</p>
|
||||
|
||||
<p v-if="notice" class="notice" :data-kind="noticeKind">{{ notice }}</p>
|
||||
<p v-else-if="engine === 'offline' && !onOwnComputer" class="notice" data-kind="warn">
|
||||
Voice to text runs on your own computer, not on this server: it listens to the microphone of the machine
|
||||
the engine runs on. Open the Plugin Studio on your computer (<code>bun run dev</code>) or use the Rudder desktop app.
|
||||
</p>
|
||||
<p v-else-if="engine === 'offline'" class="notice" data-kind="warn">
|
||||
The local speech engine isn't reachable at <code>{{ apiBase }}</code>. In the Plugin Studio it starts with
|
||||
<code>bun run dev</code> once built: <code>cd backend/rudder-engine && go build -o ../bin/rudder-engine .</code>
|
||||
|
|
|
|||
Loading…
Reference in a new issue