home.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <html>
  2. <head>
  3. <title>Hello World!</title>
  4. <!-- You can use the files located inside the ./web directory of the core system as well-->
  5. <link rel="stylesheet" href="../script/semantic/semantic.min.css">
  6. <script src="../script/jquery.min.js"></script>
  7. <script src="../script/ao_module.js"></script>
  8. <style>
  9. body{
  10. background-color:white;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <br>
  16. <div class="ui container">
  17. <h1>Hello World! This is a demo subservice for ArOZ Online System.</h1>
  18. <p>You can also try to open txt / md file with this subservice module</p>
  19. <p>Selected Files: </p>
  20. <p id="fileList"></p>
  21. <button class="ui button" onclick="doSomething();">Call ao_module API (File Selector)</button>
  22. <button class="ui button" onclick="runAGI();">Check Desktop Files</button>
  23. <div class="ui divider"></div>
  24. <p>File List (Click the button above to test)</p>
  25. <div id="filelist" class="ui ordered list">
  26. </div>
  27. </div>
  28. <script>
  29. function doSomething(){
  30. //You can call ao_module directly after included ao_module.js
  31. ao_module_openFileSelector(fileSelected);
  32. }
  33. function fileSelected(filedata){
  34. $("#fileList").html("");
  35. for (var i=0; i < filedata.length; i++){
  36. var filename = filedata[i].filename;
  37. var filepath = filedata[i].filepath;
  38. $("#fileList").append(`<p>${filename} / ${filepath}</p>`)
  39. }
  40. }
  41. function runAGI(){
  42. ao_module_agirun("demo/agi/listdesktop.js", {}, function(results){
  43. if (results.error !== undefined){
  44. alert(results.error);
  45. }else{
  46. $("#filelist").html("");
  47. results.forEach(item => {
  48. $("#filelist").append(`<div class="item">${item}</div>`);
  49. });
  50. }
  51. });
  52. }
  53. </script>
  54. </body>
  55. </html>