Skip to content

Commit 78f9a56

Browse files
committed
sequence: toggleable vcl logs
1 parent 53f1857 commit 78f9a56

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

assets/templates/partials/parse_form_partial.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<input type="checkbox" name="includeReturns" value="yes" {{ if .Sequence.IncludeReturns }}checked{{ end -}}>
2121
Include VCL returns
2222
</label>
23+
<label class="form-row">
24+
<input type="checkbox" name="includeVCLLogs" value="yes" {{ if .Sequence.IncludeVCLLogs }}checked{{ end -}}>
25+
Include VCL logs
26+
</label>
2327
<label class="form-row">
2428
<input type="checkbox" name="trackURLAndHost" value="yes" {{ if .Sequence.TrackURLAndHost }}checked{{ end -}}>
2529
Track URL and Host

internal/server/routes.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func indexHandler(version string) func(http.ResponseWriter, *http.Request) {
1919
data.Sequence.StepHeight = 40
2020
data.Sequence.IncludeCalls = false
2121
data.Sequence.IncludeReturns = false
22+
data.Sequence.IncludeVCLLogs = false
2223
data.Sequence.TrackURLAndHost = false
2324

2425
data.Timeline.Sessions = false
@@ -82,6 +83,7 @@ func parseHandler(version string) func(http.ResponseWriter, *http.Request) {
8283

8384
data.Sequence.IncludeCalls = r.Form.Get("includeCalls") == "yes"
8485
data.Sequence.IncludeReturns = r.Form.Get("includeReturns") == "yes"
86+
data.Sequence.IncludeVCLLogs = r.Form.Get("includeVCLLogs") == "yes"
8587
data.Sequence.TrackURLAndHost = r.Form.Get("trackURLAndHost") == "yes"
8688

8789
// Timeline settings

render/sequence.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type SequenceConfig struct {
4040
StepHeight int // height between each step
4141
IncludeCalls bool // whether to include all VCL calls
4242
IncludeReturns bool // whether to include all VCL returns
43+
IncludeVCLLogs bool // whether to include all VCL Logs
4344
TrackURLAndHost bool // whether to track all modifications to the URL and Host
4445
}
4546

@@ -272,12 +273,14 @@ func addTransactionLogs(s *svgsequence.Sequence, ts vsl.TransactionSet, tx *vsl.
272273
}
273274

274275
case vsl.VCLLogRecord:
275-
s.AddStep(svgsequence.Step{
276-
Source: V,
277-
Target: V,
278-
Text: truncateStr(record.String(), truncateLen),
279-
Color: ColorGray,
280-
})
276+
if cfg.IncludeVCLLogs {
277+
s.AddStep(svgsequence.Step{
278+
Source: V,
279+
Target: V,
280+
Text: truncateStr(record.String(), truncateLen),
281+
Color: ColorGray,
282+
})
283+
}
281284

282285
case vsl.LinkRecord:
283286
childTx := ts.GetTX(record.VXID)

0 commit comments

Comments
 (0)