12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <html>
- <head>
- <title>Hello World!</title>
- <!-- You can use the files located inside the ./web directory of the core system as well-->
- <link rel="stylesheet" href="../script/semantic/semantic.min.css">
- <script src="../script/jquery.min.js"></script>
- <script src="../script/ao_module.js"></script>
- <style>
- body{
- background-color:white;
- }
- </style>
- </head>
- <body>
- <br>
- <div class="ui container">
- <h1>Hello World! This is a demo subservice for ArOZ Online System.</h1>
- <p>You can also try to open txt / md file with this subservice module</p>
- <p>Selected Files: </p>
- <p id="fileList"></p>
- <button class="ui button" onclick="doSomething();">Call ao_module API (File Selector)</button>
- <button class="ui button" onclick="runAGI();">Check Desktop Files</button>
- <div class="ui divider"></div>
- <p>File List (Click the button above to test)</p>
- <div id="filelist" class="ui ordered list">
- </div>
- </div>
-
- <script>
- function doSomething(){
- //You can call ao_module directly after included ao_module.js
- ao_module_openFileSelector(fileSelected);
- }
- function fileSelected(filedata){
- $("#fileList").html("");
- for (var i=0; i < filedata.length; i++){
- var filename = filedata[i].filename;
- var filepath = filedata[i].filepath;
- $("#fileList").append(`<p>${filename} / ${filepath}</p>`)
- }
- }
- function runAGI(){
- ao_module_agirun("demo/agi/listdesktop.js", {}, function(results){
- if (results.error !== undefined){
- alert(results.error);
- }else{
- $("#filelist").html("");
- results.forEach(item => {
- $("#filelist").append(`<div class="item">${item}</div>`);
- });
- }
- });
- }
-
-
- </script>
- </body>
- </html>
|