From ef55d71a55dfa6e5d694e4dfd965a2d7f567eaa8 Mon Sep 17 00:00:00 2001 From: Cameron Perera Date: Tue, 7 Mar 2023 16:41:33 -0600 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20allow=20passthrough?= =?UTF-8?q?=20in=20mirage=20for=20asciicast=20data=20(#108)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/config.js | 1 + .../channels-by-connection/channel.js | 21 +++---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/addons/api/mirage/config.js b/addons/api/mirage/config.js index cc8712d4b..d6b519784 100644 --- a/addons/api/mirage/config.js +++ b/addons/api/mirage/config.js @@ -33,6 +33,7 @@ export default function (mirageConfig) { function routes() { initializeMockIPC(this, environmentConfig); + this.passthrough(); // make this `http://localhost:8080`, for example, if your API is on a different server // this.urlPrefix = ''; // make this `/api`, for example, if your API is namespaced diff --git a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel.js b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel.js index 2765d6c69..494ee45e6 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel.js @@ -2,24 +2,9 @@ import Route from '@ember/routing/route'; export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionChannelRoute extends Route { async model() { - // building ascii cast here to make player availabe until API is ready - const castConfig = { - version: 2, - width: 124, - height: 36, - timestamp: 1670352594, - env: { SHELL: '/bin/zsh', TERM: 'xterm-256color' }, - }; - const asciicast = `${JSON.stringify(castConfig)} -[2.676444, "o", "y"] -[2.788653, "o", "a"] -[2.868652, "o", "r"] -[3.001764, "o", "n"] -[3.167636, "o", " "] -[3.313668, "o", "t"] -[3.460527, "o", "e"] -[3.561983, "o", "s"] -[3.63678, "o", "t"]`; + const response = await fetch('/session.cast'); + const asciicast = await response.text(); + return { scope_id: 'srcc_1234567890', asciicast: asciicast,