20200817_jeffrey - silenceuncrio/diary GitHub Wiki

0900

這個禮拜的 review list


M300 - task

  • [100%] P1 - VRRP 不再連動 DHCP Server
  • [100%] P1 - (develop) CID 1 image can upgrade to any brand
  • [0%] P4 - BGP status (web ui)
  • [0%] P4 - give a init value for google map

M300 - issue

  • none

M300 - bug

  • [30%] firmware upgrade 卡在 40%
    • pc 網卡直連 M300 lan 端
    • 檔案上傳慢到(1分鐘100KB)前端的 javascript 慢慢跑到 40% 在等著上傳檔案完成 - 一小時也等不到

M330 - task

  • [100%] P1 - VRRP 不再連動 DHCP Server
  • [100%] P1 - (release/v1.04) lock band web page roll back for brand pi
  • [100%] P1 - (release/v1.04) CID 1 image can upgrade to any brand
  • [0%] P3 - sync multi language from m330 to all mobile project

M330 - issue

  • none

M330 - bug

  • [0%] firmware upgrade 上傳成 M300 的 firmware 第一次失敗後到至後續上傳正確的也會失敗
    • lighttpd 回 request entity too large

M350-C - task

  • [100%] P1 - VRRP 不再連動 DHCP Server
  • [0%] P1 - connection table web ui
  • [0%] P2 - no more mark_wan_lte related to display signal image at top banner
  • [0%] P2 - Dynamic Web UI by HW_MCSV
  • [0%] P2 - Dynamic Firmware Upgrade by HW_MCSV
  • [0%] P2 - Web UI: WAN as LAN

M350-C - issue

  • none

M350-C - bug

  • [20%] web ui openvpn wizard 會讓 lighttpd process 被 kill 掉
    • M330 不會
    • M330 的 lighttpd 為 1.4.30
    • M350 的 lighttpd 為 1.4.40
  • [80%] 修改 menu.html.src 透過 web upgrade 後會 cache 舊的 menu
    • 可以套用至全平台

M350-C - misc

  • [30%] 跨 repository 間 code 的 sync - 培養功力
    • 起手式
      git format-patch -k --stdout ${A_COMMIT_HASH}..${B_COMMIT_HASH} > xxx.patch
      git am -k -3 < xxx.patch
      
    • git am 失敗的時候該怎麼辦? git apply --reject

M360P - task

  • [100%] P1 - VRRP 不再連動 DHCP Server
  • [100%] P1 - lock band web page roll back for brand pi
  • [0%] P2 - web ui: Carrier Aggregation info porting

M360P - issue

  • [60%] 1103: ui menu not base on compile flag
  • [60%] 936: some routes learned via bgp, then they disappear then appear again after a few seconds, and again and again...
  • [60%] 787: when local ethernet link is 100 half, firmware upgrade via web ui fail

M360P - bug

  • [30%] - 0000908: sometimes first time modify LTE NET mode or APN on dual APN will apply fail - root cause 是 lighttpd 重啟了
    • M360P 的 lighttpd 為 1.4.30

ISMS Server - task

  • [80%] node config
  • [80%] node map
  • [10%] multi language

ISMS Server - bug


MISC

  • none

上禮拜五下的結論

參考 Protecting a route with react-router-config? #4962

該 issue 討論串 - gorkalaucirica commented on 27 Mar 2018

已經提出了一個具體的解決方式

{
    {
        path: "/restricted-area",
        render: (props) => isUserLoggedIn() ? <RestrictedArea/> : <Redirect to="/login"/>
    },
    {
        path: "/login",
        component: Login
    }
}

這個解決方式中 isUserLoggedIn() 不能是個 async function

這樣一來我不能在 isUserLoggedIn() 裡去問 isms 如以下的 api

http://192.168.0.95:8000/login?current_session={}
response: {cid: "proscend", level: "super_super", gid: []}

目前使用的 Auth.isAuthed() 不是 async function - 實作如下

export const isAuthed = () => {

  const isAuthed = localStorage.getItem('auth.isAuthed');
  if (isAuthed === null) {
    return false;
  } else {
    return true;
  }

}
commit e8fa24dd990225a01d7e1d44b74bf2ad71f03db3
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Mon Aug 17 14:42:33 2020 +0800

    verify if user is authed before rendering the component

 web/src/components/dashboard/index.js |  9 ---------
 web/src/components/nodeM300/index.js  |  7 -------
 web/src/components/setting/index.js   | 13 +------------
 web/src/components/signIn/signIn.js   |  1 +
 web/src/components/topology/index.js  | 11 -----------
 web/src/components/track/index.js     |  9 ---------
 web/src/routes/app.js                 | 26 +++++++++++++++-----------
 web/src/utils/auth.js                 | 15 +++++++++++++++
 web/src/utils/fetch.js                | 25 ++++++++++++++++++++++---
 9 files changed, 54 insertions(+), 62 deletions(-)

另外 fetch 並沒有 redirect() 可以用