diff --git a/README.md b/README.md index a5dc603..a0e381d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@
Get Started | - Demo + Demo | Contributing
diff --git a/src/Controllers/Issues.php b/src/Controllers/Issues.php index 6be6492..679f9fa 100644 --- a/src/Controllers/Issues.php +++ b/src/Controllers/Issues.php @@ -35,6 +35,8 @@ public function index(): string $q = trim((string)$this->request->getGet('q')); $page = max(1, (int) ($this->request->getGet('page') ?? 1)); $perPage = max(1, min(100, (int) ($this->request->getGet('per_page') ?? 25))); + $ciEnvironment = strtolower(trim((string) getenv('CI_ENVIRONMENT'))); + $isDexRunningInProduction = $ciEnvironment === 'production'; try { $data = $this->orchestrator->getIssuesData($status, $q, $page, $perPage); @@ -43,6 +45,8 @@ public function index(): string 'title' => 'Issues', 'dataUrl' => site_url(dex_route_prefix() . '/issues/data'), 'detailBaseUrl' => site_url(dex_route_prefix() . '/issues'), + 'isDexRunningInProduction' => $isDexRunningInProduction, + 'ciEnvironment' => $ciEnvironment, ])); } catch (DexException $e) { return view('Dex\\dex/error', [ @@ -81,7 +85,7 @@ public function dialog(int $id): ResponseInterface|string return view('Dex\\dex/issues_dialog_shell', array_merge($data, [ 'dialogUrl' => site_url(dex_route_prefix() . '/issues/' . $id . '/dialog'), 'resolveUrl' => site_url(dex_route_prefix() . '/issues/' . $id . '/resolve'), - 'ignoreUrl' => site_url(dex_route_prefix() . '/issues/' . $id . '/ignore'), + 'ignoreUrl' => site_url(dex_route_prefix() . '/issues/' . $id . '/ignore') ])); } catch (IssueNotFoundException) { return $this->response->setStatusCode(404)->setBody('Issue not found'); diff --git a/src/Views/dex/_js.php b/src/Views/dex/_js.php index a1b1e61..025076b 100644 --- a/src/Views/dex/_js.php +++ b/src/Views/dex/_js.php @@ -19,6 +19,15 @@ searchTimer: null, }; + const dexIssuesDeepLinkState = (() => { + const params = new URLSearchParams(window.location.search || ''); + const issueId = Number(params.get('issue_id') || 0); + return { + issueId: Number.isFinite(issueId) && issueId > 0 ? issueId : null, + opened: false, + }; + })(); + const dexIssueDialogState = { issueId: null, occurrenceId: null, @@ -207,6 +216,8 @@ function dexIssuesRenderRows() { return; } + dexIssuesTryOpenDeepLinkedIssue(); + if (!issues.length) { tbody.innerHTML = 'Unique exceptions grouped by fingerprint. Each issue aggregates all matching events.
++ + Production mode - Secure DEX + + = esc(ucfirst((string)($ciEnvironment ?? 'unknown'))) ?> mode + +