Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ startWorkflowDisabled: false
hideWorkflowQueryErrors: false
refreshWorkflowCountsDisabled: false
activityCommandsDisabled: false
disableTrackingPixel: false
auth:
enabled: false
providers:
Expand Down
1 change: 1 addition & 0 deletions server/config/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ startWorkflowDisabled: {{ env "TEMPORAL_START_WORKFLOW_DISABLED" | default "fals
hideWorkflowQueryErrors: {{ env "TEMPORAL_HIDE_WORKFLOW_QUERY_ERRORS" | default "false" }}
refreshWorkflowCountsDisabled: {{ env "TEMPORAL_REFRESH_WORKFLOW_COUNTS_DISABLED" | default "false" }}
activityCommandsDisabled: {{ env "TEMPORAL_ACTIVITY_COMMANDS_DISABLED" | default "false" }}
disableTrackingPixel: {{ env "TEMPORAL_DISABLE_TRACKING_PIXEL" | default "false" }}
cors:
cookieInsecure: {{ env "TEMPORAL_CSRF_COOKIE_INSECURE" | default "false" }}
unsafeAllowAllOrigins: {{ env "TEMPORAL_CORS_UNSAFE_ALLOW_ALL_ORIGINS" | default "false" }}
Expand Down
2 changes: 2 additions & 0 deletions server/server/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type SettingsResponse struct {
HideWorkflowQueryErrors bool
RefreshWorkflowCountsDisabled bool
ActivityCommandsDisabled bool
DisableTrackingPixel bool
}

func TemporalAPIHandler(cfgProvider *config.ConfigProviderWithRefresh, apiMiddleware []Middleware, conn *grpc.ClientConn) echo.HandlerFunc {
Expand Down Expand Up @@ -153,6 +154,7 @@ func GetSettings(cfgProvider *config.ConfigProviderWithRefresh) func(echo.Contex
HideWorkflowQueryErrors: cfg.HideWorkflowQueryErrors,
RefreshWorkflowCountsDisabled: cfg.RefreshWorkflowCountsDisabled,
ActivityCommandsDisabled: cfg.ActivityCommandsDisabled,
DisableTrackingPixel: cfg.DisableTrackingPixel,
}

return c.JSON(http.StatusOK, settings)
Expand Down
2 changes: 2 additions & 0 deletions server/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ type (
RefreshWorkflowCountsDisabled bool `yaml:"refreshWorkflowCountsDisabled"`
// Whether to disable activity commands in the UI
ActivityCommandsDisabled bool `yaml:"activityCommandsDisabled"`
// Whether to disable the tracking pixel in the UI
DisableTrackingPixel bool `yaml:"disableTrackingPixel"`
// Forward specified HTTP headers from HTTP API requests to Temporal gRPC backend
ForwardHeaders []string `yaml:"forwardHeaders"`
HideLogs bool `yaml:"hideLogs"`
Expand Down
43 changes: 43 additions & 0 deletions src/lib/components/session-pixel.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script lang="ts">
import { onMount } from 'svelte';

import { page } from '$app/state';

const TRACKING_PIXEL_BASE_URL =
'https://wpt.tomwheeler.com/cgi-sys/cgiwrap/twheeler/wtp.cgi';
let trackingPixelURL = $state('');

const disableTrackingPixel = $derived(
page.data?.settings?.disableTrackingPixel,
);

const uidKey = 'temporal-user-uuid';
const clusterId = $derived(page.data?.systemInfo?.clusterId);
const srcId = 'temporal-web-ui';

onMount(() => {
if (
!disableTrackingPixel &&
!sessionStorage.getItem('session-pixel-fired')
) {
let uuid = localStorage.getItem(uidKey);
if (!uuid) {
uuid = crypto.randomUUID();
localStorage.setItem(uidKey, uuid);
}
sessionStorage.setItem('session-pixel-fired', 'true');
trackingPixelURL = `${TRACKING_PIXEL_BASE_URL}?srcid=${clusterId}:${uuid}:${srcId}`;
}
});
</script>

{#if trackingPixelURL}
<img
src={trackingPixelURL}
alt=""
aria-hidden="true"
width="1"
height="1"
style="position:absolute;left:-9999px"
/>
{/if}
1 change: 1 addition & 0 deletions src/lib/services/settings-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const fetchSettings = async (request = fetch): Promise<Settings> => {
refreshWorkflowCountsDisabled:
!!settingsResponse?.RefreshWorkflowCountsDisabled,
activityCommandsDisabled: !!settingsResponse?.ActivityCommandsDisabled,
disableTrackingPixel: !!settingsResponse?.DisableTrackingPixel,

showTemporalSystemNamespace: settingsResponse?.ShowTemporalSystemNamespace,
feedbackURL: settingsResponse?.FeedbackURL,
Expand Down
1 change: 1 addition & 0 deletions src/lib/svelte-mocks/app/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const settings: Settings = {
workflowTerminateDisabled: false,
hideWorkflowQueryErrors: false,
activityCommandsDisabled: false,
disableTrackingPixel: false,
feedbackURL: '',
runtimeEnvironment: {
isCloud: false,
Expand Down
1 change: 1 addition & 0 deletions src/lib/types/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export type Settings = {
hideWorkflowQueryErrors: boolean;
batchActionsDisabled: boolean;
activityCommandsDisabled: boolean;
disableTrackingPixel: boolean;
showTemporalSystemNamespace: boolean;
feedbackURL: string;
runtimeEnvironment: {
Expand Down
1 change: 1 addition & 0 deletions src/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export type SettingsResponse = {
HideWorkflowQueryErrors: boolean;
RefreshWorkflowCountsDisabled: boolean;
ActivityCommandsDisabled: boolean;
DisableTrackingPixel: boolean;
ShowTemporalSystemNamespace: boolean;
FeedbackURL: string;
Version: string;
Expand Down
2 changes: 2 additions & 0 deletions src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import BottomNavigation from '$lib/components/bottom-nav.svelte';
import DataEncoderSettings from '$lib/components/data-encoder-settings.svelte';
import NamespacePicker from '$lib/components/namespace-picker.svelte';
import SessionPixel from '$lib/components/session-pixel.svelte';
import SideNavigation from '$lib/components/side-nav.svelte';
import SkipNavigation from '$lib/components/skip-nav.svelte';
import TopNavigation from '$lib/components/top-nav.svelte';
Expand Down Expand Up @@ -316,3 +317,4 @@
</BottomNavigation>
</MainContentContainer>
</div>
<SessionPixel />
Loading