Workers P3: Pult-Daten des Prüfstands nur auf Wunsch (pult: true), damit die bisherige Skript-API unverändert bleibt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ed2201b22
commit
e3c7a22ae2
2 files changed
+6
-5
No files matched your search
@@ -21,7 +21,8 @@ import { createScriptedFetch } from './scripted-fetch.js'
|
||||
import { holder } from './harness-bridge.js'
|
||||
|
||||
const params = new URLSearchParams(window.location.search)
|
||||
const scripted = createScriptedApi({ now: () => performance.now(), base: Date.now(), halted: params.get('halted') === '1' })
|
||||
const pageMode = params.get('page') === '1'
|
||||
const scripted = createScriptedApi({ now: () => performance.now(), base: Date.now(), halted: params.get('halted') === '1', pult: pageMode })
|
||||
const stage = createRef()
|
||||
const fault = params.get('fault')
|
||||
const control = { fault: fault && fault !== 'none' ? fault : null, calls: [], jwts: [] }
|
||||
@@ -39,7 +40,6 @@ const api = fault === null
|
||||
window.__wk = { stage, api: scripted, control }
|
||||
holder.api = api
|
||||
|
||||
const pageMode = params.get('page') === '1'
|
||||
const tab = params.get('tab')
|
||||
const entries = [pageMode && tab ? `/hustler?tab=${encodeURIComponent(tab)}` : '/hustler']
|
||||
|
||||
|
||||
@@ -351,16 +351,17 @@ function defaultSettings(halted) {
|
||||
|
||||
/**
|
||||
* Skript-API für den Prüfstand. now() = Uhr in Millisekunden (nur die Differenz zum Aufruf von createScriptedApi zählt),
|
||||
* base = Zeitpunkt (ms) des Starts für die Zeitstempel der Ereignisse, halted = Bounce-Notbremse ist von Anfang an gesetzt (H4).
|
||||
* base = Zeitpunkt (ms) des Starts für die Zeitstempel der Ereignisse, halted = Bounce-Notbremse ist von Anfang an gesetzt (H4),
|
||||
* pult = das Freigabe-Pult und die Interessenten (P3) mit den festen Daten füllen (sonst ist das Pult leer).
|
||||
* Rückgabe wie createWorkersApi; saved ist die Liste der Patches, die saveSettings bekam.
|
||||
*/
|
||||
export function createScriptedApi({ now, base = DEFAULT_BASE, halted = false }) {
|
||||
export function createScriptedApi({ now, base = DEFAULT_BASE, halted = false, pult = false }) {
|
||||
const start = now()
|
||||
const elapsed = () => Math.max(0, now() - start)
|
||||
let paused = false
|
||||
const settings = defaultSettings(halted === true)
|
||||
const saved = []
|
||||
const fx = pultFixtures(base)
|
||||
const fx = pult ? pultFixtures(base) : { items: [], prospects: {}, threads: {}, messages: {}, previews: {} } // ohne `pult` ist das Pult leer wie bisher
|
||||
const pultItems = fx.items
|
||||
const faults = { pult: null, claim: null, sent: null, discard: null, done: null, prospect: null } // je { status, message } oder null
|
||||
const pultCalls = []
|
||||
|
||||
Reference in new issue
Block a user