Skip to content

Commit 665c463

Browse files
DOC-5064 started checklist implementation
1 parent b8fa6a6 commit 665c463

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed

content/develop/clients/jedis/produsage.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ weight: 6
1616
---
1717

1818
The following sections explain how to handle situations that may occur
19-
in your production environment.
19+
in your production environment. Use the checklist below to record your
20+
progress in implementing the recommendations.
21+
22+
{{< checklist "prodlist" >}}
23+
{{< checklist-item "#timeouts" >}}Timeouts{{< /checklist-item >}}
24+
{{< checklist-item "#exception-handling" >}}Exception handling{{< /checklist-item >}}
25+
{{< checklist-item "#general-exceptions" >}}General exceptions{{< /checklist-item >}}
26+
{{< checklist-item "#dns-cache-and-redis" >}}DNS cache and Redis{{< /checklist-item >}}
27+
{{< /checklist >}}
28+
29+
2030

2131
### Timeouts
2232

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<li>
2+
<select name="varp"
3+
onchange="clChange('prodlist')">
4+
<option value="R">&#x274C;</option>
5+
<option value="G">&#9989;</option>
6+
<option value="A">&#x1F50D;</option>
7+
<option value="X">&#x2205;</option>
8+
</select>
9+
{{- if index .Params 0 -}}
10+
<a href="{{ index .Params 0 }}">{{ .Inner }}</a>
11+
{{- else -}}
12+
{{ .Inner }}
13+
{{- end -}}
14+
</li>

layouts/shortcodes/checklist.html

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{{ $formId := index .Params 0 }}
2+
<form id="{{ $formId }}">
3+
<ul style="list-style-type: none;padding-left: 0px;">
4+
{{ .Inner }}
5+
</ul>
6+
<label for="gcount">&#9989; = </label>
7+
<output name="gcount" id="gcount">0</output>/<output name="gtotal"></output>,
8+
<label for="rcount">&#x274C; = </label>
9+
<output name="rcount" id="rcount">2</output>/<output name="rtotal"></output>,
10+
<label for="acount">&#x1F50D; = </label>
11+
<output name="acount" id="acount">0</output>/<output name="atotal"></output><br/>
12+
(<label for="xcount">&#x2205; = </label>
13+
<output name="xcount" id="xcount">0</output>/<output name="xtotal"></output>)
14+
</form>
15+
<script>
16+
document.addEventListener('DOMContentLoaded', () => {
17+
if (localStorage.getItem("{{ $formId }}")) {
18+
let choiceList = localStorage.getItem("{{ $formId }}");
19+
let form = document.getElementById(formId);
20+
let counts = {R: 0, G: 0, A: 0, X:0};
21+
22+
let listItems = form.getElementsByTagName("li");
23+
24+
for (const [index, elem] of listItems.entries()) {
25+
let menu = elem.getElementsByTagName("select")[0];
26+
let mvalue = choiceList[index];
27+
menu.value = mvalue;
28+
29+
counts[mvalue]++;
30+
}
31+
32+
form.elements["rcount"].value = counts["R"];
33+
form.elements["gcount"].value = counts["G"];
34+
form.elements["acount"].value = counts["A"];
35+
form.elements["xcount"].value = counts["X"];
36+
37+
let numClItems = listItems.length;
38+
form.elements["rtotal"].value = numClItems;
39+
form.elements["gtotal"].value = numClItems;
40+
form.elements["atotal"].value = numClItems;
41+
form.elements["xtotal"].value = numClItems;
42+
}
43+
44+
clChange("{{ $formId }}");
45+
});
46+
47+
function clChange(formId) {
48+
let form = document.getElementById(formId);
49+
let counts = {R: 0, G: 0, A: 0, X:0};
50+
51+
let listItems = form.getElementsByTagName("li");
52+
53+
for (let elem of listItems) {
54+
let menu = elem.getElementsByTagName("select")[0];
55+
let mvalue = menu.value;
56+
57+
counts[mvalue]++;
58+
}
59+
60+
form.elements["rcount"].value = counts["R"];
61+
form.elements["gcount"].value = counts["G"];
62+
form.elements["acount"].value = counts["A"];
63+
form.elements["xcount"].value = counts["X"];
64+
65+
let numClItems = listItems.length - counts["X"];
66+
form.elements["rtotal"].value = numClItems;
67+
form.elements["gtotal"].value = numClItems;
68+
form.elements["atotal"].value = numClItems;
69+
form.elements["xtotal"].value = listItems.length;
70+
}
71+
</script>

0 commit comments

Comments
 (0)