diff --git a/docs/index.html b/docs/index.html index 7cdcea7..3c1526e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,22 +3,57 @@ ConfigLock Web Portal - + - -

ConfigLock Web Portal

- - - - - -
+ -

Result:

-
No data yet...
- - +
+ +
+

ConfigLock Web Portal

+
+ +
+
+ + + + + + + +
+ +
+ +
+
+
+ +
+ +
+

Result:

+
No data yet...
+
+
+

Errors / Status:

+
No errors yet..
+
+ +
+ +
+ + \ No newline at end of file diff --git a/docs/script.js b/docs/script.js index 2b92f49..42c460f 100644 --- a/docs/script.js +++ b/docs/script.js @@ -112,10 +112,6 @@ async function fetchFile() { const [pyodide, lockFileContents, pythonCode] = await fetchContents(lockFilePath, validatorFilePath); - - - - output.innerText = lockFileContents; output.contentEditable = 'true'; @@ -129,17 +125,35 @@ async function fetchFile() { timeoutId = setTimeout(() => { const parsedNewFile = YAML.parse(newContent); + + try{ validatorFunc( - pyoDide.toPy(parsedLockFile), pyoDide.toPy(parsedNewFile), + pyoDide.toPy(parsedLockFile), context ); - console.log("Success!") - + console.log("Success!"); + errors.innerText = "Sucess!"; + } catch(err){ + console.log('Error: ' + err.message); + const errorStartIndex = err.message.indexOf("ValidationError:"); + + if (errorStartIndex !== -1) { + const cleanMessage = err.message.substring(errorStartIndex).trim(); + + errors.innerText = cleanMessage; + //showNotificationBanner(cleanMessage); + + }else{ + console.log('Error: ' + err.message); + } + } + }, sleep_time); }; } catch (err) { output.innerText = 'Error: ' + err.message; + } } diff --git a/docs/styles.css b/docs/styles.css deleted file mode 100644 index 4363dff..0000000 --- a/docs/styles.css +++ /dev/null @@ -1,28 +0,0 @@ -body { - font-family: sans-serif; - max-width: 600px; - margin: 40px auto; - line-height: 1.6; -} - -input, -button { - display: block; - width: 100%; - margin-bottom: 10px; - padding: 10px; - box-sizing: border-box; -} - -#output { - background: #f4f4f4; - padding: 10px; - white-space: pre-wrap; - border: 1px solid #ccc; -} - -#url { - margin-bottom: 10px; - color: #666; - white-space: pre-wrap; -}