Skip to content

Commit 5300090

Browse files
committed
simplification using alpine
1 parent b66b9f3 commit 5300090

File tree

1 file changed

+23
-29
lines changed

1 file changed

+23
-29
lines changed

views/main/partials/profilerReport.cfm

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@
99
id="cbd-profiler-report"
1010
class="cbd-rounded mt10 mb10 cbd-reportContainer"
1111
x-data="{
12-
profilerId : '#args.profiler.id#'
12+
profilerId : '#args.profiler.id#',
13+
statusCode : '#args.profiler.response.statusCode#',
14+
statusColor (){
15+
if( this.statusCode >= 200 && this.statusCode < 300 )
16+
return 'cbd-text-green'
17+
18+
if( this.statusCode >= 300 && this.statusCode < 400 )
19+
return 'cbd-text-blue'
20+
21+
return 'cbd-text-red'
22+
}
1323
}"
1424
>
1525

@@ -21,6 +31,7 @@
2131
<!--- VISUALIZER TOOLBAR --->
2232
<cfif args.isVisualizer>
2333

34+
<!--- Refresh Button --->
2435
<button
2536
type="button"
2637
title="Refresh"
@@ -35,6 +46,7 @@
3546
</svg>
3647
</button>
3748

49+
<!--- Back to Profilers --->
3850
<button
3951
type="button"
4052
title="Back to profilers"
@@ -53,28 +65,14 @@
5365
class="cbd-size13"
5466
>
5567
<span title="Status Code">
56-
<cfif args.profiler.response.statusCode gte 200 && args.profiler.response.statusCode lt 300 >
57-
<span class="cbd-text-green">
58-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
59-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
60-
</svg>
61-
#args.profiler.response.statusCode#
62-
</span>
63-
<cfelseif args.profiler.response.statusCode gte 300 && args.profiler.response.statusCode lt 400 >
64-
<span class="cbd-text-blue">
65-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
66-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
67-
</svg>
68-
#args.profiler.response.statusCode#
69-
</span>
70-
<cfelseif args.profiler.response.statusCode gte 400>
71-
<span class="cbd-text-red">
72-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
73-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
74-
</svg>
75-
#args.profiler.response.statusCode#
76-
</span>
77-
</cfif>
68+
69+
<span :class="statusColor">
70+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
71+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
72+
</svg>
73+
#args.profiler.response.statusCode#
74+
</span>
75+
7876
</span>
7977

8078
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
@@ -89,13 +87,9 @@
8987
class="cbd-floatRight cbd-size14 mt10 mr5 <cfif args.profiler.executionTime gt args.debuggerConfig.requestTracker.slowExecutionThreshold>cbd-badge-light<cfelse>cbd-badge-dark</cfif>"
9088
title="Total ColdBox Request Execution Time"
9189
>
92-
<cfif args.profiler.executionTime gt args.debuggerConfig.requestTracker.slowExecutionThreshold>
93-
<span class="cbd-text-red">
94-
#numberFormat( args.profiler.executionTime )# ms
95-
</span>
96-
<cfelse>
90+
<span class="<cfif args.profiler.executionTime gt args.debuggerConfig.requestTracker.slowExecutionThreshold>cbd-text-red</cfif>">
9791
#numberFormat( args.profiler.executionTime )# ms
98-
</cfif>
92+
</span>
9993
</div>
10094

10195
<!--- Current Event --->

0 commit comments

Comments
 (0)