-
Notifications
You must be signed in to change notification settings - Fork 1
/
lnl_customization.html
197 lines (168 loc) · 6.15 KB
/
lnl_customization.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Customize Loop</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}
h1 {
color: #333;
}
div {
margin-bottom: 20px;
}
label {
display: block;
margin: 0px 0;
padding: 6px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
button {
display: block;
margin-top: 20px;
padding: 10px 20px;
font-size: 18px;
color: #fff;
background-color: #007BFF;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
textarea {
width: 100%;
height: 500px;
margin-top: 20px;
padding: 10px;
box-sizing: border-box;
border: none;
background-color: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<h1>Customize Loop</h1>
<div>
<label><input type="checkbox" id="option1"> Increase Future Carbs Limit to 4 hours</label><br>
<label><input type="checkbox" id="option2"> Libre Users: Limit Loop to <5 minutes</label><br>
<label><input type="checkbox" id="option3"> Modify Carb Warning & Limit: Low Carb to 49 & 99</label><br>
<label><input type="checkbox" id="option4"> Modify Carb Warning & Limit: High Carb to 201 &300</label><br>
<label><input type="checkbox" id="option5"> Disable Authentication Requirement</label><br>
<label><input type="checkbox" id="option6"> Override Insulin Needs Picker (50% to 200%, steps of 5%)</label><br>
<label><input type="checkbox" id="option7"> CAGE: Upload Pod Start to Nightscout</label><br>
<label><input type="checkbox" id="option8"> SAGE: Upload G6 Sensor Start to Nightscout</label><br>
<label><input type="checkbox" id="option9"> Change Default to Upload G6 Readings</label><br>
</div>
<button id="copyButton">Copy to Clipboard</button>
<textarea id="output" readonly></textarea>
<script>
let options = [
];
function indent(level) {
return ' '.repeat(level * 2);
}
function addOption(id, comment, url, directory = '') {
let command = `curl ${url} | git apply`;
if (directory) {
command += ` --directory=${directory}`;
}
let text = `
${indent(5)}# ${comment}
${indent(5)}${command}
`;
options.push({
id: id,
text: text
});
}
addOption(
'option1',
'Loop: Increase future carb time limit to 4 hours from 1 hour default',
'https://github.com/loopnlearn/Loop/commit/a974b6749ef4506ca679a0061c260dabcfbf9ee2.patch',
'Loop'
);
addOption(
'option2',
'Loop: LoopDataManager: Limit loop cycles to no more frequent than once every 4.8 minutes',
'https://github.com/loopnlearn/Loop/commit/414588c5e7dc36f692c8bbcf2d97adde1861072a.patch',
'Loop'
);
addOption(
'option3',
'Loop: LoopConstants: Limit carb entry to 99 and shows warning if over 49 g',
'https://github.com/loopnlearn/Loop/commit/d9939c65a6b2fc088ee5acdf0d9dc247ad30986c.patch',
'Loop'
);
addOption(
'option4',
'Loop: Modify Carb Warning & Limit: High Carb to 201 & 300',
'https://github.com/loopnlearn/Loop/commit/a79482ac638736c2b3b8c5057b48e3097323a522.patch',
'Loop'
);
addOption(
'option5',
'LoopKit: Disable Authentication Requirement',
'https://github.com/loopnlearn/LoopKit/commit/77ee44534dd16154d910cfb11dea240cf8a23262.patch',
'LoopKit'
);
addOption(
'option6',
'LoopKit: Override Insulin Needs Picker (50% to 200%, steps of 5%)',
'https://github.com/loopnlearn/LoopKit/commit/f35654104f70b7dc70f750d129fbb338b9a4cee0.patch',
'LoopKit'
);
addOption(
'option7',
'CAGE: Upload Pod Start to Nightscout',
'https://raw.githubusercontent.com/loopnlearn/loopbuildscripts/main/patch/cage.patch'
);
addOption(
'option8',
'CGMBLEKit: SAGE: Upload G6 Sensor Start to Nightscout',
'https://github.com/loopnlearn/CGMBLEKit/commit/777c7e36de64bdc060973a6628a02add0917520e.patch',
'CGMBLEKit'
);
addOption(
'option9',
'CGMBLEKit: Change Default to Upload G6 Readings',
'https://github.com/loopnlearn/CGMBLEKit/commit/b9638cc7cef74b1da74c950c0dbb3525f157e11f.patch',
'CGMBLEKit'
);
const initialText = indent(3) + `# Customize Loop: Download and apply patches
${indent(3)}- name: Customize Loop
${indent(4)}run: |`;
const output = document.getElementById('output');
const copyButton = document.getElementById('copyButton');
function updateOutput() {
let text = initialText;
options.forEach(option => {
const checkbox = document.getElementById(option.id);
if (checkbox.checked) {
text += option.text;
}
});
output.value = text;
}
options.forEach(option => {
const checkbox = document.getElementById(option.id);
checkbox.addEventListener('change', updateOutput);
});
copyButton.addEventListener('click', () => {
output.select();
document.execCommand('copy');
alert('Text copied to clipboard!');
});
updateOutput();
</script>
</body>
</html>