12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- clog(".")
-
-
-
-
-
-
-
- vcb_fn = {
- default_api_err(data,status,xhr){
- clog("default_api_err",{that:this,data,status,xhr,args:[...arguments]})
- },
- log_api_success(data,status,xhr){
- clog("log_api_success",{that:this,data,status,xhr,args:[...arguments]})
- },
-
- }
-
-
-
-
-
-
- // C:\bspace\repos\jc4\ign4\libs\mustache.js
-
-
-
-
- base_vapi_request = {
- // url: "https://api.digitalocean.com/v2/droplets",
- // data: file.qs,
- // cache:false,
- // "passme":"abc124",
- success: vcb_fn.log_api_success,
- error: vcb_fn.default_api_err,
- headers:{
- "Content-Type": "application/json",
- "Authorization": `Bearer ${localStorage.TOKEN}`,
- }
- }
-
-
-
- function fillTemplate5(a){
- return a
- }
-
- function vapi_req(obj,tv={}){
- /*
- if (!tflag){
- clog("NO tflag")
- return
- }
- */
- // console.trace("vapi_req")
- var ajx_arg = Object.assign({},base_vapi_request,obj)
- // clog("URL0",JSON.stringify(ajx_arg),ajx_arg)
- ajx_arg.url = fillTemplate5(ajx_arg.url,tv)
- if (!ajx_arg.url.startsWith("https://api.digitalocean.com")){
- console.error("WRONG SITE",ajx_arg.url)
- return
- }
- // if (is_token_set()){ return token_not_set()}
- clog("vapi_req_0",ajx_arg)
- // clog("vapi_req_1",jc(ajx_arg))
- // clog("URL1",JSON.stringify(ajx_arg),ajx_arg)
-
- /*
- var aii = $.ajax(ajx_arg)
- */
- }
-
|