Fossil

Diff
Login

Differences From Artifact [0ee4593c0a]:

To Artifact [ed27388a39]:


503
504
505
506
507
508
509

510
511
512
513
514
515
516
*/
void urllist_page(void){
  Stmt q;
  int cnt;
  int showAll = P("all")!=0;
  int nOmitted;
  sqlite3_int64 iNow;


  login_check_credentials();
  if( !g.perm.Admin ){ login_needed(0); return; }

  style_set_current_feature("stat");
  style_header("URLs and Checkouts");
  style_adunit_config(ADUNIT_RIGHT_OK);







>







503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
*/
void urllist_page(void){
  Stmt q;
  int cnt;
  int showAll = P("all")!=0;
  int nOmitted;
  sqlite3_int64 iNow;
  char *zPriorRepo = 0;

  login_check_credentials();
  if( !g.perm.Admin ){ login_needed(0); return; }

  style_set_current_feature("stat");
  style_header("URLs and Checkouts");
  style_adunit_config(ADUNIT_RIGHT_OK);
588
589
590
591
592
593
594










































595
596
597
598
599
600
601
    cnt++;
    url_unparse(&x);
  }
  db_finalize(&q);
  if( cnt ){
    @ </table>
  }










































  style_finish_page();
}

/*
** WEBPAGE: repo_schema
**
** Show the repository schema







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
    cnt++;
    url_unparse(&x);
  }
  db_finalize(&q);
  if( cnt ){
    @ </table>
  }

  cnt = 0;
  db_prepare(&q,
    "SELECT"
    " substr(name,6),"
    " datetime(mtime,'unixepoch'),"
    " json_extract(value,'$.type'),"
    " json_extract(value,'$.src')\n"
    "FROM config\n"
    "WHERE name GLOB 'link:*'\n"
    "AND json_valid(value)\n"
    "ORDER BY 4, 2 DESC"
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char *zUrl = db_column_text(&q, 0);
    const char *zType = db_column_text(&q, 2);
    const char *zSrc = db_column_text(&q, 3);
    if( zUrl==0 || zSrc==0 ) continue;
    if( cnt++==0 ){
      @ <div class="section">Links from other repositories</div>
      @ <table border='0' width='100%%'>
    }
    if( zPriorRepo==0 || strcmp(zUrl,zSrc)!=0 ){
      fossil_free(zPriorRepo);
      zPriorRepo = fossil_strdup(zSrc);
      @ <tr><td colspan="4">\
      @ From <a href='%T(zSrc)'>%h(zSrc)</a>...</td></tr>
    }
    @ <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    @ <td width='90%%'><a href='%h(zUrl)'>%h(zUrl)</a></td>
    if( zType ){
      @ <td>&nbsp;(%h(zType))&nbsp;</td>
    }else{
      @ <td>&nbsp;</td>
    }
    @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr>
  }
  db_finalize(&q);
  fossil_free(zPriorRepo);
  if( cnt ){
    @ </table>
  }
  style_finish_page();
}

/*
** WEBPAGE: repo_schema
**
** Show the repository schema