{{- $acctID := .Identity.Account.AccountID }} {{- $platform := .Platform }} {{- $parsedPlatform := "" }} {{- if not $platform }} {{- $platform = .Request.URL.Query.Get "platform" }} {{- if $platform }} {{- $parsedPlatform = (parsePlatform $platform) }} {{- end }} {{- end }} {{- $shopID := .ShopID }} {{- if not $shopID }} {{- $shopID = .Request.URL.Query.Get "shop-id" }} {{- end }} {{- $selectedShop := "" }} {{- $listingID := .ListingID }} {{- if not $listingID }} {{- $listingID = .Request.URL.Query.Get "listing-id" }} {{- end }} {{- $selectedListing := "" }} {{/* sse handler */}} {{/* shop selector */}} {{/* platform label */}}

Platform: {{ $platform }}

{{/* raw event table */}} {{- $evts := "" }} {{- if and $platform $shopID }} {{- $evts = .Reports.GetRawShopEvents $acctID $parsedPlatform $shopID }} {{- end }} {{/**/}} {{- if $evts }} {{- range $evt := $evts }} {{/**/}} {{- end }} {{- end }}
TimeEventIDEvent
{{$evt.EventTimestamp}}{{$evt.EventID}}{{prettyPrintJSON $evt.RawPayload}}
{{/* TODO: implement listing chart */}} {{- $displayListingReport := false }} {{- if and $platform $shopID }} {{- $displayListingReport = true }} {{- end }} {{/* listing selector */}} {{- if $displayListingReport }} {{- $report := "" }} {{- if $displayListingReport | and $listingID }} {{- $report = .Reports.GetListingCountsReport $acctID $parsedPlatform $shopID $listingID }} {{- end }} {{- if $report }} {{- $minCount := $report.MinCount.Count }} {{- $maxCount := $report.MaxCount.Count }} {{- $countRange := subInt64 $maxCount $minCount }} {{- $numCounts := len $report.Counts }}
{{/* will get replaced after loaded and upon resizing */}}
{{/*
{{- range $i, $count := $report.Counts }} {{- $height := multFloat (divFloat (subFloat (int64ToFloat $count.Count) (int64ToFloat $minCount)) (int64ToFloat $countRange)) 100 }} {{- $width := subFloat (divFloat 100 (intToFloat $numCounts)) 1 }} {{- $left := divFloat (intToFloat (multInt $i 100)) (intToFloat $numCounts) }} {{- $bottom := 0 }}
{{$count.Count}}
{{- end }}
{{- range $i, $count := $report.Counts }} {{- $height := multFloat (divFloat (subFloat (int64ToFloat $count.Count) (int64ToFloat $minCount)) (int64ToFloat $countRange)) 100 }} {{- $y := subFloat 100 (multFloat (divFloat (subFloat (int64ToFloat $count.Count) (int64ToFloat $minCount)) (int64ToFloat $countRange)) 100) }} {{- $width := subFloat (divFloat 100 (intToFloat $numCounts)) 1 }} {{- $x := divFloat (intToFloat (multInt $i 100)) (intToFloat $numCounts) }} {{$count.Count}} {{- end }} */}} {{- end }} {{/**/}} {{- if $report }} {{- range $count := $report.Counts }} {{- end }} {{- end }}
TimeEventIDCount
{{if $count.EventTimestamp}}{{$count.EventTimestamp}}{{end}} {{$count.Count}}
{{- end }}