api-detail.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. session_start();
  3. if (!isset($_SESSION['loggedin'])) {
  4. header('Location: pages-signin.html');
  5. exit;
  6. }
  7. ?>
  8. <!doctype html>
  9. <html class="fixed">
  10. <head>
  11. <!-- jstree CSS -->
  12. <link rel="stylesheet" href="assets/vendor/jstree/themes/default/style.css" />
  13. <?php include("bim-support-header.html"); ?>
  14. <script src="./script/js/global.js"></script>
  15. <script type="application/javascript">
  16. var i = 0;
  17. var api;
  18. var fileName;
  19. var folder;
  20. var software;
  21. var userName = '<?php echo $_SESSION['name']; ?>';
  22. var searchURL = window.location.search;
  23. searchURL = searchURL.substring(1, searchURL.length);
  24. object = decodeURIComponent(searchURL.split("&")[0].split("=")[1]);
  25. if(object == 'undefined'){
  26. window.location.href = "./api-list.php";
  27. console.log("in " + object);
  28. }else{
  29. console.log("not in: "+object);
  30. }
  31. $.ajax({
  32. url: "./script/php/api_group_detail.php",
  33. type: "GET",
  34. async: false,
  35. data: {
  36. object: object,
  37. },
  38. contentType: "application/json",
  39. dataType: "json"
  40. }).done(function(data) {
  41. if(data.APIID == null)
  42. data.APIID ='';
  43. folder = data.software + '/' + data.APIID + data.APIName;
  44. data[1] = data[1]=="Dynamo" ? data.software + " " + data.dynamoVersion : data.software + " " + data.revitVersion;
  45. for (i = 0; i < 6; i++) {
  46. if (data[i] != null)
  47. table.push(data[i]);
  48. else
  49. table.push("空");
  50. }
  51. }).error(function(error) {
  52. console.log(error);
  53. });
  54. pageHeader = "BIM程式庫";
  55. </script>
  56. </head>
  57. <body>
  58. <canvas id="c"></canvas>
  59. <section class="body">
  60. <!-- start: header -->
  61. <header-menu></header-menu>
  62. <!-- end: header -->
  63. <div class="inner-wrapper">
  64. <!-- start: sidebar -->
  65. <side-bar></side-bar>
  66. <!-- end: sidebar -->
  67. <section role="main" class="content-body">
  68. <header class="page-header">
  69. <h2>{{pageHeader}}</h2>
  70. </header>
  71. <!-- start: page -->
  72. <section class="content-with-menu content-with-menu-has-toolbar media-gallery">
  73. <div class="content-with-menu-container">
  74. <inner-menu>
  75. <template v-slot:inner-equipment>
  76. <api-list></api-list>
  77. </template>
  78. </inner-menu>
  79. <div class="inner-body mg-main">
  80. <div class="inner-toolbar">
  81. <ul>
  82. <li class="right">
  83. <a href="#" onclick="window.history.go(-1); return false;"><i class="fa fa-undo"></i> 返回</a>
  84. </li>
  85. </ul>
  86. </div>
  87. <div class="row">
  88. <div class="col-md-12">
  89. <section class="panel">
  90. <div class="panel-body">
  91. <div class="table-responsive">
  92. <table class="table table-bordered mb-none">
  93. <thead>
  94. <tr>
  95. <th width="10%">名稱</th>
  96. <th>開發版本</th>
  97. <th>詳細說明</th>
  98. <th>操作方式</th>
  99. <th width="5%">開發者</th>
  100. <th>備註</th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <tr>
  105. <td v-for="data in table">{{data}}</td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. </div>
  110. </div>
  111. </section>
  112. </div>
  113. </div>
  114. <div class="row">
  115. <div class="col-md-6">
  116. <section class="panel">
  117. <div class="panel-body">
  118. <h5 class="text-semibold text-dark text-uppercase">檔案一覽</h5>
  119. <div id="treeAjaxHTML"></div>
  120. </div>
  121. </section>
  122. </div>
  123. <div class="col-md-6">
  124. <section class="panel">
  125. <div class="panel-body">
  126. <img v-if="table[1].includes('ynamo')" src="./assets/images/dynamo-icon.png" style="height:80px; display: inline-block;"></img>
  127. <img v-else src="./assets/images/revit-icon.png" style="height:80px; display: inline-block;"></img>
  128. <div class="summary" style="display: inline-block;">
  129. <div class="title"><strong>API下載</strong></div>
  130. <div class="info">
  131. <a download href="" id="api"></a>
  132. </div>
  133. </div>
  134. </div>
  135. </section>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </section>
  141. <!-- end: page -->
  142. </section>
  143. </div>
  144. </section>
  145. <script>
  146. /*Vue */
  147. vm.mount('.body');
  148. </script>
  149. <script src="assets/vendor/jstree/jstree.js"></script>
  150. <script src="assets/javascripts/ui-elements/examples.treeview.js"></script>
  151. <?php include("bim-support-body.html"); ?>
  152. <script>
  153. </script>
  154. </body>
  155. </html>