-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(doc) add event filter query parser
- Loading branch information
1 parent
ede5f2c
commit 7ba512e
Showing
7 changed files
with
1,782 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=.8"> | ||
<meta name="color-scheme" content="light dark" /> | ||
<title>OPC UA EventFilter Query Language</title> | ||
<link rel="stylesheet" href="pico.min.css" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<script src="jquery-3.7.1.min.js"></script> | ||
<script src="query.js"></script> | ||
<script type="text/javascript"> | ||
function pretty(j) { | ||
if(j[0] != '{') { | ||
return j; | ||
} | ||
while(j.substring(j.length - 1) != '}') { | ||
j = j.substring(0, j.length - 1); | ||
} | ||
|
||
try { | ||
var jsonObj = JSON.parse(j); | ||
return JSON.stringify(jsonObj, null, '\t'); | ||
} catch(err) { | ||
return j; | ||
} | ||
} | ||
|
||
parse_fun = Module.cwrap('parse', 'string', ['string']) | ||
|
||
$(document).ready(function() { | ||
$("#submitForm").submit(function(e){ | ||
e.preventDefault(); | ||
out = parse_fun($("#query").val()); | ||
$("#result").val(pretty(out)); | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<header class="container"><h1>OPC UA EventFilter Query Language</h1></header> | ||
<main class="container"> | ||
<div class="grid"> | ||
<div> | ||
<h3>Query Input</h3> | ||
<form id="submitForm"> | ||
<textarea id="query" rows ="25" placeholder="Enter query here..."></textarea> | ||
<br/> | ||
<input type="submit" value="Submit"> | ||
</form> | ||
</div> | ||
<div> | ||
<h3>Result</h3> | ||
<textarea id="result" rows="25"></textarea> | ||
</div> | ||
</div> | ||
</main> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.