|
3 | 3 | <meta charset="UTF-8"> |
4 | 4 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> |
5 | 5 | <script src="/js/main.js"></script> |
6 | | - <script type="module" src="/js/dangerModal.js"></script> |
7 | | - <script type="module" src="/js/operations.js"></script> |
8 | | - <script type="module" src="/js/output.js"></script> |
9 | | - <script type="module" src="/js/roleBadge.js"></script> |
10 | 6 | <link rel="stylesheet" href="/css/style.css"> |
11 | 7 | <style> |
12 | 8 | .gcp-examples-box { |
@@ -58,26 +54,25 @@ <h1>UID2 Env - GCP Enclave ID Tool</h1> |
58 | 54 |
|
59 | 55 | <div class="main-content"> |
60 | 56 | <div class="operations-container"></div> |
61 | | - <div class="output-container"></div> |
62 | 57 | </div> |
63 | 58 |
|
64 | 59 | <!-- GCP Examples Section - positioned below operations and output --> |
65 | 60 | <div class="gcp-examples-box"> |
66 | 61 | <h3>Generated Examples</h3> |
67 | | - |
| 62 | + |
68 | 63 | <label for="cloudInitSha256">cloud-init sha256, make sure your downloaded cloud-init config matches exactly the value below:</label> |
69 | 64 | <pre><label id="cloudInitSha256">TBD</label></pre> |
70 | | - |
| 65 | + |
71 | 66 | <label for="gcloudCli">Example gcloud command to create GCP Operator Enclave VM:</label> |
72 | 67 | <textarea id="gcloudCli" name="gcloudCli" readonly></textarea> |
73 | | - |
| 68 | + |
74 | 69 | <label for="enclaveId">Generated GCP Enclave ID:</label> |
75 | 70 | <pre><label id="enclaveId">TBD</label></pre> |
76 | 71 | </div> |
77 | 72 |
|
78 | 73 | <script type="module"> |
79 | | -import { initializeOperations } from '/js/operations.js'; |
80 | | -import { initializeOutput } from '/js/output.js'; |
| 74 | +import { initializeOperations } from '/js/component/operations.js'; |
| 75 | +import { initializeOutput } from '/js/component/output.js'; |
81 | 76 |
|
82 | 77 | document.addEventListener('DOMContentLoaded', function () { |
83 | 78 | const gcloudCliOrig = `$ sha256sum < ./<CLOUD_INIT_FN> # !!! check if sha256 matches exactly below !!!\\ |
@@ -185,19 +180,53 @@ <h3>Generated Examples</h3> |
185 | 180 | } |
186 | 181 |
|
187 | 182 | const operationConfig = { |
188 | | - write: { |
189 | | - title: 'GCP Enclave Operations', |
190 | | - operations: [ |
| 183 | + write: [ |
191 | 184 | { |
192 | 185 | id: 'generateGcpEnclaveConfig', |
193 | 186 | title: 'Generate GCP cloud-init, Enclave ID and gcloud command', |
194 | 187 | role: 'elevated', |
195 | 188 | inputs: [ |
196 | | - diskUriInput, |
197 | | - apiTokenInput, |
198 | | - imageIdInput, |
199 | | - envIdSelectInput, |
200 | | - accessTokenInput |
| 189 | + |
| 190 | + { |
| 191 | + name: 'diskUri', |
| 192 | + label: 'GCP Disk URI', |
| 193 | + required: true, |
| 194 | + size: 3, |
| 195 | + placeholder: 'To get the latest: gcloud compute images list --filter="name~\'cos-stable\'" --standard-images --uri' |
| 196 | + }, |
| 197 | + { |
| 198 | + name: 'apiToken', |
| 199 | + label: 'Operator Api Key', |
| 200 | + required: true, |
| 201 | + size: 3, |
| 202 | + placeholder: 'Enter the operator API key' |
| 203 | + }, |
| 204 | + { |
| 205 | + name: 'imageId', |
| 206 | + label: 'Operator Docker Image ID', |
| 207 | + required: true, |
| 208 | + size: 3, |
| 209 | + placeholder: 'The full digest for the image, with or without \'sha256:\'' |
| 210 | + }, |
| 211 | + { |
| 212 | + name: 'envId', |
| 213 | + label: 'Environment', |
| 214 | + type: 'select', |
| 215 | + required: true, |
| 216 | + size: 1, |
| 217 | + defaultValue: 'integ', |
| 218 | + options: [ |
| 219 | + { value: 'integ', label: 'Integration' }, |
| 220 | + { value: 'prod', label: 'Production' } |
| 221 | + ] |
| 222 | + }, |
| 223 | + { |
| 224 | + name: 'accesstokenId', |
| 225 | + label: 'Docker Registry Access Token', |
| 226 | + required: true, |
| 227 | + size: 3, |
| 228 | + placeholder: 'Personal Access Token that allows read access to ghcr.io' |
| 229 | + } |
201 | 230 | ], |
202 | 231 | description: 'Generates GCP cloud-init configuration file, calculates Enclave ID, and provides gcloud command for VM creation.<br><br><strong>Note:</strong> The Operator Api Key can be found in <a href="operator-key.html">Operator Key Management</a> using the "Reveal Operator Key" operation.', |
203 | 232 | preProcess: async (inputs) => { |
@@ -277,11 +306,9 @@ <h3>Generated Examples</h3> |
277 | 306 | } |
278 | 307 | } |
279 | 308 | ] |
280 | | - } |
281 | 309 | }; |
282 | 310 |
|
283 | 311 | initializeOperations(operationConfig); |
284 | | - initializeOutput(); |
285 | 312 | }); |
286 | 313 | </script> |
287 | 314 |
|
|
0 commit comments