Alan Yeung 2 лет назад
Родитель
Сommit
61622b7e95

BIN
web/Lambda/img/function_icon.png


BIN
web/Lambda/img/function_icon.psd


BIN
web/Lambda/img/small_icon.png


BIN
web/Lambda/img/small_icon.psd


+ 91 - 0
web/Lambda/index.html

@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta name="apple-mobile-web-app-capable" content="yes" />
+        <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>
+        <meta charset="UTF-8">
+        <meta name="theme-color" content="#4b75ff">
+        <link rel="stylesheet" href="../script/semantic/semantic.min.css">
+        <script src="../script/jquery.min.js"></script>
+        <script src="../script/ao_module.js"></script>
+        <script src="../script/semantic/semantic.min.js"></script>
+        <title>Lambda @ arozos</title>
+        <style>
+            body{
+                background-color:white;
+            }
+        </style>
+    </head>
+    <body>
+        <div class="ui container" style="height: 100% !important;">
+            <div>
+                <br>
+                <h1 class="ui header">
+                    <span id="normalStatus">Lambda @ arozos</span>
+                    <div class="sub header">
+                       You can run our own AGI script without login by setting up the configuration below
+                    </div>
+                </h1>
+            </div>
+            <div class="ui divider"></div>
+            <div>
+                <table class="ui celled table">
+                    <thead>
+                        <tr>
+                            <th>UUID (access token)</th>
+                            <th>AGI Path</th>
+                            <th>Action</th>
+                        </tr>
+                    </thead>
+                    <tbody id="records">
+                    
+                    </tbody>
+                </table>
+                <div style="width: 100%" align="center">
+                    <div class="ui breadcrumb" id="pageIndexs">
+                    </div>
+                </div>
+            </div>
+            <div class="ui divider"></div>
+            <h4>Select AGI script Location</h4>
+                <div class="ui action fluid input">
+                    <input id="webroot" type="text" placeholder="Select Location" readonly="true">
+                    <button class="ui black button" onclick="openfileselector();"><i class="folder open icon"></i> Open</button>
+                </div>
+            <br><br>
+        </div>
+        <script>
+            $.getJSON( "/api/ajgi/listExt", function( data ) {
+                $.each( data, function( key, val ) {
+                   $("#records").append(`tr>
+                            <td>` + key +`</th>
+                            <td>` + val.path + `</td>
+                            <td>
+                                <button class="ui icon negative button">
+                                <i class="close icon"></i>
+                                </button>
+                            </td>
+                        </tr>`);
+                });
+            });
+
+            function openfileselector(){
+                ao_module_openFileSelector(fileLoader, "user:/", "file",false);
+            }
+
+
+            function fileLoader(filedata){
+                if (filedata.length == 0){
+                    $("#flist").text("No file selected");
+                    return;
+                }
+                $("#flist").html("");
+                for (var i =0; i < filedata.length; i++){
+                    $("#flist").append(filedata[i].filename + " / " + filedata[i].filepath + "<br>");
+                }
+            }
+
+
+        </script>
+    </body>
+</html>

+ 18 - 0
web/Lambda/init.agi

@@ -0,0 +1,18 @@
+/*
+	Dummy Module Registration Information
+	
+	Do not try to call any AJGI users / filepath functions in this script.
+*/
+
+
+//Define the launchInfo for the module
+var moduleLaunchInfo = {
+    Name: "Lambda",
+	Group: "Utilities",
+	IconPath: "Lambda/img/small_icon.png",
+	Version: "0.1",
+	StartDir: "Lambda/index.html"
+}
+
+//Register the module
+registerModule(JSON.stringify(moduleLaunchInfo));