ソースを参照

管理者登入_NFT管理_會員帳號管理

mike 3 年 前
コミット
2d58593ac7
5 ファイル変更120 行追加33 行削除
  1. 1 1
      assets/js/ark.js
  2. 41 4
      forms-elements.html
  3. 2 3
      pages-login.html
  4. 18 14
      pages-register.html
  5. 58 11
      tables-data.html

+ 1 - 1
assets/js/ark.js

@@ -14,7 +14,7 @@ $("#btn_login").click(function() {
 
     $.ajax({
         type: 'POST',
-        url: 'http://api.ptt.cx:8750/api/v1/login/access-token',
+        url: 'https://api.ptt.cx:8750/api/v1/login/access-token',
         data: param_string,
         success: function(data, textStatus, jqXHR) {
             console.log(data); // test

+ 41 - 4
forms-elements.html

@@ -29,6 +29,11 @@
   <!-- Template Main CSS File -->
   <link href="assets/css/style.css" rel="stylesheet">
 
+   <!-- Ark Cards -->
+   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
+   <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+   <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script> 
+
   <!-- =======================================================
   * Template Name: NiceAdmin - v2.2.0
   * Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
@@ -508,7 +513,7 @@
   <main id="main" class="main">
 
     <div class="pagetitle">
-      <h1>Form Elements</h1>
+      <h1>NFT 管理</h1>
       <nav>
         <ol class="breadcrumb">
           <li class="breadcrumb-item"><a href="index.html">Home</a></li>
@@ -524,10 +529,41 @@
 
           <div class="card">
             <div class="card-body">
-              <h5 class="card-title">General Form Elements</h5>
+              <h5 class="card-title">NFT管理</h5>
 
-              <!-- General Form Elements -->
               <form>
+                <div class="row mb-3">
+                  <label for="inputText" class="col-sm-2 col-form-label">NFT名稱</label>
+                  <div class="col-sm-10">
+                    <input type="text" class="form-control">
+                  </div>
+                </div>
+                <div class="row mb-3">
+                  <label for="inputNumber" class="col-sm-2 col-form-label">NFT圖片</label>
+                  <div class="col-sm-10">
+                    <input class="form-control" type="file" id="formFile">
+                  </div>
+                </div>              
+                <div class="row mb-3">
+                  <legend class="col-form-label col-sm-2 pt-0">顯示</legend>
+                  <div class="col-sm-10">
+                    <div class="form-check">
+                      <input class="form-check-input" type="checkbox" id="gridCheck1" checked>
+                      <label class="form-check-label" for="gridCheck1"></label>
+                    </div>
+                  </div>
+                </div>
+                <div class="row mb-3">
+                  <label class="col-sm-2 col-form-label"></label>
+                  <div class="col-sm-10">
+                    <button type="submit" class="btn btn-primary btn-block">Submit Form</button>
+                  </div>
+                </div>
+
+              </form><!-- End General Form Elements -->
+
+              <!-- General Form Elements -->
+              <!-- <form>
                 <div class="row mb-3">
                   <label for="inputText" class="col-sm-2 col-form-label">Text</label>
                   <div class="col-sm-10">
@@ -665,7 +701,8 @@
                   </div>
                 </div>
 
-              </form><!-- End General Form Elements -->
+              </form> -->
+              <!-- End General Form Elements -->
 
             </div>
           </div>

+ 2 - 3
pages-login.html

@@ -71,16 +71,15 @@
                   <form class="row g-3 needs-validation" novalidate>
 
                     <div class="col-12">
-                      <label for="yourUsername" class="form-label">Username</label>
+                      <label for="yourUsername" class="form-label">帳號</label>
                       <div class="input-group has-validation">
-                        <span class="input-group-text" id="inputGroupPrepend">@</span>
                         <input type="text" name="username" class="form-control" id="username" required>
                         <div class="invalid-feedback">Please enter your username.</div>
                       </div>
                     </div>
 
                     <div class="col-12">
-                      <label for="yourPassword" class="form-label">Password</label>
+                      <label for="yourPassword" class="form-label">密碼</label>
                       <input type="password" name="passwword" class="form-control" id="password" required>
                       <div class="invalid-feedback">Please enter your password!</div>
                     </div>

+ 18 - 14
pages-register.html

@@ -29,6 +29,11 @@
   <!-- Template Main CSS File -->
   <link href="assets/css/style.css" rel="stylesheet">
 
+  <!-- Ark Cards -->
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+  <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
+
   <!-- =======================================================
   * Template Name: NiceAdmin - v2.2.0
   * Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
@@ -64,40 +69,39 @@
                   </div>
 
                   <form class="row g-3 needs-validation" novalidate>
-                    <div class="col-12">
-                      <label for="yourName" class="form-label">Your Name</label>
+                    <!-- <div class="col-12">
+                      <label for="yourName" class="form-label">Name</label>
                       <input type="text" name="name" class="form-control" id="yourName" required>
                       <div class="invalid-feedback">Please, enter your name!</div>
-                    </div>
-
-                    <div class="col-12">
-                      <label for="yourEmail" class="form-label">Your Email</label>
-                      <input type="email" name="email" class="form-control" id="yourEmail" required>
-                      <div class="invalid-feedback">Please enter a valid Email adddress!</div>
-                    </div>
+                    </div> -->
 
                     <div class="col-12">
-                      <label for="yourUsername" class="form-label">Username</label>
+                      <label for="yourUsername" class="form-label">帳號</label>
                       <div class="input-group has-validation">
-                        <span class="input-group-text" id="inputGroupPrepend">@</span>
                         <input type="text" name="username" class="form-control" id="yourUsername" required>
                         <div class="invalid-feedback">Please choose a username.</div>
                       </div>
                     </div>
 
                     <div class="col-12">
-                      <label for="yourPassword" class="form-label">Password</label>
+                      <label for="yourEmail" class="form-label">Email</label>
+                      <input type="email" name="email" class="form-control" id="yourEmail" required>
+                      <div class="invalid-feedback">Please enter a valid Email adddress!</div>
+                    </div>
+
+                    <div class="col-12">
+                      <label for="yourPassword" class="form-label">密碼</label>
                       <input type="password" name="password" class="form-control" id="yourPassword" required>
                       <div class="invalid-feedback">Please enter your password!</div>
                     </div>
 
-                    <div class="col-12">
+                    <!-- <div class="col-12">
                       <div class="form-check">
                         <input class="form-check-input" name="terms" type="checkbox" value="" id="acceptTerms" required>
                         <label class="form-check-label" for="acceptTerms">I agree and accept the <a href="#">terms and conditions</a></label>
                         <div class="invalid-feedback">You must agree before submitting.</div>
                       </div>
-                    </div>
+                    </div> -->
                     <div class="col-12">
                       <button class="btn btn-primary w-100" type="submit">Create Account</button>
                     </div>

+ 58 - 11
tables-data.html

@@ -29,6 +29,11 @@
   <!-- Template Main CSS File -->
   <link href="assets/css/style.css" rel="stylesheet">
 
+  <!-- Ark Cards -->
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+  <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
+
   <!-- =======================================================
   * Template Name: NiceAdmin - v2.2.0
   * Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
@@ -508,7 +513,7 @@
   <main id="main" class="main">
 
     <div class="pagetitle">
-      <h1>Data Tables</h1>
+      <h1>會員帳號管理</h1>
       <nav>
         <ol class="breadcrumb">
           <li class="breadcrumb-item"><a href="index.html">Home</a></li>
@@ -524,22 +529,21 @@
 
           <div class="card">
             <div class="card-body">
-              <h5 class="card-title">Datatables</h5>
-              <p>Add lightweight datatables to your project with using the <a href="https://github.com/fiduswriter/Simple-DataTables" target="_blank">Simple DataTables</a> library. Just add <code>.datatable</code> class name to any table you wish to conver to a datatable</p>
+              <h5 class="card-title">會員帳號</h5>
+              <!-- <p>Add lightweight datatables to your project with using the <a href="https://github.com/fiduswriter/Simple-DataTables" target="_blank">Simple DataTables</a> library. Just add <code>.datatable</code> class name to any table you wish to conver to a datatable</p> -->
 
               <!-- Table with stripped rows -->
-              <table class="table datatable">
+              <table class="table small datatable">
                 <thead>
                   <tr>
                     <th scope="col">#</th>
-                    <th scope="col">Name</th>
-                    <th scope="col">Position</th>
-                    <th scope="col">Age</th>
-                    <th scope="col">Start Date</th>
+                    <th scope="col">userid</th>
+                    <th scope="col">account</th>
+                    <th scope="col">email</th>
                   </tr>
                 </thead>
-                <tbody>
-                  <tr>
+                <tbody class="userdata">
+                  <!-- <tr>
                     <th scope="row">1</th>
                     <td>Brandon Jacob</td>
                     <td>Designer</td>
@@ -573,7 +577,7 @@
                     <td>Dynamic Division Officer</td>
                     <td>47</td>
                     <td>2011-04-19</td>
-                  </tr>
+                  </tr> -->
                 </tbody>
               </table>
               <!-- End Table with stripped rows -->
@@ -616,6 +620,49 @@
   <!-- Template Main JS File -->
   <script src="assets/js/main.js"></script>
 
+<script>
+$(document).ready(function($) {
+  var str = '{ \
+    "hashed_password": "", \
+    "useraddress": "0x7a08c2f5587c1f848f13caa03035216c30034f13", \
+    "is_active": false, \
+    "created_at": "0000-00-00 00:00:00", \
+    "email": "", \
+    "id": 11,\
+    "userid": "U171a225ef8a06a3491f1d94310b7b265", \
+    "account": "", \
+    "is_superuser": false, \
+    "updated_at": "0000-00-00 00:00:00" \
+  }, \
+  { \
+    "hashed_password": "", \
+    "useraddress": "0xd1acf1eb9c956d1e90b650dd56bed57a5df2fcae", \
+    "is_active": false, \
+    "created_at": "0000-00-00 00:00:00", \
+    "email": "", \
+    "id": 12, \
+    "userid": "U1bd102319717680d145d74fe74af38f4", \
+    "account": "", \
+    "is_superuser": false, \
+    "updated_at": "0000-00-00 00:00:00" \
+  }';
+
+  var data = $.parseJSON('[' + str + ']');
+ 
+  var temp = "";
+
+  for (let i=0; i < data.length; i++) {
+    temp += '<tr> \
+      <th scope="row">' + data[i].id + '</th> \
+      <td>' + data[i].userid + '</td> \
+      <td>' + data[i].account + '</td> \
+      <td>' + data[i].email + '</td> \
+    </tr>';
+  }
+
+  $(".userdata").html(temp);
+});
+</script>  
 </body>
 
 </html>