Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
539610643c
  1. 1
      iguana/SuperNET.h
  2. 6
      iguana/field.html
  3. 12
      iguana/formfooter.html
  4. 18
      iguana/formheader.html
  5. 5024
      iguana/forms.html
  6. 5
      iguana/iguana_json.c
  7. 6
      iguana/iguana_rpc.c
  8. 5393
      iguana/index7778.html

1
iguana/SuperNET.h

@ -135,6 +135,7 @@ int32_t SuperNET_hexmsgfind(struct supernet_info *myinfo,bits256 category,bits25
void category_posthexmsg(struct supernet_info *myinfo,bits256 category,bits256 subhash,char *hexmsg,struct tai now); void category_posthexmsg(struct supernet_info *myinfo,bits256 category,bits256 subhash,char *hexmsg,struct tai now);
void *category_sub(struct supernet_info *myinfo,bits256 category,bits256 subhash); void *category_sub(struct supernet_info *myinfo,bits256 category,bits256 subhash);
struct category_msg *category_gethexmsg(struct supernet_info *myinfo,bits256 categoryhash,bits256 subhash); struct category_msg *category_gethexmsg(struct supernet_info *myinfo,bits256 categoryhash,bits256 subhash);
char *SuperNET_htmlstr(char *fname,char *htmlstr,int32_t maxsize,char *agentstr);
char *SuperNET_categorymulticast(struct supernet_info *myinfo,int32_t surveyflag,bits256 categoryhash,bits256 subcategory,char *message,int32_t maxdelay,int32_t broadcastflag,int32_t plaintext); char *SuperNET_categorymulticast(struct supernet_info *myinfo,int32_t surveyflag,bits256 categoryhash,bits256 subcategory,char *message,int32_t maxdelay,int32_t broadcastflag,int32_t plaintext);

6
iguana/field.html

@ -1,4 +1,4 @@
<div class=\"form-group\"> <div class="form-group">
<label for=\"%s\">%s</label> <label for="%s">%s</label>
<textarea class=\"form-control\" name=\"%s\" rows=\"1\" cols=\"%s\" %s></textarea> <textarea class="form-control" name="%s" rows="1" cols="%s" %s></textarea>
</div> </div>

12
iguana/formfooter.html

@ -1,17 +1,17 @@
</div> </div>
<div class=\"col-md-6\"> <div class="col-md-6">
<div class=\"form-group\"> <div class="form-group">
<label for=\"broadcast\">Response</label> <label for="broadcast">Response</label>
<figure class=\"highlight\" for=\"%s\" disabled=\"\"> <figure class="highlight" for="%s" disabled="">
<pre> <pre>
<code id=\"%s\" class=\"language-html\" data-lang=\"javascript\"></code> <code id="%s" class="language-html" data-lang="javascript"></code>
</pre> </pre>
</figure> </figure>
</div> </div>
</div> </div>
</div> </div>
<input type=\"submit\" value=\"%s\" class=\"btn btn-default\"> <input type="submit" value="%s" class="btn btn-default">
</form> </form>
</div> </div>

18
iguana/formheader.html

@ -1,16 +1,16 @@
<div class=\"panel panel-default\"> <div class="panel panel-default">
<div class=\"panel-heading\" role=\"tab\" id=\"heading-%s\"> <div class="panel-heading" role="tab" id="heading-%s">
<h4 class=\"panel-title\"> <h4 class="panel-title">
<a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapse-%s\" aria-expanded=\"false\" aria-controls=\"collapse-%s\"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse-%s" aria-expanded="false" aria-controls="collapse-%s">
%s %s %s %s
</a> </a>
</h4> </h4>
</div> </div>
<div id=\"collapse-%s\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading-%s\"> <div id="collapse-%s" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-%s">
<div class=\"panel-body\"> <div class="panel-body">
<form action=\"http://127.0.0.1:7778/api/%s/%s\" oninput=\"%s\"> <form action="http://127.0.0.1:7778/api/%s/%s" oninput="%s">
<div class=\"row\"> <div class="row">
<div class=\"col-md-6\"> <div class="col-md-6">

5024
iguana/forms.html

File diff suppressed because it is too large

5
iguana/iguana_json.c

@ -250,11 +250,12 @@ int32_t pretty_form(FILE *fp,char *formheader,char *formfooter,char *fieldtempla
{ {
cJSON *item,*fieldsarray; int32_t j,m,formsize,fieldsize,iter,width,size = 0; cJSON *item,*fieldsarray; int32_t j,m,formsize,fieldsize,iter,width,size = 0;
char *methodstr,*typestr,*fieldname; char *methodstr,*typestr,*fieldname;
char outstr[2048],outstr2[2048],str[2],widthstr[16]; char outstr[2048],outstr2[2048],str[2],widthstr[16],both[512];
if ( (methodstr= jstr(methoditem,"method")) == 0 ) if ( (methodstr= jstr(methoditem,"method")) == 0 )
methodstr = "method"; methodstr = "method";
if ( agent == 0 ) if ( agent == 0 )
agent = "agent"; agent = "agent";
sprintf(both,"%s-%s",agent,methodstr);
outstr[0] = outstr2[0] = str[1] = 0; outstr[0] = outstr2[0] = str[1] = 0;
formsize = fieldsize = 0; formsize = fieldsize = 0;
if ( (fieldsarray= jarray(&m,methoditem,"fields")) != 0 ) if ( (fieldsarray= jarray(&m,methoditem,"fields")) != 0 )
@ -262,7 +263,7 @@ int32_t pretty_form(FILE *fp,char *formheader,char *formfooter,char *fieldtempla
for (iter=0; iter<2; iter++) for (iter=0; iter<2; iter++)
{ {
if ( iter == 1 ) if ( iter == 1 )
fprintf(fp,formheader,methodstr,methodstr,methodstr,agent,methodstr,methodstr,methodstr,agent,methodstr,outstr); fprintf(fp,formheader,both,both,both,agent,methodstr,both,both,agent,methodstr,outstr);
for (j=0; j<m; j++) for (j=0; j<m; j++)
{ {
item = jitem(fieldsarray,j); item = jitem(fieldsarray,j);

6
iguana/iguana_rpc.c

@ -718,9 +718,13 @@ char *SuperNET_rpcparse(struct supernet_info *myinfo,char *retbuf,int32_t bufsiz
url[i++] = 0; url[i++] = 0;
n += i; n += i;
j = i = 0; j = i = 0;
printf("url.(%s) method.(%s)\n",&url[i],urlmethod);
if ( strcmp(&url[i],"/") == 0 && strcmp(urlmethod,"GET") == 0 ) if ( strcmp(&url[i],"/") == 0 && strcmp(urlmethod,"GET") == 0 )
{
SuperNET_htmlstr("index7778.html",retbuf,bufsize,0);
//return(retbuf);
return(OS_filestr(&filesize,"index7778.html")); return(OS_filestr(&filesize,"index7778.html"));
//printf("url.(%s) method.(%s)\n",&url[i],urlmethod); }
if ( strncmp(&url[i],"/api",strlen("/api")) == 0 ) if ( strncmp(&url[i],"/api",strlen("/api")) == 0 )
{ {
*jsonflagp = 1; *jsonflagp = 1;

5393
iguana/index7778.html

File diff suppressed because it is too large
Loading…
Cancel
Save