File tree 2 files changed +37
-2
lines changed
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ window.bosco = {
5
5
endpoint : "https://qryn.endpoint.com" ,
6
6
log : async function ( log_content ) {
7
7
console . info ( log_content ) // don't do console.log or you'll create an infinite recursion
8
- this . send ( log_content )
8
+ window . bosco . send ( log_content )
9
9
} ,
10
10
init : function ( options ) {
11
11
this . endpoint = options ?. endpoint || this . endpoint
@@ -38,7 +38,7 @@ window.bosco = {
38
38
if ( ! indexed_id ) {
39
39
var res = await fetch ( this . endpoint + "/" + this . label + '/_doc/' , {
40
40
method : "POST" ,
41
- body : JSON . stringify ( log_content )
41
+ body : JSON . stringify ( log_content ) ,
42
42
} ) . catch ( ( err ) => {
43
43
console . error ( err )
44
44
} )
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
+ < meta name ="viewport " content ="width=800px, initial-scale=1.0 ">
7
+ < title > Boscaiolog Test</ title >
8
+ </ head >
9
+ < body >
10
+ < input type ="text " id ="url "> </ input >
11
+ < button id ="start "> Send</ button >
12
+ </ body >
13
+ < script src ="./boscaiolog.js "> </ script >
14
+ < script >
15
+ window . bosco . init ( {
16
+ consoleOverwrite : true ,
17
+ } )
18
+ let button = document . getElementById ( "start" )
19
+
20
+ button . addEventListener ( "click" , async function ( ev ) {
21
+ let url = document . getElementById ( "url" )
22
+ window . bosco . endpoint = url . value
23
+ console . log ( window . bosco . endpoint )
24
+ } )
25
+
26
+ setInterval ( sendALog , 10000 )
27
+
28
+ function sendALog ( ) {
29
+ console . log ( {
30
+ time : Date . now ( ) ,
31
+ msg : 'Bosco simulator'
32
+ } )
33
+ }
34
+ </ script >
35
+ </ html >
You can’t perform that action at this time.
0 commit comments