|
227 | 227 | throw new Error("Template name cannot be empty"); |
228 | 228 | } |
229 | 229 |
|
230 | | - // Get parameters from textarea |
231 | 230 | const paramsText = document.getElementById("paramsInput").value; |
232 | 231 | const params = JSON.parse(paramsText); |
233 | 232 |
|
234 | | - // Measure rendering time |
235 | | - const startTime = performance.now(); |
236 | | - |
237 | | - // Call the WASM function with template name and parameters |
238 | | - // Get helpers from textarea |
239 | 233 | const helpersText = document.getElementById("helpersInput").value; |
240 | 234 | const helpers = JSON.parse(helpersText); |
241 | 235 |
|
| 236 | + const startTime = performance.now(); |
242 | 237 | const result = RenderTemplate(templateName, JSON.stringify(params), JSON.stringify(helpers)); |
243 | | - |
244 | | - // Calculate rendering time |
245 | 238 | const endTime = performance.now(); |
246 | 239 | const renderTime = endTime - startTime; |
247 | 240 |
|
248 | 241 | try { |
249 | | - // Parse the result JSON |
250 | 242 | const files = JSON.parse(result); |
251 | | - |
252 | | - // Calculate total size |
253 | | - let totalSize = 0; |
254 | | - Object.values(files).forEach(content => { |
255 | | - totalSize += content.length; |
256 | | - }); |
| 243 | + let totalSize = result.length; |
257 | 244 |
|
258 | 245 | // Add summary information |
259 | 246 | const summaryDiv = document.createElement("div"); |
|
403 | 390 | </script> |
404 | 391 | </head> |
405 | 392 | <body> |
406 | | - <h1>Databricks Template Renderer</h1> |
| 393 | + <h1>Databricks Asset Bundles Template Renderer</h1> |
407 | 394 | <p>Customize the parameters below and click the button to render the template.</p> |
408 | 395 |
|
409 | 396 | <div class="params-container"> |
|
0 commit comments