Quellcode durchsuchen

上傳檔案到 'static'

miacheng913 vor 3 Jahren
Ursprung
Commit
20866e583c
3 geänderte Dateien mit 208 neuen und 0 gelöschten Zeilen
  1. 35 0
      static/delete_member_test.html
  2. 52 0
      static/delete_member_test2.html
  3. 121 0
      static/member_authority_test.html

+ 35 - 0
static/delete_member_test.html

@@ -0,0 +1,35 @@
+
+
+<html>
+<head>
+    <script>
+        var today = new Date();
+        var expiry = new Date(today.getTime() + 30 * 24 * 3600 * 1000); // plus 30 days
+
+        function setCookie(name, value)
+        {
+            document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString();
+        }
+function putCookie(form)
+                //this should set the UserName cookie to the proper value;
+  {
+   setCookie("userName", form[0].usrname.value);
+
+    return true;
+  }
+
+  </script>
+</head>
+<body>
+
+  <form method="post" action="/example" class="delete_member_form">
+    <h2>delete_member</h2>
+    <div>
+      <label>帳號</label>
+      <input type="text" id="del_username" name="del_username" placeholder="請輸入帳號">
+      <input type="button" value="Go!" id="submit" onclick="putCookie(document.getElementsByTagName('form'));">
+</form>
+</body>
+
+
+</html>

+ 52 - 0
static/delete_member_test2.html

@@ -0,0 +1,52 @@
+{% extends "index.html" %}
+{% block title %}登入{% endblock %}
+{% block head %}
+{{ super() }}
+{% endblock %}
+
+
+{% block body %}
+<script >
+  function parseCookie() {
+    var cookieObj = {};
+    var cookieAry = document.cookie.split(';');
+    var cookie;
+    
+    for (var i=0, l=cookieAry.length; i<l; ++i) {
+        cookie = jQuery.trim(cookieAry[i]);
+        cookie = cookie.split('=');
+        cookieObj[cookie[0]] = cookie[1];
+    }
+    
+    return cookieObj;
+}
+
+
+function getCookieByName(name) {
+    var value = parseCookie()[name];
+    if (value) {
+        value = decodeURIComponent(value);
+    }
+
+    return value;
+}
+  
+  
+</script>
+
+  
+  <form method="post" action="member_delete">
+    <h2>delete_member</h2>
+    <input type="text" id="access_token" name="access_token" >
+    <div>
+      <label>帳號</label>
+      <input type="text" id="del_name" name="del_name" placeholder="請輸入帳號">
+    <button id="btn_delete" type="submit">輸入</button>
+  </form>
+  <script>
+    var cookie_token = getCookieByName('jwt_token');
+      $('#access_token').val(cookie_token);
+      alert(document.getElementById=('access_token').value);
+      </script>
+  
+{% endblock %}

+ 121 - 0
static/member_authority_test.html

@@ -0,0 +1,121 @@
+<html lang='zh-TW'>
+<head>
+    <meta charset="UTF-8">
+    <title>Item Details</title>
+</head>
+<body>
+    <form method="post" action="/member_authority">
+    <table>
+        <tr>
+            <td>使用者身分</td>
+            <td>功能機組</td>
+            <td>檢視</td>
+            <td>新增</td>
+            <td>編輯</td>
+            <td>刪除</td>
+            <td>備註</td>
+        </tr>
+        <tr>
+            <td>{{ 智能預測.role_id }}</td>
+            <td>智能預測</td>
+            <td><input type="text" id="ai_prediction_isView" name='ai_prediction_isView' value = {{ 智能預測.isView }}> </input></td>
+            <td><input type="text" id="ai_prediction_isAdd" name='ai_prediction_isAdd' value = {{ 智能預測.isAdd }}> </input></td>
+            <td><input type="text" id="ai_prediction_isEdit" name='ai_prediction_isEdit' value = {{ 智能預測.isEdit }}> </input></td>
+            <td><input type="text" id="ai_prediction_isDel" name='ai_prediction_isDel' value = {{ 智能預測.isDel }}> </input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 通道.role_id }}</td>
+            <td>通道</td>
+            <td><input type="text" id="channel_isView" name='channel_isView' value = {{ 通道.isView }}></input></td>
+            <td><input type="text" id="channel_isAdd" name='channel_isAdd' value = {{ 通道.isAdd  }}></input></td>
+            <td><input type="text" id="channel_isEdit" name='channel_isEdit' value = {{ 通道.isEdit }}></input></td>
+            <td><input type="text" id="channel_isDel" name='channel_isDel' value = {{ 通道.isDel }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 設備.role_id }}</td>
+            <td>設備</td>
+            <td><input type="number" id="device_isView" name='device_isView' value = {{ 設備.isView }}></input></td>
+            <td><input type="text" id="device_isAdd" name='device_isAdd' value = {{ 設備.isAdd }}></input></td>
+            <td><input type="text" id="device_isEdit" name='device_isEdit' value = {{ 設備.isEdit }}></input></td>
+            <td><input type="text" id="device_isDel" name='device_isDel' value = {{ 設備.isDel }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 事件.role_id }}</td>
+            <td>事件</td>
+            <td><input type="text" id="event_isView" name='event_isView' value = {{ 事件.isView  }}></input></td>
+            <td><input type="text" id="event_isAdd" name='event_isAdd' value = {{ 事件.isAdd }}></input></td>
+            <td><input type="text" id="event_isEdit" name='event_isEdit' value = {{ 事件.isEdit }}></input></td>
+            <td><input type="text" id="event_isDel" name='event_isDel' value = {{ 事件.isDel }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 首頁.role_id }}</td>
+            <td>首頁</td>
+            <td><input type="text" id="index_isView" name='index_isView' value = {{  首頁.isView  }}></input></td>
+            <td><input type="text" id="index_isAdd" name='index_isAdd' value = {{ 首頁.isAdd  }}></input></td>
+            <td><input type="text" id="index_isEdit" name='index_isEdit' value = {{ 首頁.isEdit }}></input></td>
+            <td><input type="text" id="index_isDel" name='index_isDel' value = {{ 首頁.isDel  }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 效能.role_id }}</td>
+            <td>效能</td>
+            <td><input type="text" id="performance_isView" name='performance_isView' value = {{ 效能.isView  }}></input></td>
+            <td><input type="text" id="performance_isAdd" name='performance_isAdd' value = {{  效能.isAdd }}></input></td>
+            <td><input type="text" id="performance_isEdit" name='performance_isEdit' value = {{ 效能.isEdit  }}></input></td>
+            <td><input type="text" id="performance_isDel" name='performance_isDel' value = {{ 效能.isDel  }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 設備設定.role_id }}</td>
+            <td>設備設定</td>
+            <td><input type="text" id="setting_device_isView" name='setting_device_isView' value = {{ 設備設定.isView }}></input></td>
+            <td><input type="text" id="setting_device_isAdd" name='setting_device_isAdd' value = {{ 設備設定.isAdd  }}></input></td>
+            <td><input type="text" id="setting_device_isEdit" name='setting_device_isEdit' value = {{ 設備設定.isEdit  }}></input></td>
+            <td><input type="text" id="setting_device_isDel" name='setting_device_isDel' value = {{ 設備設定.isDel  }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 紀錄.role_id }}</td>
+            <td>紀錄</td>
+            <td><input type="text" id="record_isView" name='record_isView' value = {{ 紀錄.isView  }}></input></td>
+            <td><input type="text" id="record_isAdd" name='record_isAdd' value = {{ 紀錄.isAdd  }}></input></td>
+            <td><input type="text" id="record_isEdit" name='record_isEdit' value = {{ 紀錄.isEdit   }}></input></td>
+            <td><input type="text" id="record_isDel" name='record_isDel' value = {{ 紀錄.isDel  }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 系統設定.role_id }}</td>
+            <td>系統設定</td>
+            <td><input type="text" id="setting_system_isView" name='setting_system_isView' value = {{ 系統設定.isView   }}></input></td>
+            <td><input type="text" id="setting_system_isAdd" name='setting_system_isAdd' value = {{ 系統設定.isAdd   }}></input></td>
+            <td><input type="text" id="setting_system_isEdit" name='setting_system_isEdit' value = {{ 系統設定.isEdit  }}></input></td>
+            <td><input type="text" id="setting_system_isDel" name='setting_system_isDel' value = {{ 系統設定.isDel  }}></input></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td>{{ 水塔.role_id }}</td>
+            <td>水塔</td>
+            <td><input type="text" id="tower_isView" name='tower_isView' value = {{ 水塔.isView }}></input></td>
+            <td><input type="text" id="tower_isAdd" name='tower_isAdd' value = {{ 水塔.isAdd  }}></input></td>
+            <td><input type="text" id="tower_isEdit " name='tower_isEdit' value = {{ 水塔.isEdit   }}></input></td>
+            <td><input type="text" id="tower_isDel" name='tower_isDel' value = {{ 水塔.isDel }}></input></td>
+            <td></td>
+        </tr>
+    </table>
+    <input type="text" id="id" name="id" value = {{ 水塔.user_id }} hidden></input>
+    <input type="text" id="role_id" name="role_id" value = {{ 水塔.role_id }} hidden></input>
+    <input type="text" id="access_token" name="access_token" hidden></input>
+    <script>
+    var cookie_token = getCookieByName('jwt_token');
+      $('#access_token').val(cookie_token);
+      alert(document.getElementById=('access_token').value);
+      </script>
+      <button type="submit"  id="btn">確認</button>
+</form>
+    
+</body>
+</html>