You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
status:'opened', // Opened/Closed status of the UI [Optional]
189
-
position:'bottom right', // Position of the UI: top left, top center, top right, center left, center right, bottom left, bottom center, bottom right [Optional]
202
+
importWebServerAIfrom'../assets/AI/js/webserverai.min.js'; // Get WebServerAI from assets
203
+
importEventsfrom'../assets/AI/js/components/Events.js'; // Get Events from the components [Optional]
204
+
205
+
if(window.WebServerAI!==undefined){ // Check if WebServerAI is active
206
+
let wsaEvent =newEvents(); // Load the events library
207
+
let wsc =newWebServerAI({ //Create a new WebServerAI object
208
+
enabled:true, // Enable the software
209
+
theme:'dark', // Change the theme light/dark [Optional]
210
+
codeTheme:'default', // Change the theme for prismJS [Optional]
211
+
status:'opened', // Set the UI collapse status [Optional]
212
+
position:'bottom right', // Sets the position of the UI [Optional]
190
213
history:{
191
-
save:'session'//Save history as a session/local storage [Optional]
214
+
save:'session'//Saves history as a sessionStorage [Optional]
192
215
},
193
-
cte:true, // Activates Cursor-Targeting Element [Optional]
194
-
/*
195
-
ui:{ // Configures the UI/GUI
196
-
preview: "", // IFrame to display commands
197
-
previewBtn: "", //Element to trigger the preview box
198
-
chatbox: "", //Element to input commands
199
-
submit: "", // Element to trigger the submit button
200
-
history: "", // Element to return the history information
201
-
rawOutput:true //Returns an array of raw HTML in text format to be displayed
202
-
},
203
-
204
-
*/
205
-
preview:'', // Connect to IFrame to preview the element [Optional]
206
-
extensions:{
207
-
// Add extensions here [Optional]
208
-
}
216
+
cte:true, // Enables Click-targeting element
217
+
extensions:{} // Load build extensions here
209
218
});
210
-
wsc.load(); //Loads the UI and the necessary scripts
219
+
wsc.load(); //Load the UI
211
220
wsc.submit(($input)=>{
212
221
if($input){
213
-
wsc.addCmd($input);
214
-
wsc.send($input, true);
222
+
wsc.addCmd($input);
223
+
wsc.send($input, true);
215
224
}
216
-
});
217
-
/*
218
-
* Waits until user press "enter" on the UI textbox.
219
-
* Checks the commands and then sends it to the AI and to process then execute.
220
-
*/
221
-
}
225
+
}); // Trigger events on submit
226
+
wsc.clearTextbox(); // Clears the textbox after submitting
227
+
}
222
228
</script>
223
229
```
224
230
231
+
### Configuration
232
+
233
+
| Name | Type | Default | Allowed values | Description |
0 commit comments