소스 검색

history.html

aaron-1015 3 년 전
부모
커밋
e5267d3630
5개의 변경된 파일149개의 추가작업 그리고 47개의 파일을 삭제
  1. BIN
      __pycache__/main.cpython-39.pyc
  2. 44 6
      main.py
  3. 50 39
      static/index.css
  4. 32 1
      templates/history.html
  5. 23 1
      templates/tower.html

BIN
__pycache__/main.cpython-39.pyc


+ 44 - 6
main.py

@@ -125,27 +125,65 @@ async def home(request: Request):
     return templates.TemplateResponse(name='home.html', context={'request': request})
 
 @app.get('/tower', response_class=HTMLResponse)
-async def tower(request: Request):
+async def tower(request: Request, Authorize: AuthJWT = Depends()):
+    try:
+        Authorize.jwt_required()
+    except Exception as e:
+        print(e)
+        return RedirectResponse('/login')
+    # current_user = Authorize.get_jwt_subject()
     return templates.TemplateResponse(name='tower.html', context={'request': request})
+    
+
 
 @app.get('/optim', response_class=HTMLResponse)
-async def optim(request: Request):
+async def optim(request: Request, Authorize: AuthJWT = Depends()):
+    try:
+        Authorize.jwt_required()
+    except Exception as e:
+        print(e)
+        return RedirectResponse('/login')
+    # current_user = Authorize.get_jwt_subject()
     return templates.TemplateResponse(name='optim.html', context={'request': request})
 
 @app.get('/vibration', response_class=HTMLResponse)
-async def vibration(request: Request):
+async def vibration(request: Request, Authorize: AuthJWT = Depends()):
+    try:
+        Authorize.jwt_required()
+    except Exception as e:
+        print(e)
+        return RedirectResponse('/login')
+    # current_user = Authorize.get_jwt_subject()
     return templates.TemplateResponse(name='vibration.html', context={'request': request})
 
 @app.get('/history', response_class=HTMLResponse)
-async def history(request: Request):
+async def history(request: Request, Authorize: AuthJWT = Depends()):
+    try:
+        Authorize.jwt_required()
+    except Exception as e:
+        print(e)
+        return RedirectResponse('/login')
+    # current_user = Authorize.get_jwt_subject()
     return templates.TemplateResponse(name='history.html', context={'request': request})
 
 @app.get('/device', response_class=HTMLResponse)
-async def device(request: Request):
+async def device(request: Request, Authorize: AuthJWT = Depends()):
+    try:
+        Authorize.jwt_required()
+    except Exception as e:
+        print(e)
+        return RedirectResponse('/login')
+    # current_user = Authorize.get_jwt_subject()
     return templates.TemplateResponse(name='device.html', context={'request': request})
 
 @app.get('/system', response_class=HTMLResponse)
-async def system(request: Request):
+async def system(request: Request, Authorize: AuthJWT = Depends()):
+    try:
+        Authorize.jwt_required()
+    except Exception as e:
+        print(e)
+        return RedirectResponse('/login')
+    # current_user = Authorize.get_jwt_subject()
     return templates.TemplateResponse(name='system.html', context={'request': request})
 
 

+ 50 - 39
static/index.css

@@ -3,42 +3,53 @@
         margin:0 auto;
         font-size:13px;
     /*     border-style:solid; */
-    }
-    
-    
-    #top-side-bar{
-        /* background-color; */
-    /*     width:600px; */
-        height:120px;
-        text-align:center;
-        line-height:100px;
-        float:center;
-        border-style:solid;
-    }
-    
-    #logo{
-        float:left;
-    /*     border-style:solid; */
-    
-    }
-    #member{
-        float:right;
-    /*     border-style:solid; */
-        border: 5px;    
-    }
-    
-    #nav-side-bar{
-        /* background-color; */
-        /* width:120px; */
-    /*     height:120px; */
-    /*     text-align:center; */
-        line-height:60px;
-        float:left;
-        border-style:solid;
-    }
-    
-    
-    #content{
-        float:center;
-    /*     border-style:solid; */
-    }
+}
+
+
+#top-side-bar{
+    /* background-color; */
+/*     width:600px; */
+    height:120px;
+    text-align:center;
+    line-height:100px;
+    float:center;
+    border-style:solid;
+}
+
+#logo{
+    float:left;
+/*     border-style:solid; */
+
+}
+#member{
+    float:right;
+/*     border-style:solid; */
+    border: 5px;    
+}
+
+#nav-side-bar{
+    /* background-color; */
+    /* width:120px; */
+/*     height:120px; */
+/*     text-align:center; */
+    line-height:60px;
+    float:left;
+    border-style:solid;
+}
+
+
+#content{
+    float:center;
+/*     border-style:solid; */
+}
+
+
+#show_factory_class_1{
+    border-style:solid;
+    text-align:center;
+}
+
+#show_factory_class_2{
+    border-style:solid;
+    text-align:center;
+}

+ 32 - 1
templates/history.html

@@ -6,5 +6,36 @@
 
 
 {% block body %}
-
+    <div id="select_histories">
+        <div id="select_histories_1">
+            <select>
+                <option>選擇設備</option>
+            </select>
+            <select>
+                <option>選擇通道</option>
+            </select>
+            <select>
+                <option>選擇欄位</option>
+            </select>
+            <select>
+                <option>選擇項目</option>
+            </select>
+            <button id="search">搜尋</button>
+        </div>
+        <div id="select_histories_2">
+            <select>
+                <option>開始日期</option>
+            </select>
+            <select>
+                <option>開始時間</option>
+            </select>
+            <select>
+                <option>結束日期</option>
+            </select>
+            <select>
+                <option>結束時間</option>
+            </select>
+        </div>
+    </div>
+    
 {% endblock %}

+ 23 - 1
templates/tower.html

@@ -6,5 +6,27 @@
 
 
 {% block body %}
-
+    <div id='select_boxes'>
+        <select>
+            <option value="公司">選擇公司</option>
+            <option value="公司1">公司1</option>
+            <option value="公司2">公司2</option>
+        </select>
+        <select>
+            <option value="廠區">選擇廠區</option>
+            <option value="廠區1">廠區1</option>
+            <option value="廠區2">廠區2</option>
+        </select>
+        <select>
+            <option value="課">選擇課</option>
+            <option value="課1">課1</option>
+            <option value="課2">課2</option>
+        </select>
+    </div>
+    <div id='show_factory_class_1'>
+        A廠區/一課
+    </div>
+    <div id='show_factory_class_2'>
+        A廠區/二課
+    </div>
 {% endblock %}