[962] | 1 | <!doctype html> |
---|
| 2 | #import zoo |
---|
| 3 | #import html,os |
---|
| 4 | #set removeCacheFile=False |
---|
| 5 | #set strUrl=$inputs["tmpl"]["xlink:href"] |
---|
| 6 | #set currentUrl=$strUrl.replace($openapi["openapi"]["rootUrl"],"") |
---|
| 7 | #if $currentUrl=="/" |
---|
| 8 | #set currentKey="root" |
---|
| 9 | #set $currentUrl="/index" |
---|
| 10 | #else |
---|
| 11 | #set currentKey=$currentUrl |
---|
| 12 | #end if |
---|
| 13 | #set urlCompnents=$currentUrl.split('/') |
---|
| 14 | #* |
---|
| 15 | * Load the JSON content from the API |
---|
| 16 | *# |
---|
| 17 | #try |
---|
| 18 | #import json |
---|
| 19 | #if "cache_file" in $inputs["tmpl"] |
---|
[984] | 20 | #set values=json.load(open($inputs["tmpl"]["cache_file"], encoding='utf-8')) |
---|
[962] | 21 | #else |
---|
[984] | 22 | #set values=json.loads($inputs["tmpl"]["value"]) |
---|
[962] | 23 | #end if |
---|
| 24 | #except Exception as e |
---|
| 25 | $e |
---|
[984] | 26 | #set values={} |
---|
[962] | 27 | #end try |
---|
| 28 | <html lang="en"> |
---|
| 29 | <head> |
---|
| 30 | <!-- Required meta tags --> |
---|
| 31 | <meta charset="utf-8"> |
---|
| 32 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
---|
| 33 | |
---|
| 34 | <!-- Bootstrap CSS --> |
---|
| 35 | <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> |
---|
| 36 | |
---|
| 37 | <!-- Custom styles for this template --> |
---|
| 38 | <link href="$openapi["openapi"]["rootUrl"]/../static/openapi.css" rel="stylesheet"> |
---|
| 39 | |
---|
| 40 | <title>#if "id" in $values#$values["id"]#else##if $currentKey in $openapi and "title" in $openapi[$currentKey]#$openapi[$currentKey]["title"]#else#Landing Page#end if##end if#</title> |
---|
| 41 | </head> |
---|
| 42 | <body itemscope itemtype="https://schema.org/DataCatalog"> |
---|
| 43 | <header> |
---|
| 44 | <!-- Fixed navbar --> |
---|
| 45 | <nav |
---|
| 46 | class="navbar navbar-expand-md navbar-dark fixed-top bg-dark" |
---|
| 47 | itemprop="creator" |
---|
| 48 | itemscope itemtype="https://schema.org/Organization" > |
---|
| 49 | <a class="navbar-brand" href="#"> |
---|
| 50 | <img itemprop="logo" src="http://zoo-project.org/img/zoo-sun-logo.png" width="55" height="30" class="d-inline-block align-top" alt=""> |
---|
| 51 | <span itemprop="name">$conf["provider"]["providerName"]</span> |
---|
| 52 | </a> |
---|
| 53 | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> |
---|
| 54 | <span class="navbar-toggler-icon"></span> |
---|
| 55 | </button> |
---|
| 56 | <div class="collapse navbar-collapse" id="navbarCollapse"> |
---|
| 57 | <ul class="navbar-nav mr-auto" |
---|
| 58 | itemscope itemtype="https://schema.org/BreadcrumbList"> |
---|
| 59 | <li class="nav-item #if $currentKey=="root"# active#end if#" |
---|
| 60 | itemprop="itemListElement" itemscope |
---|
| 61 | itemtype="https://schema.org/ListItem"> |
---|
| 62 | <a itemprop="item" class="nav-link" |
---|
| 63 | href="$openapi["openapi"]["rootUrl"]/index.html"> |
---|
| 64 | <span itemprop="name">Home #if $currentKey=="root"# <span class="sr-only">(current)</span>#end if#</span> |
---|
| 65 | <meta itemprop="position" content="1" /> |
---|
| 66 | </a> |
---|
| 67 | </li> |
---|
| 68 | #if $currentKey!="root" |
---|
| 69 | #for i in range(1,len($urlCompnents)) |
---|
| 70 | <li |
---|
| 71 | itemprop="itemListElement" itemscope |
---|
| 72 | itemtype="https://schema.org/ListItem" |
---|
| 73 | class="nav-item #if $i+1==len($urlCompnents)#active#end if#"> |
---|
| 74 | #set prefix="" |
---|
| 75 | #for j in range(1,$i) |
---|
| 76 | #set $prefix+="/"+$urlCompnents[$j] |
---|
| 77 | #end for |
---|
| 78 | <a itemprop="item" class="nav-link" href="$openapi["openapi"]["rootUrl"]$(prefix)/$(urlCompnents[$i]).html"> |
---|
| 79 | <span itemprop="name"> |
---|
| 80 | #if $i==2 |
---|
| 81 | $(urlCompnents[$i]) |
---|
| 82 | #else |
---|
| 83 | $(urlCompnents[$i].title()) |
---|
| 84 | #end if |
---|
| 85 | #if $i+1==len($urlCompnents) |
---|
| 86 | <span class="sr-only">(current)</span> |
---|
| 87 | #end if |
---|
| 88 | <meta itemprop="position" content="$(i+1)" /> |
---|
| 89 | </span> |
---|
| 90 | </a> |
---|
| 91 | </li> |
---|
| 92 | #end for |
---|
| 93 | #end if |
---|
| 94 | </ul> |
---|
| 95 | </div> |
---|
| 96 | </nav> |
---|
| 97 | </header> |
---|
| 98 | <script> |
---|
| 99 | var System={}; |
---|
| 100 | </script> |
---|
| 101 | |
---|
| 102 | #def printRel($o,$v) |
---|
| 103 | #if $v in $o |
---|
| 104 | $o[$v] |
---|
| 105 | #else |
---|
| 106 | View default (no title found for $v). |
---|
| 107 | #end if |
---|
| 108 | #end def |
---|
| 109 | #* |
---|
| 110 | |
---|
| 111 | *# |
---|
| 112 | #def printControl(obj) |
---|
| 113 | #if "type" not in $obj |
---|
| 114 | #set oType="format" |
---|
| 115 | #else |
---|
| 116 | #set oType=$obj["type"] |
---|
| 117 | #end if |
---|
| 118 | <div class="input-group"> |
---|
| 119 | <div class="input-group-prepend"> |
---|
| 120 | <div class="input-group-text">$obj["title"]</div> |
---|
| 121 | </div> |
---|
| 122 | #if "ph" in $obj |
---|
| 123 | <input type="text" |
---|
| 124 | #if "value" in $obj#value="$obj["value"]""#end if# |
---|
| 125 | #if "id" in $obj#data-id="$obj["id"]"#end if# |
---|
| 126 | class="form-control" data-name="$obj["title"]" name="$(oType)_$obj["name"]" placeholder="$obj["ph"]" #if "required" in $obj#required#end if#/> |
---|
| 127 | #else |
---|
| 128 | <select name="$(oType)_$obj["name"]" class="form-control" #if "required" in $obj#required#end if#> |
---|
| 129 | #for i in range(len($obj["options"])) |
---|
| 130 | <option>$obj["options"][$i]</option> |
---|
| 131 | #end for |
---|
| 132 | </select> |
---|
| 133 | #end if |
---|
| 134 | #if "required" in $obj |
---|
| 135 | <div class="invalid-feedback"> |
---|
| 136 | Please set a value for $obj["id"]. |
---|
| 137 | </div> |
---|
| 138 | #end if |
---|
| 139 | </div> |
---|
| 140 | #end def |
---|
| 141 | #def printCard(obj) |
---|
| 142 | <div class="card" #if "attrs" in $obj#$obj["attrs"]#end if#> |
---|
| 143 | <div class="card-header" id="heading$(obj["id"])"> |
---|
| 144 | <h4 class="mb-0"> |
---|
| 145 | <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapse$(obj["id"])" aria-expanded="true" aria-controls="collapse$(obj["id"])"> |
---|
| 146 | $obj["title"] |
---|
| 147 | </button> |
---|
| 148 | </h4> |
---|
| 149 | </div> |
---|
| 150 | <div id="collapse$(obj["id"])" class="collapse #if "class" in $obj#$obj["class"]#end if#" aria-labelledby="heading$(obj["id"])"> |
---|
| 151 | <div class="card-body"> |
---|
| 152 | $obj["content"] |
---|
| 153 | </div> |
---|
| 154 | </div> |
---|
| 155 | </div> |
---|
| 156 | #end def |
---|
| 157 | #def printInputContent($obj) |
---|
| 158 | #set cName=$obj["id"].replace(".","_") |
---|
| 159 | #if "formats" in $obj["input"] |
---|
| 160 | #set cFormats=[] |
---|
| 161 | #for j in range(len($obj["input"]["formats"])) |
---|
| 162 | #set $cFormats+=[$obj["input"]["formats"][$j]["mimeType"]] |
---|
| 163 | #end for |
---|
| 164 | $printControl({"title": "format","type": "input_format","name": $cName,"options":$cFormats}) |
---|
| 165 | #set largs={"id": $obj["id"],"title": "href","type": "input_value","name": $cName,"ph":"URL"} |
---|
| 166 | #if $obj["minOccurs"]>0 |
---|
| 167 | #set $largs["required"]=True |
---|
| 168 | #end if |
---|
| 169 | $printControl($largs) |
---|
| 170 | #else |
---|
| 171 | #if "literalDataDomains" in $obj["input"] |
---|
| 172 | #set cDataDomain=$obj["input"]["literalDataDomains"][0] |
---|
| 173 | #set largs={"id": $obj["id"],"title": $cDataDomain["dataType"]["name"],"type": "input_value", "name": $cName,} |
---|
| 174 | #if $obj["minOccurs"]>0 |
---|
| 175 | #set $largs["required"]=True |
---|
| 176 | #end if |
---|
| 177 | #if "anyValue" in $cDataDomain["valueDefinition"] |
---|
| 178 | #set $largs["ph"]="Value" |
---|
| 179 | $printControl($largs) |
---|
| 180 | #else |
---|
| 181 | #if "allowedValues" in $cDataDomain["valueDefinition"] |
---|
| 182 | #set $largs["options"]=$cDataDomain["valueDefinition"]["allowedValues"] |
---|
| 183 | $printControl($largs) |
---|
| 184 | #else |
---|
| 185 | ELSE |
---|
| 186 | $obj |
---|
| 187 | #end if |
---|
| 188 | #end if |
---|
| 189 | #if "defaultValue" in $cDataDomain |
---|
| 190 | <script> |
---|
| 191 | System["function_$cName"]=function(){ |
---|
| 192 | try{ |
---|
| 193 | jQuery("input[name='input_value_$cName'],select[name='input_value_$cName]']").val($cDataDomain["defaultValue"]); |
---|
| 194 | }catch(e){ |
---|
| 195 | jQuery("input[name='input_value_$cName'],select[name='input_value_$cName']").val("$cDataDomain["defaultValue"]"); |
---|
| 196 | } |
---|
| 197 | } |
---|
| 198 | </script> |
---|
| 199 | #end if |
---|
| 200 | #else |
---|
| 201 | $obj |
---|
| 202 | ELSE |
---|
| 203 | #end if |
---|
| 204 | #end if |
---|
[984] | 205 | #if $obj["maxOccurs"]=="unbounded" or $obj["maxOccurs"]>1 |
---|
[965] | 206 | <div class="btn-group" role="group" aria-label="Basic example"> |
---|
| 207 | <button type="button" class="btn btn-secondary" onclick="addElementToList(\$(this));">Add</button> |
---|
| 208 | <button type="button" class="btn btn-secondary" onclick="delElementToList(\$(this));">Delete</button> |
---|
| 209 | </div> |
---|
| 210 | #end if |
---|
[962] | 211 | #end def |
---|
| 212 | #def printProvider(conf) |
---|
| 213 | #set provider=$conf["provider"] |
---|
| 214 | <b itemprop="name">$provider["providerName"]</b> |
---|
| 215 | <p><a itemprop="url" href="$provider["providerSite"]">$provider["providerSite"]</a></p> |
---|
| 216 | #end def |
---|
| 217 | #def printContact(conf) |
---|
| 218 | #set provider=$conf["provider"] |
---|
| 219 | #set alt=$openapi["provider_alt"] |
---|
| 220 | #set elements=list($alt.keys()) |
---|
| 221 | <b>Address</b> |
---|
| 222 | #for i in ["addressDeliveryPoint","addressCity","addressAdministrativeArea","addressPostalCode","addressCountry","addressElectronicMailAddress","phoneVoice","phoneFacsimile"] |
---|
| 223 | #if i!="addressElectronicMailAddress" and $provider[$i]!="False" |
---|
| 224 | <p itemprop="$(alt[$i.lower()])"> |
---|
| 225 | #if i=="phoneVoice" |
---|
| 226 | Phone |
---|
| 227 | <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-telephone" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
---|
| 228 | <path fill-rule="evenodd" d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z"/> |
---|
| 229 | </svg> |
---|
| 230 | #end if |
---|
| 231 | $provider[$i] |
---|
| 232 | </p> |
---|
| 233 | #else |
---|
| 234 | #if i=="addressElectronicMailAddress" |
---|
| 235 | <b>Email</b> |
---|
| 236 | <p itemprop="$(alt[$i.lower()])"> |
---|
| 237 | $provider[$i] |
---|
| 238 | </p> |
---|
| 239 | #end if |
---|
| 240 | #end if |
---|
| 241 | #end for |
---|
| 242 | #end def |
---|
| 243 | #def printIndentification(conf) |
---|
| 244 | #set provider=$conf["provider"] |
---|
| 245 | $printCard({"id": "provider","title": "Provider","content": $printProvider($conf),"class": "show"}) |
---|
| 246 | $printCard({"id": "contact","title": "Contact","content": $printContact($conf),"class": "show","attrs":'itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"'}) |
---|
| 247 | #end def |
---|
| 248 | |
---|
| 249 | #if $currentKey=="root" |
---|
| 250 | <div class="container-fluid"> |
---|
| 251 | <div class="row"> |
---|
| 252 | <div class="col-sm-8"> |
---|
| 253 | #end if |
---|
| 254 | <!-- $currentUrl --> |
---|
| 255 | <!-- Begin page content --> |
---|
| 256 | <main #if $currentKey!="root"#class="container-fluid"#end if#> |
---|
| 257 | <h1 itemprop="name">#if "id" in $values#$values["id"]: #end if##if "title" in $values#$html.escape($values["title"])#else##if len($urlCompnents)==2#$currentUrl[1:].title()#else#$currentUrl[1:]#end if##end if#</h1> |
---|
| 258 | #if "description" in $values#<p itemprop="description">$html.escape($values["description"])</p>#end if# |
---|
| 259 | #if $currentKey=="root" |
---|
| 260 | <div class="keywords"> |
---|
| 261 | #for i in $conf["identification"]["keywords"].split(',') |
---|
| 262 | <button type="button" |
---|
| 263 | class="btn btn-outline-info">$i</button> |
---|
| 264 | #end for |
---|
| 265 | </div> |
---|
| 266 | License: |
---|
| 267 | <a itemprop="license" href="$openapi["openapi"]["license_url"]">$openapi["openapi"]["license_name"]</a> |
---|
| 268 | #end if |
---|
| 269 | #if "inputs" in $values |
---|
| 270 | #set $cid="JOBSOCKET-"+$conf["lenv"]["usid"] |
---|
| 271 | <form class="needs-validation" data-id="$cid" novalidate> |
---|
[967] | 272 | <input type="hidden" name="oapi_ioAsArray" value="#if "io_as_array" in $openapi["openapi"]#$openapi["openapi"]["io_as_array"]#else#false#end if#" /> |
---|
| 273 | <input type="hidden" name="oapi_wsUrl" value="$openapi["openapi"]["wsurl"]" /> |
---|
| 274 | <input type="hidden" name="oapi_jobUrl" value="$openapi["openapi"]["rootUrl"]$(currentUrl)/jobs" /> |
---|
| 275 | <input type="hidden" name="oapi_reqID" value="$cid" /> |
---|
| 276 | <h3>Inputs</h3> |
---|
| 277 | <div class="accordion" id="accordionInputExample"> |
---|
| 278 | #for i in range(len(values["inputs"])) |
---|
| 279 | #set cInput=$values["inputs"][$i] |
---|
| 280 | #set cName=$cInput["id"].replace(".","_") |
---|
| 281 | $printCard({"id": $cName, "title": $cInput["id"],"content":'<p>'+$cInput["description"]+'</p>'+$printInputContent($cInput)}) |
---|
| 282 | #end for |
---|
| 283 | </div> |
---|
[962] | 284 | |
---|
[967] | 285 | <h3>Outputs</h3> |
---|
| 286 | <div class="accordion" id="accordionOutputExample"> |
---|
| 287 | #for i in range(len(values["outputs"])) |
---|
| 288 | #set cOutput=$values["outputs"][$i] |
---|
| 289 | #set cName=$cOutput["id"].replace(".","_") |
---|
| 290 | #set cFormats=[] |
---|
| 291 | #if "formats" in $cOutput["output"] |
---|
| 292 | #for j in range(len($cOutput["output"]["formats"])) |
---|
| 293 | #set cFormats+=[$cOutput["output"]["formats"][$j]["mimeType"]] |
---|
| 294 | #end for |
---|
| 295 | #end if |
---|
| 296 | #set cTransmissions=[] |
---|
| 297 | #for j in range(len($values["outputTransmission"])) |
---|
| 298 | #set cTransmissions+=[$values["outputTransmission"][$j]] |
---|
| 299 | #end for |
---|
| 300 | #set cContent="<p>"+$cOutput["description"]+"</p>" |
---|
| 301 | #if len(cFormats)>0 |
---|
| 302 | #set $cContent+=$printControl({"id": $cOutput["id"], "title": "format","type": "format","name": $cName,"options":$cFormats}) |
---|
| 303 | #end if |
---|
| 304 | #if len(cTransmissions)>0 |
---|
| 305 | #set $cContent+=$printControl({"id": $cOutput["id"], "title": "transmission","type": "transmission","name": $cName,"options":$cTransmissions}) |
---|
| 306 | #end if |
---|
| 307 | $printCard({"id": $cName+"_"+str($i),"title": $cOutput["id"],"content": $cContent}) |
---|
| 308 | #end for |
---|
| 309 | </div> |
---|
[962] | 310 | |
---|
[967] | 311 | <h3>Execution options</h3> |
---|
| 312 | <div class="accordion" id="accordionExampleExecutionMode"> |
---|
| 313 | #set cContent="" |
---|
| 314 | #set cUrl=$openapi["openapi"]["publisherurl"]+cid+"&type=" |
---|
| 315 | #for a in ["successUri","inProgressUri","failedUri"] |
---|
| 316 | #set $cContent+=$printControl({"title": $a,"type": "main_value","name": $a,"ph":"URL","value":$cUrl+$a.replace("Uri","")}) |
---|
| 317 | #end for |
---|
| 318 | $printCard({"id":"ModeOne","title":"Subscribers","content": $cContent}) |
---|
| 319 | $printCard({"id":"ModeTwo","title":"Response","content": $printControl({"title":"format","type": "main_value","name": "format","options":["document","raw"]})}) |
---|
| 320 | $printCard({"id":"ModeThree","title":"Mode","content": $printControl({"title":"mode","type": "main_value","name": "mode","options":["async","sync"]})}) |
---|
| 321 | </div> |
---|
| 322 | |
---|
| 323 | <button type="submit" class="btn btn-primary" >Submit</button> |
---|
| 324 | </form> |
---|
[962] | 325 | <div class="modal" tabindex="-1" id="exampleModal"> |
---|
| 326 | <div class="modal-dialog modal-xl"> |
---|
| 327 | <div class="modal-content"> |
---|
| 328 | <div class="modal-header"> |
---|
| 329 | <h5 class="modal-title">Your request</h5> |
---|
| 330 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
---|
| 331 | <span aria-hidden="true">×</span> |
---|
| 332 | </button> |
---|
| 333 | </div> |
---|
| 334 | <div class="modal-body"> |
---|
| 335 | <textarea name="modalText" class="form-control" style="min-height:300px"></textarea> |
---|
| 336 | <pre id="result"></pre> |
---|
| 337 | <div id="progress_details" style="display:none"> |
---|
| 338 | <p id="prgress_description"></p> |
---|
| 339 | <div class="progress"> |
---|
| 340 | <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div> |
---|
| 341 | </div> |
---|
| 342 | </div> |
---|
| 343 | </div> |
---|
| 344 | <div class="modal-footer"> |
---|
| 345 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
---|
| 346 | <button type="button" class="btn btn-primary">Submit Job</button> |
---|
| 347 | </div> |
---|
| 348 | </div> |
---|
| 349 | </div> |
---|
| 350 | </div> |
---|
[967] | 351 | <script src="$openapi["openapi"]["rootUrl"]/../static/openapi.js"></script> |
---|
[962] | 352 | #end if |
---|
| 353 | |
---|
| 354 | #try |
---|
| 355 | #if "links" in $values |
---|
| 356 | #for i in range(len($values["links"])) |
---|
| 357 | #if $i%2==0 |
---|
| 358 | <h2>$values["links"][$i]["title"]</h2> |
---|
| 359 | <p> |
---|
| 360 | <a href="$values["links"][$i]["href"]">$printRel($openapi["links_title"],$values["links"][$i]["rel"])</a> |
---|
| 361 | </p> |
---|
| 362 | #if $i+1<=len($values["links"]) and len($values["links"])>1 and not($values["links"][$i+1]["rel"]=="alternate" and $openapi["openapi"]["full_html_support"]=="true") |
---|
| 363 | <p><a href="$values["links"][$i+1]["href"]">$printRel($openapi["links_title"],$values["links"][$i+1]["rel"])</a></p> |
---|
| 364 | #end if |
---|
| 365 | #end if |
---|
| 366 | #end for |
---|
| 367 | #end if |
---|
| 368 | #except Exception as e |
---|
| 369 | $e |
---|
| 370 | #end try |
---|
| 371 | #if "conformsTo" in $values |
---|
| 372 | <ul> |
---|
| 373 | #for i in range(len($values["conformsTo"])) |
---|
| 374 | <li> |
---|
| 375 | <a href="$values["conformsTo"][$i]">$values["conformsTo"][$i]</a> |
---|
| 376 | </li> |
---|
| 377 | #end for |
---|
| 378 | </ul> |
---|
| 379 | #end if |
---|
| 380 | #if "jobs" in $urlCompnents |
---|
| 381 | #set $removeCacheFile=True |
---|
| 382 | #end if |
---|
| 383 | #if hasattr($values, "__len__") and isinstance($values,list) and len($values)>0 |
---|
| 384 | <table class="table table-striped"> |
---|
| 385 | <thead> |
---|
| 386 | <tr> |
---|
| 387 | #if "jobs" not in $urlCompnents |
---|
| 388 | #* |
---|
| 389 | * Processes list |
---|
| 390 | *# |
---|
| 391 | <th scope="col">#</th> |
---|
| 392 | <th scope="col">Title</th> |
---|
| 393 | <th scope="col">Version</th> |
---|
| 394 | #else |
---|
| 395 | #* |
---|
| 396 | * Jobs list |
---|
| 397 | *# |
---|
| 398 | <th scope="col">#</th> |
---|
| 399 | <th scope="col">Message</th> |
---|
| 400 | <th scope="col">Links</th> |
---|
| 401 | #end if |
---|
| 402 | </tr> |
---|
| 403 | </thead> |
---|
| 404 | <tbody> |
---|
| 405 | #for i in range(len($values)) |
---|
| 406 | <tr> |
---|
| 407 | #if "jobs" not in $urlCompnents |
---|
| 408 | #* |
---|
| 409 | * Processes list |
---|
| 410 | *# |
---|
| 411 | <th scope="row"> |
---|
| 412 | <a href="$(values[$i]["links"][0]["href"][:-1]).html"> |
---|
| 413 | <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-link-45deg" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
---|
| 414 | <path d="M4.715 6.542L3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.001 1.001 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/> |
---|
| 415 | <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 0 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 0 0-4.243-4.243L6.586 4.672z"/> |
---|
| 416 | </svg> |
---|
| 417 | $values[$i]["id"] |
---|
| 418 | </a> |
---|
| 419 | </th> |
---|
| 420 | <td>$values[$i]["title"]</td> |
---|
| 421 | <td>#if "version" in $values[$i]#$values[$i]["version"]#else#1.0.0#end if#</td> |
---|
| 422 | #else |
---|
| 423 | #* |
---|
| 424 | * Jobs list |
---|
| 425 | *# |
---|
| 426 | #set cValue=$values[$i]["infos"] |
---|
| 427 | <th scope="row"> |
---|
| 428 | #if "status" in $cValue and $cValue["status"]=="successful" |
---|
| 429 | <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-check-circle-fill text-success" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
---|
| 430 | <path fill-rule="evenodd" d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/> |
---|
| 431 | </svg> |
---|
| 432 | #else |
---|
| 433 | #if "status" in $cValue and $cValue["status"]=="failed" |
---|
| 434 | <svg width="1.0625em" height="1em" viewBox="0 0 17 16" class="bi bi-exclamation-triangle-fill text-error" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> |
---|
| 435 | <path fill-rule="evenodd" d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 5zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/> |
---|
| 436 | </svg> |
---|
| 437 | #end if |
---|
| 438 | #end if |
---|
| 439 | $cValue["jobID"] |
---|
| 440 | </th> |
---|
| 441 | <td>$cValue["message"]</td> |
---|
| 442 | <td> |
---|
| 443 | <div class="dropdown"> |
---|
| 444 | <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
---|
| 445 | Action |
---|
| 446 | </button> |
---|
| 447 | <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> |
---|
| 448 | #for j in range(len($cValue["links"])) |
---|
| 449 | #set $cValueLink=$cValue["links"][$j] |
---|
| 450 | #if $cValueLink["href"].count("result")==0 |
---|
| 451 | <a class="dropdown-item delete" |
---|
| 452 | href="#" |
---|
| 453 | data-value="$(cValueLink["href"])">Delete</a> |
---|
| 454 | #end if |
---|
| 455 | <a class="dropdown-item" href="$(cValueLink["href"]).html">$cValueLink["title"]</a> |
---|
| 456 | #end for |
---|
| 457 | </div> |
---|
| 458 | </div> |
---|
| 459 | </td> |
---|
| 460 | #end if |
---|
| 461 | </tr> |
---|
| 462 | #end for |
---|
| 463 | </tbody> |
---|
| 464 | </table> |
---|
| 465 | <script> |
---|
| 466 | System["jobListDelete"]=function(){ |
---|
| 467 | \$(".delete").each(function(){ |
---|
| 468 | \$(this).off("click"); |
---|
| 469 | \$(this).click(function(){ |
---|
| 470 | console.log("OK"); |
---|
| 471 | \$.ajax({ |
---|
| 472 | url: \$(this).data("value"), |
---|
| 473 | type: "DELETE", |
---|
| 474 | success: function(){ |
---|
| 475 | console.log(arguments); |
---|
| 476 | } |
---|
| 477 | }); |
---|
| 478 | }); |
---|
| 479 | }); |
---|
| 480 | } |
---|
| 481 | </script> |
---|
| 482 | #end if |
---|
| 483 | |
---|
| 484 | <div class="microlight">$json.dumps(values)</div> |
---|
| 485 | <textarea class="form-control" style="height: 300px;"></textarea> |
---|
| 486 | <script> |
---|
| 487 | window.onload = function(){ |
---|
| 488 | var jsContent=\$(".microlight").html(); |
---|
| 489 | var tmpStr=js_beautify(jsContent); |
---|
| 490 | \$("textarea").last().val(tmpStr); |
---|
| 491 | \$(".microlight").remove(); |
---|
| 492 | for(var i in System){ |
---|
| 493 | System[i](); |
---|
| 494 | } |
---|
[964] | 495 | System["JSON_STR"]=JSON.parse(tmpStr); |
---|
| 496 | var forms = document.getElementsByClassName('needs-validation'); |
---|
| 497 | // Loop over them and prevent submission |
---|
| 498 | var validation = Array.prototype.filter.call(forms, function(form) { |
---|
| 499 | form.addEventListener('submit', function(event) { |
---|
| 500 | event.preventDefault(); |
---|
| 501 | event.stopPropagation(); |
---|
| 502 | if (form.checkValidity() === false) { |
---|
| 503 | event.preventDefault(); |
---|
| 504 | event.stopPropagation(); |
---|
| 505 | for(var i=0;i<System["JSON_STR"]["inputs"].length;i++){ |
---|
| 506 | var cName=System["JSON_STR"]["inputs"][i]["id"].replace(/\./g,"_"); |
---|
| 507 | var selector= |
---|
| 508 | 'input[name="input_value_'+cName+'"]:invalid,'+ |
---|
| 509 | 'select[name="input_value_'+cName+'"]:invalid'; |
---|
| 510 | if(\$(selector).length>0){ |
---|
| 511 | \$(selector).each(function(){ |
---|
[965] | 512 | if(!\$(this).parent().parent().parent().hasClass("show")) |
---|
| 513 | \$(this).parent().parent().parent().parent().find(".btn").first().click(); |
---|
[964] | 514 | }); |
---|
| 515 | } |
---|
| 516 | } |
---|
| 517 | }else{ |
---|
| 518 | loadRequest(); |
---|
| 519 | } |
---|
| 520 | form.classList.add('was-validated'); |
---|
| 521 | }, false); |
---|
| 522 | }); |
---|
[962] | 523 | |
---|
| 524 | } |
---|
| 525 | </script> |
---|
| 526 | <hr> |
---|
| 527 | <address>$openapi["openapi"]["rootUrl"]$(currentUrl).html</address> |
---|
[984] | 528 | <!-- hhmts start -->Last modified: Mon Mar 1 17:01:50 CET 2021 <!-- hhmts end --> |
---|
[962] | 529 | </main> |
---|
| 530 | #if $currentKey=="root" |
---|
| 531 | </div> |
---|
| 532 | <div class="col-sm-4" |
---|
| 533 | itemprop="provider" |
---|
| 534 | itemscope itemtype="https://schema.org/Organization"> |
---|
| 535 | $printIndentification($conf) |
---|
| 536 | </div> |
---|
| 537 | </div> |
---|
| 538 | </div> |
---|
| 539 | #end if |
---|
| 540 | |
---|
| 541 | |
---|
| 542 | <footer class="footer" itemscope itemtype="https://schema.org/SoftwareApplication"> |
---|
| 543 | <div class="container-fluid"> |
---|
| 544 | <span class="text-muted"> |
---|
| 545 | Powered by |
---|
| 546 | <a target="_blank" itemprop="url" |
---|
| 547 | href="http://www.zoo-project.org/"><span itemprop="name">ZOO-Project</span></a> |
---|
| 548 | <span itemprop="version">$zoo.VERSION</span>. |
---|
| 549 | <meta itemprop="applicationCategory" content="WebService" /> |
---|
| 550 | #try |
---|
| 551 | #set sysname=$os.uname() |
---|
| 552 | #except Exception as e |
---|
| 553 | #set sysname=["Unknown"] |
---|
| 554 | #end try |
---|
| 555 | <meta itemprop="operatingSystem" content="$sysname[0]" /> |
---|
| 556 | </span> |
---|
| 557 | </div> |
---|
| 558 | </footer> |
---|
| 559 | |
---|
| 560 | <!-- JS, Popper.js, and jQuery --> |
---|
| 561 | <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> |
---|
| 562 | <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script> |
---|
| 563 | <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> |
---|
| 564 | <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.0/beautify.min.js" integrity="sha512-84xqGKD+OW9ElGeIq5RkXhsKveQx+kAjahn9r7f/Vm9J0bDrwEabW3MQNgYdTzLBnwfrTGs0nuPx3pZxh6itNg==" crossorigin="anonymous"></script> |
---|
| 565 | </body> |
---|
| 566 | </html> |
---|
| 567 | #if "cache_file" in $inputs["tmpl"] and $removeCacheFile |
---|
| 568 | <!-- REMOVED ! --> |
---|
| 569 | #import os |
---|
| 570 | $(os.remove($inputs["tmpl"]["cache_file"])) |
---|
| 571 | #end if |
---|