@@ -34,30 +34,45 @@ <h2>Add Indexes</h2>
34
34
</ textarea > < br >
35
35
< button onclick ="tryCode('indexesCreate', 'indexesCreateRes'); "> Try</ button >
36
36
37
+ < p > You can now check if the new package_index was downloaded by repeating List Indexes.</ p >
38
+
39
+ < h2 > Remove Indexes</ h2 >
40
+ < p > You can add a new index with a POST request</ p >
41
+ < textarea cols ="100 " rows ="5 " id ="indexesRemove ">
42
+ fetch('http://localhost:8991/v2/pkgs/indexes/delete', {
43
+ method: "POST",
44
+ body: '{"url": "https://downloads.arduino.cc/packages/package_index.json"}'
45
+ })
46
+ </ textarea > < br >
47
+ < textarea cols ="100 " rows ="10 " id ="indexesRemoveRes ">
48
+
49
+ </ textarea > < br >
50
+ < button onclick ="tryCode('indexesRemove', 'indexesRemoveRes'); "> Try</ button >
51
+
52
+ < p > You can now check if the new package_index was removed by repeating List Indexes.</ p >
53
+
54
+
37
55
</ body >
38
56
39
57
< script >
40
- function tryCode ( code , target ) {
41
- code = document . getElementById ( code ) . textContent ;
42
- target = document . getElementById ( target ) ;
43
-
44
- var result = eval ( code ) ;
45
- result . then ( function ( res ) {
46
- target . innerHTML = res . statusText + "\n" ;
47
- return res . json ( ) ;
48
- } ) . then ( function ( body ) {
49
- target . innerHTML = target . innerHTML + JSON . stringify ( body , " " , " " ) ;
50
- return ;
51
- } )
52
- . catch ( function ( err ) {
53
-
54
- console . log ( err )
55
-
56
- target . innerText = err ;
57
- } )
58
-
59
- console . debug ( code , target , result )
60
- }
58
+ function tryCode ( code , target ) {
59
+ code = document . getElementById ( code ) . textContent ;
60
+ target = document . getElementById ( target ) ;
61
+
62
+ var result = eval ( code ) ;
63
+ result . then ( function ( res ) {
64
+ target . innerHTML = res . statusText + "\n" ; return res . text ( ) ;
65
+ } ) . then ( function ( body ) {
66
+ target . innerHTML = target . innerHTML + body ;
67
+ } ) . catch ( function ( err ) {
68
+
69
+ console . log ( err )
70
+
71
+ target . innerText = err ;
72
+ } )
73
+
74
+ console . debug ( code , target , result )
75
+ }
61
76
</ script >
62
77
63
78
</ html >
0 commit comments