apilist.html.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <style>
  2. .base-url > p {margin: 0;}
  3. .table-empty-tip > div {display: inline-block;}
  4. .detail .list-group-item .heading.GET {
  5. background-color: #e7f0f7;
  6. }
  7. .detail .list-group-item .heading.GET a {
  8. color: #0f6ab4;
  9. }
  10. .detail .list-group {
  11. height: calc(100vh - 215px);
  12. overflow-y: auto;
  13. }
  14. .detail .list-group-item .heading.OPTIONS {
  15. background-color: #e7f0f7;
  16. }
  17. .detail .list-group-item .heading.OPTIONS a {
  18. color: #0f6ab4;
  19. }
  20. .detail .list-group-item .heading.POST {
  21. background-color: #e7f6ec;
  22. }
  23. .detail .list-group-item .heading.POST a {
  24. color: #10a54a;
  25. }
  26. .detail .list-group-item .heading.PUT {
  27. background-color: #f9f2e9;
  28. }
  29. .detail .list-group-item .heading.PUT a {
  30. color: #c5862b;
  31. }
  32. .detail .list-group-item .heading.PATCH {
  33. background-color: #f9f2e9;
  34. }
  35. .detail .list-group-item .heading.PATCH a {
  36. color: #c5862b;
  37. }
  38. .detail .list-group-item .heading.DELETE {
  39. background-color: #f5e8e8;
  40. border: 1px solid #e8c6c7;
  41. }
  42. .detail .list-group-item .heading.DELETE a {
  43. color: #a41e22;
  44. }
  45. .detail .list-group-item a {
  46. display: flex;
  47. align-items: center;
  48. }
  49. .detail .list-group-item .path, .detail .list-group-item .desc {
  50. overflow: hidden;
  51. text-overflow: ellipsis;
  52. white-space: nowrap;
  53. }
  54. .detail .list-group-item .path {
  55. padding-left: 10px;
  56. font-size: 14px;
  57. color: black;
  58. flex: 1;
  59. }
  60. .detail .list-group-item .desc {
  61. width: auto;
  62. font-size: 14px;
  63. line-height: 38px;
  64. float: right;
  65. padding-right: 10px;
  66. max-width: 200px;
  67. }
  68. .detail .list-group-item {list-style: none; font-size: 14px; margin-bottom: 10px; line-height: 30px}
  69. .detail .list-group-item span {line-height: 30px; width: 65px;}
  70. .detail .list-group-item .label+.label {margin-left: -4px;}
  71. .detail .list-group-item .label {border-radius: 0;}
  72. </style>
  73. <?php if($apiID):?>
  74. <?php include './content.html.php';?>
  75. <?php else:?>
  76. <?php if(empty($libs) || empty($apiList)):?>
  77. <div class="cell apiList">
  78. <div class="detail">
  79. <li class="detail-title"><?php echo intval($libID) > 0 ? $lang->api->apiList : $lang->api->pageTitle;?></li>
  80. </div>
  81. <div class="table-empty-tip">
  82. <div class="notice text-muted"><?php echo (empty($libs)) ? $lang->api->noLib : $lang->api->noApi;?></div>
  83. <div class="no-content-button">
  84. <?php
  85. if($libID && common::hasPriv('api', 'create'))
  86. {
  87. if($app->rawModule == 'doc')
  88. {
  89. echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID", '', true), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info iframe" data-width="95%"');
  90. }
  91. else
  92. {
  93. echo html::a(helper::createLink('api', 'create', "libID={$libID}&moduleID=$moduleID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info"');
  94. }
  95. }
  96. ?>
  97. </div>
  98. </div>
  99. </div>
  100. <?php else:?>
  101. <div class="cell main-col" data-min-width="400">
  102. <div class="detail base-url">
  103. <?php $delimiter = strpos($app->clientLang, 'zh') === 0 ? ':' : ': ';?>
  104. <p><?php echo $lang->api->baseUrl . $delimiter . $lib->baseUrl;?></p>
  105. </div>
  106. <div class="detail">
  107. <ul class="list-group">
  108. <?php foreach($apiList as $api):?>
  109. <li class="list-group-item">
  110. <div class="heading <?php echo $api->method;?>">
  111. <a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0");?>" data-app="<?php echo $app->tab;?>">
  112. <span class="label label-primary"><?php echo $api->method;?></span>
  113. <span class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></span>
  114. <span class="desc" title="<?php echo $api->title;?>"><?php echo $api->title;?></span>
  115. </a>
  116. </div>
  117. </li>
  118. <?php endforeach;?>
  119. </ul>
  120. </div>
  121. </div>
  122. <?php endif;?>
  123. <?php endif;?>