Browse Source

kdb integration

koellenberger 2 năm trước cách đây
mục cha
commit
2160d37596
4 tập tin đã thay đổi với 23 bổ sung14 xóa
  1. 17 4
      public/checklist.php
  2. 1 9
      public/navbar.html
  3. 4 0
      public/style.css
  4. 1 1
      public/submit.php

+ 17 - 4
public/checklist.php

@@ -30,7 +30,20 @@
       <body onload="document.getElementById('result').innerHTML = 'Welcome ' + localStorage.getItem('author') + '<br><br>The last check has been performed based on:<br>' + localStorage.getItem('lastChecked')">
         <h3 id="result"></h3>
       </body>
-      <h3>Please check the following parameters and values. <br>If any runs are effected, note down the run numbers in the comments and contact the corresponding system expert. </h3>
+
+      <?php
+        $datetime = new DateTime($dateTimeString);
+        $Year  = $datetime->format('Y');
+        $Day   = $datetime->format('d')-1;
+        $Month = $datetime->format('m');
+
+        $url = "http://katrin:tritium.Meitner$2021@kdb.kaas.kit.edu/kdb-api.fcgi/json?run&system=fpd&from=".$Year."-".$Month."-".$Day;
+        //call api
+        $jsonData = file_get_contents($url);
+        $json = array_values(json_decode($jsonData, true));
+        print("<h3>Last run that has be processed on <a href='https://kdb.kaas.kit.edu' target='_blank'>kdb</a>: run# ".end($json[1]['Run'])['Number']."</h3>");
+      ?>
+      <p>Please check the following parameters and values. <br>If any runs are effected, note down the run numbers in the comments and contact the corresponding system expert. </p>
       <br>
 
       <hr>
@@ -41,12 +54,12 @@
 
         <tr>
           <td style="text-align:center"><b>First run</b></td>
-          <td style="text-align:center"><input type="text" placeholder ="Run number" id="First_run"></td>
+          <td style="text-align:center"><input type="text" min="1" oninput="this.value=this.value.replace(/[^0-9]/g,'');" placeholder ="Run number" id="First_run"></td>
         </tr>
 
         <tr>
           <td style="text-align:center"><b>Last run</b></td>
-          <td style="text-align:center"><input type="text" placeholder ="Run number" id="Last_run"></td>
+          <td style="text-align:center"><input type="text" min="1" oninput="this.value=this.value.replace(/[^0-9]/g,'');" placeholder ="Run number" id="Last_run"></td>
         </tr>
 
       </table>
@@ -235,7 +248,7 @@
       <hr>
       <br>
       <button type="submit" onclick="goBack()" id="Back">Go back</button>
-      <button type="submit" onclick="submit()" id="Submit">Confirm</button>
+      <button type="submit" onclick="submit()" id="Submit">Confirm & submit</button>
       <br><br><br><br>
 
       <script type="text/javascript">

+ 1 - 9
public/navbar.html

@@ -25,17 +25,9 @@
           <a href="http://katana.npl.washington.edu/~sanshiro/brew/KNM6/" target="_blank">KNM6</a>
         </div>
       </div>
+      <a href="https://kdb.kaas.kit.edu" target="_blank">kdb</a>
       <a href="https://webtrium.mpp.mpg.de" target="_blank">webtrium</a>
       <a href="https://status-sds.kaas.kit.edu" target="_blank">status-sds</a>
       <a href="javascript:void(0);" class="icon" onclick="myFunction()">&#9776;</a>
     </div>
-    <!-- <div class="navbar">
-      <a style="background-color:#1761B2;text-decoration:none"><b>Quick links:</b></a>
-      <a href="http://adei-katrin.kaas.kit.edu" target="_blank">adei</a>
-      <a href="http://katana.npl.washington.edu" target="_blank">katana</a>
-      <a href="http://katana.npl.washington.edu/~sanshiro/brew/KNM6/" target="_blank">brew</a>
-      <a href="http://kdb.kaas.kit.edu/kdb-admin.fcgi/runlist/" target="_blank">kdb</a>
-      <a href="https://webtrium.mpp.mpg.de" target="_blank">webtrium</a>
-      <a href="https://status-sds.kaas.kit.edu" target="_blank">status-sds</a>
-    </div> -->
   </body>

+ 4 - 0
public/style.css

@@ -6,6 +6,10 @@ body {
   padding-right: 50px
 }
 
+#First_run, #Last_run {
+  width: 7em;
+}
+
 /* Add a black background color to the top navigation */
 .topnav {
   background-color: #1761B2;

+ 1 - 1
public/submit.php

@@ -75,7 +75,7 @@
       <hr>
       <br>
       <!-- <button type="submit" onclick="cancel()" id="Cancel">Cancel</button> -->
-      <button type="submit" onclick="submit()" id="Submit">Submit report</button>
+      <button type="submit" onclick="submit()" id="Submit">Go to start</button>
       <br><br><br><br>
 
       <script type="text/javascript">