TAPs project worklog === https://www.thinkwithgoogle.com/intl/zh-tw/ https://developers.googleblog.com/ 1. projects 2. PIs 3. project_PI 4. affiliations 5. project_affiliation 6. nets 7. project_net 8. station 9. location 10. channels 11. instrumentTypes 12. sensors 13. dataloggers 14. station_location 15. station_channel --- 1. PI 2. affiliation 3. ProjectStatus 4. Project 5. Net 6. Location 7. Channel 8. Station 9. InstrumentType 10. Sensor 11. Datalogger 12. StationLocation 13. LocationChannel * PI已存在,不用新增,不在表單裡的PI要新增。 * affiliation已存在,不用新增,不在表單裡的affiliation要新增。 * Project已存在,不用新增,不在表單裡的Project要新增。自動比對PI and affiliation並填入表單及建立。 * Net已存在,不用新增,不在表單裡的Net要新增。 * Location已存在,不用新增,不在表單裡的Location要新增。 * Channel已存在,不用新增,不在表單裡的Channel要新增。 * Station已存在,確認Project是否相同,同一個計畫Station名稱是唯一的。若是不同計劃的Station就需要新增。 * InstrumentType有BB, SM, SP,一般不會再新增。 * Sensor已存在,不用新增,不在表單裡的Sensor要新增。但是如果名字的像的Sensor,有可能是大小寫或是縮寫,但其實是同一種儀器,這個電腦就難以辨認。 * Datalogger已存在,不用新增,不在表單裡的Datalogger要新增。但是如果名字的像的Datalogger,有可能是大小寫或是縮寫,但其實是同一種儀器,這個電腦就難以辨認。 * StationLocation,有時候同一個位置,因為儀器故障,就會換一款儀器,所以儀器的序號,以及startTime, endTime會改變。 * LocationChannel,每ㄧ個location可能會有1, 3, 6等不同數量的channels。同一個StationLocation的channel要限制不能重複。目前在admin可以在同ㄧ個StationLocation有兩個HHZ。 ## Redirection 1. 註冊完,登入後,要進入my account 2. 從其他頁面點選登入,登入完成後,要回到原本的畫面,例如資料索取的頁面。 3. 如何在登入選擇要導向哪個頁面? 4. 那就要確認一下,上一頁是哪一頁,除了,登入,註冊,之外,應該要回到上一頁。不然就回到my account。 ## recaptcha 1. 看到的教學文章,每個都要在backdend與google,api做驗證。只有前端做的話,不夠。 [How to use Google reCaptcha with Vuejs](https://itnext.io/how-to-use-google-recaptcha-with-vuejs-7756244400da) !channel的HH?, BH?, EH?,如果寫在mysql裡面的話,會影響到後端(query.py, queryRESP.py)的channel比對。 1. ?寫在db, 前端方便使用,要添加哪個?也可以直接在db資料表增加,一目瞭然。但後端要濾掉含有?及asterisk的channel。 2. ?寫在前端,後端不需要改,但是?要寫在前端,沒辦法從db直接看到所有channel選項。 mysqld.log ``` /var/run/mysqld.log ``` 用python開臨時http server ``` python -m http.server 8000 ``` https://medium.com/@gaute.meek/how-to-add-a-script-tag-in-a-vue-component-34f57b2fe9bd https://stackoverflow.com/questions/45561612/ads-with-script-tags-in-template-vue-js httpd 版本 ``` [chen@formosa ~]$ httpd -V Server version: Apache/2.4.46 (Fedora) Server built: Aug 25 2020 00:00:00 Server's Module Magic Number: 20120211:93 Server loaded: APR 1.7.0, APR-UTIL 1.6.1 Compiled using: APR 1.7.0, APR-UTIL 1.6.1 Architecture: 64-bit Server MPM: event threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_PROC_PTHREAD_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="run/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" [chen@formosa ~]$ ``` httpd 查看所有VirtuslHost網址及設定所在位置 ``` [chen@formosa ~]$ httpd -S VirtualHost configuration: ServerRoot: "/etc/httpd" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/etc/httpd/logs/error_log" Mutex default: dir="/etc/httpd/run/" mechanism=default Mutex cache-socache: using_defaults Mutex authdigest-opaque: using_defaults Mutex watchdog-callback: using_defaults Mutex proxy-balancer-shm: using_defaults Mutex rewrite-map: using_defaults Mutex authdigest-client: using_defaults Mutex lua-ivm-shm: using_defaults Mutex proxy: using_defaults Mutex authn-socache: using_defaults PidFile: "/etc/httpd/run/httpd.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="apache" id=48 not_used Group: name="apache" id=48 not_used [chen@formosa ~]$ ``` 如何使用查詢http server(如:apache)的狀態? ``` systemctl status http.service sudo systemctl status httpd sudo systemctl start httpd ``` ``` Job for httpd.service failed because the service did not take the steps required by its unit configuration. ``` # 需要token的api - [x] myorders - [x] myorder - [x] getWaveform - [x] getPresponse - [x] getPlot - [ ] passwordReset(token in arguments not header) - [ ] passwordChange # 使用者需求 1. 美濃地震發生期間,有哪些測站接收到地震。測站分佈,波形品質,格式。發震前後10分鐘,全部下載。 不想要填project, net, sta, loc, label。頂多選一下outputformat, channel, 和地震前後10分鐘。 2. # 版面更新 1. 基礎router 1hr 2. station 3hr | 3hr+3hr+ a. 引用開源地圖 30min ``` 1. yarn add vue2-leaflet leaflet --save 2. 開源地圖沒辦法正常顯示, 引入css: import 'leaflet/dist/leaflet.css'; 設定地圖能夠顯示的大小: style="height: 350px;" 3. 地圖飄在menu上面 原本 .leaflet-pane{z-index: 400} .leaflet-top, .leaflet-bottom{z-index: 1000} 把他改成1 ``` b. 測站列表,資料篩選,資料下載的頁面不太希望有footer。因為這樣測站列表,資料篩選,資料下載的地方會難以定位。 但是layout已經把footer都設定好了。 30min ``` 1. vuex-pathify是什麼工具?是一款簡化vuex操作的工具 2. 如何在router/index.js使用vuex-pathify 3. material-dashboard-free-theme-v1.2.0的rotuer寫法沒辦法針對某一個routes做beforeEnter()的設定。 ``` c. 版面設定問題 1hr ``` 1. 原本nav bar固定在上面,所以算分配空間比較好分配,現在navbar網下滑會移動,不好分配空間。 2. 原本nav bar固定在上面,下方的fixed是左右貼齊,現在navbar在左邊,手機版沒問題,可是電腦版會偏左。 可能電腦版用absolute, 手機版用fixed 3. 能夠滑動的版面,drag,mousedown,mousemove, mouseup,touchstart,touchmove, touchend, 畫面的height, width ``` d. 放入table 30min e. 放入表格 ``` 1. 2. 表單驗證vee-validate yarn add vee-validate --save 3. 日期format yarn add date-fns --save 4. 表格太長 overflow: auto; 5. 搜尋功能(使用第三方套件做glob matching) 3hr yarn add minimatch --save 由於資料已經在vuex處理過了,所以原本的演算方式需要更改參數 針對七大篩選條件(projects, networks, stations, locations, channels, time, geographicalBoundary),每項都要符合才能過通過篩選。 6. 地圖選取邊界功能(使用第三方套件畫圖) yarn add @geoman-io/leaflet-geoman-free --save ``` f. 索取資料 2hr ``` 1. 由axios到db拿資料,之後的索取就從axios拿 ``` g. 加上marker 30min h. 表格與marker的互動 1hr ``` 1. 點選marker,table會highlight,並且table會滑到對應的測站 30min 2. 點選表格,marker會popup 30min 3. table測站隨地圖邊界更新,僅顯示可是範圍內的測站 30min ``` i. 檔案結構 ``` 1. graphql的指令(mutations.js, getProjects, getStations, user)指令要寫在一起還是分開呢?名字又要取什麼呢? 如果把graphql指令全部寫在一起,這樣檔案比較集中,可是找指令比較不方便 ``` j. vuex + vuex-pathify ``` 1. main.js的store和/store/index.js的store有什麼差別? 2. vuex-pathify到底要怎麼用... 3. [vuex] unknown action type: station/getStations 記得要道modules/index.js裡面註冊要使用的modules ``` l. veutify data table overflow m. drag bar 影響地圖顯示 3. project 3hr a. 索取資料 4. data 3hr a. 新模板的 router寫法不一樣,nested route不好寫 5. signup 3hr 6. signin 3hr 7. order 3hr 8. project detail 9. station detail 10. order detail 11. form validate 12. keep login state 切換到stations頁面非常卡 # [Notes](https://docs.google.com/presentation/d/18ES1BJg0w1PGXp-YCViEnTPw8DTugI0ghHYyyY5O9YI/edit#slide=id.ga5f846bb70_0_87) - STEP 1 : 登入 ```=graphql mutation { tokenAuth( password: "supersecretpassword" email: "clh960524@gmail.com" ) { token success errors } } ``` - STEP 2 : 索取資料 ```=graphql mutation{ dataRequestMutation( format: "mseed", tb: "2008-04-16T00:00:00", te: "2009-03-22T06:00:00", proj: "2008NSE,2009NSE", net: "TW", sta: "NSE01,E001", loc: "*", cha: "EH?", label: "", ) { statusCode text downloadUrl } } ``` - STEP 3 : 以訂單標號索取下載連結 - STEP 4 : 下載資料 點選連結 # Dev 1. App.vue axios baseurl 2. axios-auth.js baseurl 3. apolloClient.js baseurl 4. query.py baseurl 5. queryRESP.py baseurl 6. settings.py https, CORS # 訂單狀態 0: 接收訂單(Queued) 1: 成功(Success) 2: 失敗(Error) 3: 已過期(Expired) 4: 處理中(Working) 怎樣會導致失敗? 0. No data available 1. child index out of range ```=python Traceback (most recent call last): File "/home/chen/anaconda3/envs/TAPs/lib/python3.7/site-packages/promise/promise.py", line 489, in _resolve_from_executor executor(resolve, reject) File "/home/chen/anaconda3/envs/TAPs/lib/python3.7/site-packages/promise/promise.py", line 756, in executor return resolve(f(*args, **kwargs)) File "/home/chen/anaconda3/envs/TAPs/lib/python3.7/site-packages/graphql/execution/middleware.py", line 75, in make_it_promise return next(*args, **kwargs) File "/home/chen/Documents/ctchen/TAPs/backend/schema.py", line 250, in mutate out = query(args) File "/home/chen/Documents/ctchen/TAPs/backend/query.py", line 267, in query checksum_code = root[last][2].text graphql.error.located_error.GraphQLLocatedError: child index out of range ``` 2. auth fail 3. 不要在python寫js code,不然會收到invalid syntax ``` Traceback (most recent call last): File "/home/chen/anaconda3/envs/TAPs/lib/python3.7/site-packages/promise/promise.py", line 489, in _resolve_from_executor executor(resolve, reject) File "/home/chen/anaconda3/envs/TAPs/lib/python3.7/site-packages/promise/promise.py", line 756, in executor return resolve(f(*args, **kwargs)) File "/home/chen/anaconda3/envs/TAPs/lib/python3.7/site-packages/graphql/execution/middleware.py", line 75, in make_it_promise return next(*args, **kwargs) File "/home/chen/Documents/ctchen/TAPs/backend/schema.py", line 254, in mutate from .query import query graphql.error.located_error.GraphQLLocatedError: invalid syntax (query.py, line 379) ``` 4. 看起來好好的,但是出現set No match,連資料夾都沒有建出來 或許可能是因為測站太多了set stas會壞掉。 ``` (from schema.py) order saved. (from schema.py) Membership auth succeeded. (from schema.py) status: 0 (Queued) (from schema.py) status: 4 (Working) (from query.py) orderId: 866d3e5a53ec11eb9a2804d9f5ba9696 [11/Jan/2021 17:08:10] "POST /graphql/ HTTP/1.1" 200 14758 (from query.py) format: ['mseed'] (from query.py) format_length: 1 mseed (from query.py) tb: 2008-04-16 00:00:00 (from query.py) tb: 2008-04-16 00:00:00 (from query.py) te: 2008-04-16 00:01:00 (from query.py) te: 2008-04-16 00:01:00 (from query.py) tb[0]: 2008-04-16T00:00:00 (from query.py) te[0]: 2008-04-16T00:01:00 (from query.py) folder_name: 86c1b2d253ec11eb9a2804d9f5ba9696 set: No match. (from query.py) status: 2 (Error) log: Err: Can not read log xml successfully. from schema.py: [500, 'Err: Server side issue. Please try again later.'] [11/Jan/2021 17:08:10] "POST /graphql/ HTTP/1.1" 200 172 auth success from resolve_my_orders user(resolve_my_orders): chute@earth.sinica.edu.tw [11/Jan/2021 17:08:13] "POST /graphql/ HTTP/1.1" 200 27480 ``` 5. # VITAL - [ ] 0. 執行帳號的權限設定, ~/.cshrc - [ ] 1. 複製script, project, query到本機 - [ ] 2. TAP.chsrc環境變數要改 - [ ] 3. getEvtWaveform需要TAP.chsrc的路徑 - [ ] 4. query.py回傳statusCode需要log.xml的路徑 - [ ] 5. postRequest.csh 的url要改 - [ ] 6. 如何使用csh索取資料? - [ ] 7. **安裝qmerge, rdseed, rdseed5到production機器上!!!。** - [x] rdseed - [x] rdseed5 - [x] sac - [x] qmerge - [ ] 8. 使用tcsh - [ ] 9. 改`ls -A` - [ ] 10. 是否能不要用c shell切資料,改用python處理呢? - [ ] 11. 不想要每次抓資料都要重新query,所以把資料存在vuex裡面。但是只要重新整理,vuex裡面的資料就會不見,有些頁面就會壞掉。 - [ ] 12. ``` grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory [dmc@taps bin]$ ldd ~/bin/grep linux-vdso.so.1 => (0x00007ffde2f0f000) libpcre.so.0 => not found libc.so.6 => /lib64/libc.so.6 (0x00007f8fd637a000) /lib64/ld-linux-x86-64.so.2 (0x00007f8fd6748000) ``` ```=csh curl \ -X POST \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { dataRequestMutation(format: \"mseed\", tb: \"2008-04-16T00:00:00\", te: \"2009-03-22T06:00:00\", proj: \"2008NSE,2009NSE\", net: \"TW\", sta: \"NSE01,E001\", loc: \"--\", cha: \"EHZ\", label: \"20201023080000\", token: \"eyJh\" ) { statusCode text } }" }' \ http://localhost:8000/graphql/ >> {"data":{"dataRequestMutation":{"statusCode":200,"text":"/home/chen/Downloads/query/userdata/eyJh/20201023080000.mseed"}}}[chen@formosa ~/Downloads]$ ``` # 檔案下載 [python - django 实现文件下载功能](https://www.shuzhiduo.com/A/E35pRVxbzv/) [django2实现文件下载(包含中文名的文件)](https://blog.csdn.net/BobYuan888/article/details/99666934) [Python django實現檔案下載](https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/369825/) [Django 视图响应函数详解-HttpResponse、JsonResponse、StreamingHttpResponse、FileResponse、Render](https://blog.csdn.net/Geoffrey_Zflyee/article/details/107400499) > 使用fileResponse > [Django基础(18): 使用StreamHttpResponse和FileResponse下载文件的注意事项及文件私有化](https://blog.csdn.net/weixin_42134789/article/details/83346714) [django实现大文件的断点续传(暂停/继续下载)](https://blog.csdn.net/kuanggudejimo/article/details/99638109) [Django 大文件下载](https://www.cnblogs.com/linxiyue/p/4187484.html) [How do I get user IP address in django?](https://stackoverflow.com/questions/4581789/how-do-i-get-user-ip-address-in-django) ``` http://127.0.0.1:8000/download/type=ms&tb=2009-06-06T06:00:00&te=2009-06-06T06:10:00&sta=CHGB&ch=BH?&l=&account=chute&password=0e8ff133328ef72d60aae59482c1749f ``` [Python使用UUID库生成唯一ID](https://blog.csdn.net/weixin_33861800/article/details/86288398?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.not_use_machine_learn_pai) ## 允使使用star和?是為了方便索取,不需要一個一個打。但飾演正很不方便。尤其是不知道這樣輸入到底是不是正確的。如果,可以知道這樣會沒有資料,應該要在送出表單前就需要擋住。還是,乾脆不要允許使用star和?這樣就不需要讓使用者自己新增選項了。只能用選的。 # 表單驗證規則(前端網頁) 1. waveform - [x] OutputFormat只能夠用選的,不能自行打字 - [ ] Project **可以接受的輸入** - [ ] 可以不選(預設全部) - [ ] 可以選一個 - [ ] 可以選兩個以上(使用逗號分隔) - [ ] 可以選兩個以上(使用star或?) - [ ] 選全部 **不能接受的輸入** - [ ] 除了star和?以外的符號 **採取的驗證規則** a. filter過濾符號 b. 確認project是否存在 2. resp 3. plot **case testing** - [ ] 一個不存在清單中的名字 - [ ] 一串文字中,只有一個不存在 - [ ] Network **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Station **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Location **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Channel **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Start time **可以接受的輸入** **不能接受的輸入** start time不能大於end time **採取的驗證規則** **case testing** - [ ] End time **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Label **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** # 表單驗證規則(後端api) 1. waveform - [ ] outputFormat **可以接受的輸入** - [ ] 只能選一個 **不能接受的輸入** - [ ] 除了mseed, fullseed, sac,全部都不行 **採取的驗證規則** a. 首先,檢查輸入的array長度,只能夠爲1。不等於1的話會跳出Format: not availavle! b. 其次,檢查選取的format是不是在allowed_format當中,如果沒有的話,跳出Format: not availavle! **case testing** - [ ] Project **可以接受的輸入** - [ ] 可以不選(預設全部) - [ ] 可以選一個 - [ ] 可以選兩個以上(使用逗號分隔) - [ ] 可以選兩個以上(使用star或?) - [ ] 選全部 **不能接受的輸入** - [ ] 除了star和?以外的符號 **採取的驗證規則** a. 如果經過對比之後,沒有相符的選項。就會跳出not available! **case testing** - [x] 一個不存在清單中的名字 -> 404 - [ ] Network **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Station **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Location **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Channel **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Start time **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] End time **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** - [ ] Label **可以接受的輸入** **不能接受的輸入** **採取的驗證規則** **case testing** 2. resp 1. 資料下載的流程? a. 登入 -> 選取測站 -> 填寫索取時間段並送出表單 -> 至訂單下載 b. 認證使用者身份 -> 將formData交給GraphQL -> 資料送至schema.py,產生訂單編號,紀錄訂單內容 -> query.py 身份驗證,訂單處理 -> 透過GraphQL返回下載連結 c. -> 認證使用者身份 會員才可以將formData交給GraphQL -> 資料從GraphQL送至schema.py, - [ ] 取得ip, - [x] 產生訂單編號, - [x] 紀錄訂單內容(set default label first), - [x] 身份驗證,使用django auth,log - [x] customer_id寫入DB - [ ] 權限控管,用ORM存取或是用sql指令 -> query.py訂單處理, - [x] 透過GraphQL存取測站資訊, - [x] 把*或?換成list, - [x] 產生資料夾編號, - [x] 交給evtWaveform.csh切資料。 - [x] evtWaveform.csh把遇到的情形寫在log.xml裡面。 - [x] complete time、資料夾編號、檔案名稱、檔案大小寫入DB query.py再讀取log.xml,再把檔案大小,完整性號碼,寫入db -> 透過GraphQL返回下載連結 2. query.py如何與evtWaveform.csh溝通? query.py -> evtWaveform.csh query.py傳遞parameters給evtWaveform.csh,evtWaveform.csh從arugements取 query.py <- evtWaveform.csh evtWaveform.csh留下log.xml,query.py讀 需要送出檔案大小、完整性驗證碼 3. 如何保證訂單編號的唯一性? 使用UUID 4. 如何保證資料夾編號的唯一性? 使用UUID 4. 如何處理檔案撞名的情形? 把檔案放在UUID資料夾底下,只要UUID不會撞名,檔案就不會撞名。 5. log要紀錄什麼東西? 6. 如何取得user IP? 7. 如何在第一時間能夠知道沒有資料? 8. 找完發現沒有資料,那麼要怎麼處理? 9. 系統的維護性、可擴充性如何? 10. 當今天有新的資料或是舊的資料、資訊要更改時(waveform, dataless, project, network, station, location, channel, starttime, endtime...)要如何更新? 要把 10. waveform與response的訂單是要一起紀錄還是分開紀錄?一起紀錄,資料表要長怎樣; 分開紀錄,資料表要長怎樣? 11. 需要統計哪些資訊? 地震波形、儀器響應 哪個計劃被下載的數量(大小)最多? 每日、每週、每月、每年、自訂範圍的資料下載量? 目前用戶數量、名單? 用戶依單位分類? 用戶依職位分類? 12. 後臺需要作出哪些圖表? 13. 後臺功能? 新增、修改、刪除、凍結、啟用使用者的資料及權限、更新database、查詢統計結果。 14. 如何實現線上查詢波形? 15. 系統的架構圖? 16. 系統各個套件的終止維護日期? 17. 系統可以維持多久?什麼時候要重寫? 18. 可能發生錯誤有哪些? 資料逾時、token錯誤、如果系統沒有安裝rdseed4.8或rdseed5,會沒有辦法轉sac檔,切出來的東西會是空資料夾。 18. 如何處理no_data? 19. 用什麼東西產生隨機碼呢? UUID 20. 隨機碼撞號的可能性? 使用UUID,發生碰撞的可能性爲十億分之一,相當於85年每秒產生 10 億個UUID會有50%的機率產生一次碰撞。 21. 會員系統具備哪些功能? 22. 下載檔案時,需要區分evtWaveform和contWavefrom嗎? 23. 訂單的狀態有哪些? 24. 有沒有需要追蹤訂單進度? 25. 網站的功能? 計劃查詢、測站顯示、資料下載 26. 網站的特色? 27. 申請會員需要填哪些資料? email,password, confirm password,affiliation, position,fullname 28. 需要記住會員的哪些資料? active, archived, authority 29. 會員的權限應該有哪些? 針對每個計劃,可以查詢,可以下載 ex: | user_id | project_id | visivle | available | | -------- | -------- | -------- | -------- | | 1 | 2014ILAN | 1 | 1 | | 1 | 2014ITCH | 1 | 1 | | 2 | TAIGER | 1 | 0 | | 2 | OBS | 0 | 0 | 30. 社群賬號登入?(google, fb, line, IG, ...) 不在系統的規劃當中。 29. 弱點掃描 填寫申請表請資服處協助。 30. 源碼檢測 填寫申請表請資服處協助。 31. 滲透測試 不在系統的規劃當中。 32. SEO表現 33. 網頁評分 34. 如何提升網站速度? 35. 使用者的意見? 36. 需要花多少人力與時間維護? 37. 如何引入catalog? 38. 系統的一致性?(變數命名、寫作風格) 39. 哪些檔案是不能洩漏的? 40. graphene是什麼?GraphQL又是什麼? 41. 是否能不要用c shell切資料,改用python處理呢? 42. cshell會作哪些事情? 讀取環境變數,設定環境變數,抓資料(cp),合併資料(cat),切資料(qmerge),轉資料(rdseed),算大小(du),完整性驗證(chksum),合併及壓縮資料(tar -zcvf) 43. cshell會用到哪些功能? source, awk, mkdir, date, mv, rm, cp, cat, qmerge, rdseed, setenv, du, 檢查資料夾是否存在,tar, 寫log,chksum 44. 資料庫備份檔的格式爲何? 是InnoDB,不是MyISAM。 43. getEvtWaveform如何避免不同計劃有同一個測站名的情形? 44. getEvtWaveform如何加速查詢速度?避免O(n^5)的情形發生? 事先紀錄一份文字檔,projects, networks, stations, locations, channels,僅針對裡面有的資料做查詢。 45. python如何拆解json格式檔案? 46. 當一位會員索取他沒有權限的檔案時,應該要哪個階段阻止? 47. 是不是需要跑一個檢測程式確保所有該裝的dependency都就定位? 比如說rdseed4, rdseed5 48. 透過graphql傳遞後,在schema.py拿到的是什麼格式? 49. 透過graphql可以取得用戶ip嗎? 可以 ``` info.context.headers ``` ref: [Request and response objects](https://docs.djangoproject.com/en/3.1/ref/request-response/) 50. 如何把order資訊透過model存到DB裡面? 51. GraphQL可以阻擋掉哪些攻擊?避免垃圾資訊記錄到db裡面? 資料如果少填一個欄位的話,graphql會直接擋掉,不會進到schema.py裡面。 52. python如何取得當前時間呢? ```=python from datetime import datetime current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') print('current_time: ', current_time) ``` 53. 時間紀錄的時區問題?是要記UTC還是UTC+8? 54. 如何透過jdango orm查到特定的訂單? 55. 為什麼不用訂單編號直接開資料夾就好,為什麼需要額外再用亂數產生一個資料夾? 56. 何時需要使用完整性驗證碼,用了完整性驗證碼可以達到什麼效果? 57. 為什麼沒有辦法把資料寫入DB呢? 58. 完成時間要由誰來決定? 59. How can I see the raw SQL queries Django is running? 60. 認證失敗時如何自訂graphql的錯誤訊息? 61. 不同計劃的同一個測站名下載下來要怎麼區分? 62. 如何讓每一個測站可以下載到各自的xml,計劃的xml 63. 多人下載時,伺服器會如何運作?如何排程?能否依大小做順序的變更,例如檔案大的資料比較晚處理,或是每處理10筆小的,才處理檔案大的? 64. 能否限制同一個user一次不能夠索取超過5筆訂單? 65. 是否可以在測站介紹的部分新增文章,這樣比較容易找citation。 66. 如何告訴使用者,他輸入資料有錯,甚至是提供一些建議給他? 67. 為什麼graphql找不到我的model? 因為在model寫好之後,要在schema.py進行註冊,graphql才可以使用。 68. 要如何在query時傳遞arguments? ```python # import models from models.py from backend.models import Orders # define ObjectType class OrdersType(DjangoObjectType): class Meta: model = Orders # define query # use graphene.List in order to get a list of results # make sure to declare arguments in this step class Query(graphene.ObjectType): my_orders = graphene.List(OrdersType, user_id = graphene.Int()) # define resolver def resolve_my_orders(self, info, user_id): return Orders.objects.filter(user_id=user_id) ``` ref: [Queries & ObjectTypes](https://docs.graphene-python.org/projects/django/en/latest/queries/#arguments) 69. 如何區別有需要身份驗證的query和不需要身份驗證的query? 可以使用axios-auth.js來實現 ```=js import axios from 'axios' const instance = axios.create({ baseURL: 'http://140.109.80.58:8000/graphql/', }) instance.defaults.headers.common['Authorization'] = `JWT ${localStorage.getItem('token')}` export default instance ``` 70. 如何拆解orderDetail裡面的key和value?他的格式是字串。 可以利用JSON.parse()來處理 71. 如何用python正確的紀錄JSON格式? 要用雙引號來括著key ```=python order_detail = '{"format": format, "tb": tb, "te": te, "proj": proj, "net": net, "sta": sta, "loc": loc, "cha": cha, "label": label, "token": token}' ``` 72. 如何避免在切換order和orderDetail的時候,重複索取資料?能夠只索取一次資料嗎? 第一次載入order時,用graphql索取一次資料,然後就存在vuex store的 state裡面,打開orderDetail頁面時,是去vuex store的 state取資料。 73. js if scope let 宣告的variable,出了if之後是不是就拿不到了? 好像是 74. 一個使用者索取資料時,取相同的label,那麼在連接訂單資料時,用什麼兩區別兩個訂單?router怎麼設定?資料怎麼拿?是不是需要靠訂單編號來作識別? 75. 索取資料要驗證,切換router要驗證。 76. 把訂單編號放在url會有危險性嗎? 77. 如何在js array中select出特定訂單?js返回子數組? ```=js getMyOrderDetail: (state) => (OrderId) => { console.log('from getMyOrderDetail', OrderId) return state.data.filter(item =>{ return (item.orderId === OrderId) ? true : false }) } ``` 78. vuex在get資料的時候可以輸入參數嗎?比如說get特定編號的訂單資料? 可以[Method-Style Access](https://vuex.vuejs.org/guide/getters.html#method-style-access) 79. 儲存到vuex store state的資料是要用原始資料,還是處理過的資料,如果用原始資料的話,每次使用都要重新處理。 應該要儲存處理過的資料才對,不過變數在scope上會遇到一點問題,就是第一次拿到訂單後,用forEach遍歷每個訂單,然後orderDetail改成json格式,把時間的T和+0000去除掉,但是不知道怎麼存回原本的dierectory。 80. graphql如何對錯誤的input arguments做篩選? 81. 如何把axios改成apollo? 82. 閒置過久自動登出? 83. 憑證到期自動登出? 84. 憑證到期自動延長? 85. 重新整理會需要重新登入? 首次登入,把token與expiredate記錄在localstorage裡面。 每次更新頁面,去檢查localstorage裡面有沒有token,憑證時間有沒有過期。 沒有過期的話,就繼續保持登入的狀態。過期的話,就logout。 86. 前臺表單驗證? 87. 後臺表單驗證? Step 1: 過濾。 Step 2: 比對,並留下要的。 - [ ] 檔案格式是否正確 a. waveform有sac, mseed, (fullseed) b. response有RESP, PZs, PZs with header, (system const.) c. 只能有英文字不接受標點符號。可以輸入大小寫英文,不過我全部都會轉成小寫的使用。code也使用小寫。 - [ ] 起始時間是否正確 a. 要大於所有計劃的起始時間,例如:2008年之類的 b. 要大於索取計劃的起始時間 c. 要小於結束時間 d. 接受數字, :, T. 其他都不行。 - [ ] 結束時間是否正確 a. 要小於處理當下的時間 b. 要小於開放的時間 c. 要小於索取計劃的結束時間 d. 接受數字, :, T. 其他都不行。 - [ ] 計劃是否正確 a. 檢查資料庫中該使用者有權限存取的計劃 b. 檢查資料庫中是否有這個計劃 c. 遇到不合理的計劃,是要當作沒看到,然後處理合理的。還是完全退回? d. 接受數字,英文,逗號,*,?. 其他都不行。 - [ ] 測網是否正確 a. 檢查資料庫中是否有這個測網 b. 接受數字,英文,逗號,*,?. 其他都不行。 - [ ] 測站是否正確 a. 檢查資料庫中是否有這個測站 b. 接受數字,英文,逗號,*,?. 其他都不行。 - [ ] 位置是否正確 a. 檢查資料庫中是否有這個位置 b. 接受數字,英文,逗號,*,?. 其他都不行。 - [ ] 分量是否正確 a. 檢查資料庫中是否有這個分量 b. 接受數字,英文,逗號,*,?. 其他都不行。 - [ ] 標籤是否正確 a. 標籤有限定語言嗎? b. 預設的話,是要寫"", null, default, NULL?? c. 接受數字,英文,中文. 其他都不行。 88. 可以用舊有的紀錄重新發送訂單嗎?程式邏輯要怎麼設計呢? 89. 如何留下log?plain text, json, or xml??? 90. 用update會覆蓋掉log紀錄,要如何增加log記錄而不要覆蓋到之前的log? 91. format要記錄在db嗎?不然就要寫死在code上面了。 92. 如何檢查python list裡面有沒有某個value? 93. 要怎麼過濾format? a. 只能選一個 b. 只能是mseed或sac c. 大寫全部轉小寫 d. 輸入mseed,sac會跑出什麼結果? 94. list裡面有幾個元素? 95. 如何處理大小寫問題?一定要一樣?全部轉小寫?全部轉大寫? 96. 如何處理奇怪的符號? 97. 兩個計畫,兩組時間,三個計劃,三組時間,19個計劃,19組時間,要怎麼決定可以選擇的時間? 98. python的re和filter感覺都有過濾的功能,要使用哪一個呢?還是可以搭配使用? 99. filter是從list中回傳的是符合規則的東西,並不會真的過濾list中的東西。 100. python re過濾list中每個value? [Filter list with regex [duplicate]](https://stackoverflow.com/questions/33960334/filter-list-with-regex) [Failure when filtering string list with re.match [duplicate]](https://stackoverflow.com/questions/34117950/failure-when-filtering-string-list-with-re-match) [請不要再用re.compile了!!!](https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/656506/) [Remove empty strings from a list of strings](https://stackoverflow.com/questions/3845423/remove-empty-strings-from-a-list-of-strings) 101. Is list item in another list? 102. 計劃,測網,測站,位置,分量,都是大寫嗎?還是會有小寫的?還是大小寫混雑? 103. python string 和 datetime的轉換? 104. 重新整理之後,logout timer就失效了,要怎麼辦? 要用每次進入路由前,都確認jwt是不是還在期限內來確認,會比較好。 [Learning Vue JS - Auto Logout ](https://www.youtube.com/watch?v=7TVcxOD4uh0) 這個沒有使用jwt 而是偵測使用者的行為,讓他們持續維持登入狀態。 105. dmc在taps根目錄/var/www/taps無法建立資料夾,在/var/www/taps/script無法編輯,因為權限不足。 106. dmc在taps 107. 如何縮放頁籤 [vue-multipane](https://yansern.github.io/vue-multipane/demo/index.html) 108. How to disable vuetify data table resize on mobile? [v-data-table on Vuetify 2.0.5 how to disable change of table header on mobile screens? ](https://stackoverflow.com/questions/57425619/v-data-table-on-vuetify-2-0-5-how-to-disable-change-of-table-header-on-mobile-sc) 109. How to fix v-table-header height is needed [Vuetify v-data-table fixed-header not working](https://stackoverflow.com/questions/60711726/vuetify-v-data-table-fixed-header-not-working) 110. How to disable v-table pagination? [https://stackoverflow.com/questions/61073032/how-to-show-all-items-in-vuetify-data-table-instead-of-10-rows-only](https://stackoverflow.com/questions/61073032/how-to-show-all-items-in-vuetify-data-table-instead-of-10-rows-only) 111. How to change paddings in td? 確認height和line-height 112. How to change width in th, td? 找不到方式,只好調padding 113. How to avoid line change in th, td? white-space: nowrap; 114. How to update leaflet vue marker while resizing the map? ```=vue @update:zoom="updateSelectedStations()" @update:bounds="updateSelectedStations()" ``` 好像@update:bounds一個就夠了,不需要兩個都用 ref: [@update firing on map load](https://github.com/vue-leaflet/Vue2Leaflet/issues/486) [minNativeZoom and maxNativeZoom ](https://github.com/vue-leaflet/Vue2Leaflet/issues/389) 115. How to prevent popup info disturb the UX? 116. How to open a blank window? 117. How to link the popup and the table? [#click:row](https://vuetifyjs.com/en/api/v-data-table/#slots) [Vuetify - How to highlight row on click in v-data-table ](https://stackoverflow.com/questions/56686652/vuetify-how-to-highlight-row-on-click-in-v-data-table) [How to highlight rows in v-data-table on click in Vuetify (version >= 2.0)? ](https://stackoverflow.com/questions/57490177/how-to-highlight-rows-in-v-data-table-on-click-in-vuetify-version-2-0) [How can I add a click event to the v-data-table?](https://stackoverflow.com/questions/58025420/how-can-i-add-a-click-event-to-the-v-data-table) 預設的show-select沒辦法在選取row時,改變他的css,也沒有辦法讓某個選項是可以點擊的。這個需要在template自製。 https://codepen.io/appurist/pen/LwEowG https://github.com/vuetifyjs/vuetify/issues/8432 https://codepen.io/fontzter/pen/qywQjK https://forum.vuejs.org/t/customized-display-of-vuetify-2-v-data-table-headers-and-rows/71375 vuetify row select v-simple-checkbox ```=vuejs old: <template v-slot:item.data-table-select="{ on, props }"> new: <template v-slot:item.data-table-select="{ isSelected, select }"> ``` 找得到資料,卻沒辦法觸發tr。 可以觸發tr,卻沒辦法取得資料。 ```=vuejs <template v-slot:item="{ isSelected, select, item }"> <tr :active="isSelected" @click="handleRowClick($event, item)"> <td> <v-simple-checkbox :value="isSelected" @input="select($event)"></v-simple-checkbox> </td> <td>{{ item.project }}</td> <td>{{ item.station }}</td> <td>{{ item.latitude }}</td> <td>{{ item.longitude }}</td> <td>{{ item.startDate }}</td> <td>{{ item.endDate }}</td> </tr> </template> ``` https://codepen.io/ibrahimbeladi/pen/NWPYdZR?editors=1010 [Feature Request Scroll to top within data table #10134](https://github.com/vuetifyjs/vuetify/issues/10134) 118. How to cancel virtual scroll animation?或是加速滾動,不然看那個滾輪滾很遠,頭很暈。 119. vuetify 的date-fns不能使用要怎麼辦? > Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule ```=vuejs old this.form.time.startTime ? format(this.form.time.startTime, 'EEEE, MMMM do yyyy') : '' new this.form.time.startTime ? format(parseISO(this.form.time.startTime), 'EEEE, MMMM do yyyy') : '' ``` 120. 沒有搜尋到會有什麼反應? 121. 單純輸入經緯度,會畫出藍色範圍框框嗎? 122. array要怎麼存在csv的一個欄位中? 123. 開啓新分頁vuex的資料會消失該怎麼辦 https://guahsu.io/2018/10/vue-sessionstorage-sharing-and-sync-vuex/ 124. drag https://stackoverflow.com/questions/46931103/making-a-dragbar-to-resize-divs-inside-css-grids https://blog.csdn.net/ee_11eeeeee/article/details/100827733 125. vuejs的app.js太大要如何優化?4,677.1 KiB https://medium.com/hackernoon/how-we-got-a-100-lighthouse-performance-score-for-our-vue-js-app-c6f9ca25714b https://medium.com/better-programming/6-ways-to-speed-up-your-vue-js-application-2673a6f1cde4 https://www.zhihu.com/question/266401850 126. 什麼是webpack https://neighborhood999.github.io/webpack-tutorial-gitbook/Part1/ 127. 如何bundle檔案? 128. 瘦身 ```=js Eliminate render-blocking resources 0.93 s Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles. Learn more. URL Transfer Size Potential Savings …css/font-awesome.min.css(stackpath.bootstrapcdn.com) 13.9 KiB 380 ms /jquery-3.5.1.slim.min.js(code.jquery.com) 48.2 KiB 460 ms …js/bootstrap.bundle.min.js(cdn.jsdelivr.net) 43.2 KiB 370 ms /445972d2c5.js(kit.fontawesome.com) 7.3 KiB 460 ms ``` ``` const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin ``` ``` remove bootstrapvue ``` 129. https://vueschool.io/articles/vuejs-tutorials/vue-js-performance-optimizing-third-party-libraries/ 130. https://www.binarcode.com/blog/tips-for-building-lighter-and-more-performant-vuejs-spa/ 131. 如何gzip檔案? https://zhuanlan.zhihu.com/p/64973956 [Vue (完结篇)- Vuex 概念 、开启Apache的gzip压缩](https://blog.csdn.net/qq_43562262/article/details/105811019) 132. 如何在async索取資料回來後,才顯示頁面。避免發生Can not read property of undifined。 133. 如何讓日曆可以用選的,也可以用打字的。然後,還要能夠符合特定格式,最後與label連動? https://vuetifyjs.com/en/components/date-pickers/#formatting-with-external-libraries 目前vuetify提供的過濾方式,沒有辦法接受text input > 可是現在把字打在textfield上面,並不會真的更新到time.startTime上面。 一個欄位紀錄raw data,要能夠與使用者輸入連動。 一個欄位呈現過濾後的格式。 日曆選日期會儲存在time.startTime裡面。 textfield本身就可以打字,然後computed綁定time.startTime去格式化日期。 > 後來用兩個data field與一個method解決。一個欄位用來記錄表單的開始時間,一個欄位用來記錄v-data-picker的時間。然後,一個method把v-data-picker的時間轉換格式並儲存在表單的開始時間。 > 記得text-filed要把:value改成v-model才能夠接受user的input ```=vuejs <v-menu v-model="form.time.menuStart" :close-on-content-click="false" max-width="290" offset-y > <template v-slot:activator="{ on, attrs }"> <v-text-field v-model="form.time.startTime" clearable label="Start time" v-bind="attrs" v-on="on" @click:clear="form.time.startTime = null" dense ></v-text-field> </template> <v-date-picker v-model="form.time.datePickerStartTime" @change="form.time.menuStart = false" @input="formatStartTime()" ></v-date-picker> </v-menu> form: { time: { menuStart: false, startTime: format(parseISO('2008-01-01'), "yyyy-MM-dd'T'HH:mm:ss"), datePickerStartTime: '', } }, formatStartTime () { console.log('(formatStartTime)') let startTime = this.form.time.datePickerStartTime this.form.time.startTime = this.dateFormattedDatefns(startTime) }, dateFormattedDatefns (str) { console.log('(dateFormattedDatefns)') return str ? format(parseISO(str), "yyyy-MM-dd'T'HH:mm:ss") : '' }, ``` 134. 時間不會自己進位怎麼辦? 135. 3份表單用差不多的規則驗證,但是每份都要手動更新,很容易漏掉...。有沒有辦法更新一份,三份都套用? 136. this.$nextTick()是什麼工具? 137. v-combobox有沒有辦法選擇所有選項? 可以,但是如果選項太多,畫面會很擠很醜。 然後v-list-tile要改成v-list-item。 [How to have a “select all” option on a v-select or v-combobox? ](https://stackoverflow.com/questions/50560020/how-to-have-a-select-all-option-on-a-v-select-or-v-combobox) 138. 有沒有辦法做到,前面的選項改動之後,後面的選項就會跟著改動的效果?就比如說我選了2014ILAN,那麼Network只會有TW,station只會有Axxx,Channel只會有EPZ,StartTime與EndTime則會跟著project做改變? 139. 為什麼getWaveform.vue頁面要分兩次索取? 因為原本索取所有測站的方式沒有辦法索取到BH?這種值。 只好單獨向channels的資料表取值。 獲取應該要每個欄位各自取值。 140. 留空的話預設爲All是不是會跟required打架?? 141. orderDetail的表單太長了,要分行。 142. nested vue router 照着範例做,為什麼沒有顯示? **child的path不要加/** ```=vuejs 錯誤示範 { path: '/dataRequest', name: 'DataRequest', components: { default: () => import('./components/dataRequest/dataRequest.vue'), nav: Header }, redirect: '/dataRequest/getWaveform', children: [ { path: '/getWaveform', name: 'getWaveform', components: { default: () => import('./components/dataRequest/getWaveform.vue') } }, { path: '/getResponse', name: 'getResponse', components: { default: () => import('./components/dataRequest/getResponse.vue') } }, { path: '/getPlot', name: 'getPlot', components: { default: () => import('./components/dataRequest/getPlot.vue') } } ] }, ---------------------------------------------------------------------------- 正確方式 { path: '/dataRequest', name: 'DataRequest', components: { default: () => import('./components/dataRequest/dataRequest.vue'), nav: Header }, redirect: '/dataRequest/getWaveform', children: [ { path: 'getWaveform', name: 'getWaveform', components: { default: () => import('./components/dataRequest/getWaveform.vue') } }, { path: 'getResponse', name: 'getResponse', components: { default: () => import('./components/dataRequest/getResponse.vue') } }, { path: 'getPlot', name: 'getPlot', components: { default: () => import('./components/dataRequest/getPlot.vue') } } ] }, ``` 143. 下拉式表單+textfield,在手機上表單會與鍵盤重疊。 要用選的,就用選的。 要用打字的,就用打字的。 不要又要選,又要打字。 144. 單選的選單可以放all的選項,但是多選的選單,就不能放All了。 145. vee-validate 不提供 date驗證,要自己寫 [date_format, is_not available for V2, but not for V3 #2291](https://github.com/logaretm/vee-validate/issues/2291) 146. date-fns可以驗證特定格式嗎?isValid和isDate的差別在哪?對於isValid來說,長怎樣才是valid。 147. 應該要先把文字轉成date format嗎? [Converting a string to a date in JavaScript ](https://stackoverflow.com/questions/5619202/converting-a-string-to-a-date-in-javascript) 148. 如何驗證輸入的日期有符合所需格式(YYYY-MM-DDTHH:mm:ss)? 149. 把string轉成.toISOString()會受到瀏覽器時區的影響。 150. 為什麼new Date()時要加上Z呢? 不加Z的話,轉換後的時間格式還是會附上瀏覽器的時區。這樣就跟我們原本的意思不一樣了。因為原本的string我們是要當作UTC使用的。 加Z的話,轉換後的時間格式會把string當作UTC,並轉換成時區時間。之後再轉回string時,仍然是UTC時間。 ```=js new Date('2008-01-01T00:00:00') Tue Jan 01 2008 00:00:00 GMT+0800 (Taipei Standard Time) new Date('2008-01-01T00:00:00Z') Tue Jan 01 2008 08:00:00 GMT+0800 (Taipei Standard Time) ``` 151. 輸入1~6個數字,new Date()還是會把string轉成date,該怎麼辦? 152. 為什麼計劃的起始時間與結束時間指是用來參考的,不拿來實際使用? 因為有些計劃的起始時間跟結束時間,並非與資料吻合。所以,時間的部分以測站時間為準。 153. 結束時間要比開始時間晚,要怎麼驗證? [Cross Field Validation](https://vee-validate.logaretm.com/v3/advanced/cross-field-validation.html) 154. 字太小,如何調整才能通過無障礙驗證? 155. 如何做多語系? 156. 用dense的話vee-validate的error-message會把標題擋住。 157. How to implement v-card gird-system with pagination? [Create A Custom Pagination Component with Laravel, Vuetify and Vuex](https://www.youtube.com/watch?v=BFdR4p_FSJE) a. 他是用v-data-table來呈現資料 b. 他的後端api(UserController.php)已經把page都設定好了,我們沒有設定的話,要自己分割數量 c. 他只有要把資料呈現與分頁,並沒有要實作filtering。 d. 19個東西,總共是0~18。每10個1頁,第一頁爲0~9,第二頁爲10~18。第X頁爲(X-1)*10~(X-1)*10+9 1 0~9 2 10~19 3 20~29 x (x-1)*10~(x-1)*10+9 == x*10-1 if last (x-1)*10~total.length - 1 [Logic behind pagination like google](https://stackoverflow.com/questions/11272108/logic-behind-pagination-like-google) 158. Except for <router-link>, is there other ways to open a new tab when using this.$router.push()? [Can vue-router open a link in a new tab? ](https://stackoverflow.com/questions/40015037/can-vue-router-open-a-link-in-a-new-tab) 159. 卡片的內容有多有少,導致卡片的大小參差不齊。 160. 拿到資料才去篩選要顯示的年份範圍,容易出問題 ``` vue.esm.js?efeb:628 [Vue warn]: Computed property "yearRange" was assigned to but it has no setter. ``` 161. vue要繪圖要怎麼用?vuechart?D3.js? [Data visualization with Vue and D3](https://blog.logrocket.com/data-visualization-with-vue-and-d3/) 162. paginate要寫在vuex的action還是mutation? 163. 不同js寫相同名字的action, mutation會呼叫到哪一個js的func? 164. install error ``` Collecting mysqlclient==2.0.1 Using cached mysqlclient-2.0.1.tar.gz (87 kB) ERROR: Command errored out with exit status 1: command: /Users/Jordon/opt/miniconda2/envs/TAPS/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-install-8m6ew47i/mysqlclient_3360ecfe36c549fc89382e68a02f72dc/setup.py'"'"'; __file__='"'"'/private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-install-8m6ew47i/mysqlclient_3360ecfe36c549fc89382e68a02f72dc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-pip-egg-info-7ho47zk5 cwd: /private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-install-8m6ew47i/mysqlclient_3360ecfe36c549fc89382e68a02f72dc/ Complete output (12 lines): /bin/sh: mysql_config: command not found /bin/sh: mariadb_config: command not found /bin/sh: mysql_config: command not found Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-install-8m6ew47i/mysqlclient_3360ecfe36c549fc89382e68a02f72dc/setup.py", line 15, in <module> metadata, options = get_config() File "/private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-install-8m6ew47i/mysqlclient_3360ecfe36c549fc89382e68a02f72dc/setup_posix.py", line 65, in get_config libs = mysql_config("libs") File "/private/var/folders/38/tcn9r1890_qd_0j34h9vlf9h0000gp/T/pip-install-8m6ew47i/mysqlclient_3360ecfe36c549fc89382e68a02f72dc/setup_posix.py", line 31, in mysql_config raise OSError("{} not found".format(_mysql_config_path)) OSError: mysql_config not found ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ``` 165. new Date()在chrome和火狐不一樣 [new Date() works differently in Chrome and Firefox ](https://stackoverflow.com/questions/15109894/new-date-works-differently-in-chrome-and-firefox) ``` 2014-07-31Z chrome可以接受,firefox不能接受 2014-07-31 00:00:00Z chrome和firefox都可以接受 ``` 166. 如何合併axios與appolo的寫法,讓graphql能夠更容易使用? [Post mutation to graphql with axios ](https://stackoverflow.com/questions/51630137/post-mutation-to-graphql-with-axios) 167. pip install -r requirement.txt failed ``` Collecting aniso8601==7.0.0 Using cached https://files.pythonhosted.org/packages/45/a4/b4fcadbdab46c2ec2d2f6f8b4ab3f64fd0040789ac7f065eba82119cd602/aniso8601-7.0.0-py2.py3-none-any.whl ERROR: Could not find a version that satisfies the requirement asgiref==3.2.10 (from -r requirements.txt (line 2)) (from versions: 0.8, 0.9, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.12.0, 0.12.1, 0.13.0, 0.13.2, 0.13.3, 0.14.0, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 3.0.0, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.2.0, 3.2.1, 3.2.2, 3.2.3) ERROR: No matching distribution found for asgiref==3.2.10 (from -r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl ERROR: Could not find a version that satisfies the requirement Django==3.1.1 (from -r requirements.txt (line 6)) (from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.8a1, 1.8b1, 1.8b2, 1.8rc1, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, 1.8.12, 1.8.13, 1.8.14, 1.8.15, 1.8.16, 1.8.17, 1.8.18, 1.8.19, 1.9a1, 1.9b1, 1.9rc1, 1.9rc2, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9, 1.9.10, 1.9.11, 1.9.12, 1.9.13, 1.10a1, 1.10b1, 1.10rc1, 1.10, 1.10.1, 1.10.2, 1.10.3, 1.10.4, 1.10.5, 1.10.6, 1.10.7, 1.10.8, 1.11a1, 1.11b1, 1.11rc1, 1.11, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.11.6, 1.11.7, 1.11.8, 1.11.9, 1.11.10, 1.11.11, 1.11.12, 1.11.13, 1.11.14, 1.11.15, 1.11.16, 1.11.17, 1.11.18, 1.11.20, 1.11.21, 1.11.22, 1.11.23, 1.11.24, 1.11.25, 1.11.26, 1.11.27, 1.11.28, 1.11.29) ERROR: No matching distribution found for Django==3.1.1 (from -r requirements.txt (line 6)) MySQLdb._exceptions.OperationalError: (1043, 'Bad handshake') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run self.check_migrations() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/core/management/base.py", line 459, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/migrations/executor.py", line 18, in __init__ self.loader = MigrationLoader(self.connection) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/migrations/loader.py", line 53, in __init__ self.build_graph() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/migrations/loader.py", line 216, in build_graph self.applied_migrations = recorder.applied_migrations() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/migrations/recorder.py", line 77, in applied_migrations if self.has_table(): File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/migrations/recorder.py", line 55, in has_table with self.connection.cursor() as cursor: File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/backends/base/base.py", line 259, in cursor return self._cursor() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/backends/base/base.py", line 235, in _cursor self.ensure_connection() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection return Database.connect(**conn_params) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/MySQLdb/__init__.py", line 130, in Connect return Connection(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.8/site-packages/MySQLdb/connections.py", line 185, in __init__ super().__init__(*args, **kwargs2) django.db.utils.OperationalError: (1043, 'Bad handshake') Exception in thread django-main-thread: Traceback (most recent call last): File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection return Database.connect(**conn_params) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/MySQLdb/__init__.py", line 130, in Connect return Connection(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/MySQLdb/connections.py", line 185, in __init__ super().__init__(*args, **kwargs2) MySQLdb._exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run self.check_migrations() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/core/management/base.py", line 459, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/migrations/executor.py", line 18, in __init__ self.loader = MigrationLoader(self.connection) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/migrations/loader.py", line 53, in __init__ self.build_graph() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/migrations/loader.py", line 216, in build_graph self.applied_migrations = recorder.applied_migrations() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/migrations/recorder.py", line 77, in applied_migrations if self.has_table(): File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/migrations/recorder.py", line 55, in has_table with self.connection.cursor() as cursor: File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 259, in cursor return self._cursor() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 235, in _cursor self.ensure_connection() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/base/base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection return Database.connect(**conn_params) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/MySQLdb/__init__.py", line 130, in Connect return Connection(*args, **kwargs) File "/Users/Jordon/opt/miniconda2/envs/TAPs/lib/python3.7/site-packages/MySQLdb/connections.py", line 185, in __init__ super().__init__(*args, **kwargs2) django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") ``` 168. axios應該要放在vue資料夾的哪個位置呢? [vue 项目src文件夹结构和功能](https://blog.csdn.net/weixin_35773751/article/details/104511441) 169. jwt要放cookies還是localstorage? [LocalStorage vs Cookies: All You Need To Know About Storing JWT Tokens Securely in The Front-End](https://dev.to/cotter/localstorage-vs-cookies-all-you-need-to-know-about-storing-jwt-tokens-securely-in-the-front-end-15id) 應該是cookies比較好,因為可以抵擋XSS攻擊。不過cookies只能儲存4 KB。 170. [5. Short-lived access token with long-lived refresh token ](https://medium.com/hackernoon/all-you-need-to-know-about-user-session-security-ee5245e6bdad) 171. Handling timeout in Axios? 172. 如何設定jwt的有效時間? [JWT_EXPIRATION_DELTA](https://django-graphql-jwt.domake.io/en/latest/settings.html#jwt-expiration-delta) 在TAPs/settings.py的GRAPHQL_JWT設定,記得從datetime使用timedelta 173. python exception & GraphqlError? [Graphene Errors](https://www.howtographql.com/graphql-python/6-error-handling/) 174. graphql_auth是怎麼與GraphiQL串接的?在shcema.py沒看到mixin? 175. 為什麼error會有nonFiledError?在mixin沒看到 176. 如何客製化graphql error message? 177. cls在python是什麼? [Python's Instance, Class, and Static Methods Demystified](https://realpython.com/instance-class-and-static-methods-demystified/) 不是很懂,不過跟物件導向有關 178. 這樣寫是不ok的 第二層的getMyOrders的確有拿到資料,但是他return 給第一層的getMyOrders,第一層的getMyOrders無法把取道的資料給到Order.vue。因為他在發出第二層的dispatch之後,就結束了。 ```=js getMyOrders ({commit, state, dispatch}) { return new Promise(function (resolve, reject) { axios .post('', { query: print(MY_ORDERS), }) .then((response) => { console.log('(getMyOrders) response: ', response) const payload = response.data.data.myOrders if (payload === null) { store .dispatch('refreshToken') .then(() => { dispatch('getMyOrders') }) .catch((e) => { console.log(e) }) } else if (payload.success === false) { store .dispatch('refreshToken') .then(() => { dispatch('getMyOrders') }) .catch((e) => { console.log(e) }) } else { ...... commit('SET_MY_ORDERS', myOrders) resolve() } }) .catch((error) => { console.log(error) reject() }) }) }, ``` 179. 如何讓註冊的api暨可以接google recaptcha又可以接一般圖形驗證呢? 180. 如何幫vue2-leaflet的l-circle-marker加上tooltip? [Vue2Leaflet : how to display the tooltip of a specific marker](https://stackoverflow.com/questions/54966684/vue2leaflet-how-to-display-the-tooltip-of-a-specific-marker) 181. python如何下載大檔案? [Download large file in python with requests](https://stackoverflow.com/questions/16694907/download-large-file-in-python-with-requests) 182. argparse輸入wildcard會失敗 其實不是python argparse的問題,而是shell造成的。如果想輸入glob,就需要用單引號括起來,這個跟使用find指令,輸入--name的時候一樣。 [Prevent expansion of wildcards in non-quoted python script argument when running in UNIX environment](https://stackoverflow.com/questions/44971986/prevent-expansion-of-wildcards-in-non-quoted-python-script-argument-when-running) 183. 如何在django客製化script? [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) 184. 如何在js 驗證YYYY-MM-DD呢? https://www.section.io/engineering-education/javascript-dates-manipulation-with-date-fns/ 185. csh操作手冊? http://star-www.rl.ac.uk/docs/sc4.htx/sc4se1.html 186. 重啟apache需要先關閉網站嗎? ``` systemctl restart httpd systemctl status httpd ``` 187. 如何查看apache log? ``` /var/log/httpd/ ``` 188. 如何讓資料夾可以透過網路存取? a. 確認資料夾位置 b. 設定apache ``` vim vim /etc/httpd/conf/httpd.conf ``` c. 重啟apache ``` systemctl restart httpd ``` d. 若遇到403 forbidden 可能是因為SELinux阻擋,可利用ls -Z查詢資料夾的security context [1] ``` ls -Z drwxrwxr-x. dmc dmc unconfined_u:object_r:unlabeled_t:s0 Avail drwxrwxr-x. dmc dmc unconfined_u:object_r:httpd_sys_content_t:s0 bin drwxrwxr-x. dmc dmc unconfined_u:object_r:unlabeled_t:s0 project drwxr-xr-x. dmc dmc unconfined_u:object_r:default_t:s0 query ``` e. 更改資料夾的security context ``` chcon -R -t httpd_sys_content_t directory-name ``` f. 再次查詢資料夾的security context,若已變更為httpd_sys_content_t即可 g. 另外也可以查詢log,來瞭解細節 [2] ``` cat /var/log/messages Mar 12 00:04:42 taps setroubleshoot: failed to retrieve rpm info for /data/open/Avail Mar 12 00:04:42 taps setroubleshoot: SELinux is preventing httpd from read access on the directory /data/open/Avail. For complete SELinux messages run: sealert -l b9d9cd96-e993-4e73-ade5-4f96d7922430 ``` h. 發現是SELinux阻擋的話,用sealert查詢 ``` sealert -l b9d9cd96-e993-4e73-ade5-4f96d7922430 ***** Plugin catchall (1.31 confidence) suggests ************************** If you believe that httpd should be allowed read access on the Avail directory by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # ausearch -c 'httpd' --raw | audit2allow -M my-httpd # semodule -i my-httpd.pp Additional Information: Source Context system_u:system_r:httpd_t:s0 Target Context unconfined_u:object_r:unlabeled_t:s0 Target Objects /data/open/Avail [ dir ] Source httpd Source Path httpd Port <Unknown> Host localhost.localdomain Source RPM Packages Target RPM Packages Policy RPM selinux-policy-3.13.1-268.el7.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name taps.earth.sinica.edu.tw Platform Linux taps.earth.sinica.edu.tw 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 Alert Count 1 First Seen 2021-03-12 13:04:35 CST Last Seen 2021-03-12 13:04:35 CST Local ID b9d9cd96-e993-4e73-ade5-4f96d7922430 Raw Audit Messages type=AVC msg=audit(1615525475.881:111599): avc: denied { read } for pid=13639 comm="httpd" name="Avail" dev="sdb1" ino=129695745 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:unlabeled_t:s0 tclass=dir permissive=0 Hash: httpd,httpd_t,unlabeled_t,dir,read ``` Reference: [1] [5.6. SELINUX CONTEXTS – LABELING FILES](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security-enhanced_linux/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files) [2] [11.3. FIXING PROBLEMS](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-troubleshooting-fixing_problems) 189. docker-compose為什麼不能啟動?可能是因為尚未啟動docker服務 ``` sudo systemctl start docker ``` reference: [Start the Docker daemon](https://docs.docker.com/config/daemon/systemd/#start-the-docker-daemon) 190. # reminder 0. 沒有()才有event info! ``` @click="handleClick" (有event info) 和 @click="handleClick()" (無event info) 是不一樣的!!!! ``` 1. UUID產生的隨機碼有-,但是chs的arguments parser不能夠接受有-的字串。 2. vuetify btn 的dark和disabled不能並用,不然按鈕會消失。 [[Bug Report] v-btn disappears when dark prop and disabled prop used together #4682](https://github.com/vuetifyjs/vuetify/issues/4682) 3. tryAutoLogin的action要在router.beforeEach就先執行。原本寫在app.created裡面是不行的。因為router的順序會被先觸發,之後才是app.created。 [Vue、Vuex+Cookie 实现自动登陆 。](https://www.cnblogs.com/zhuwansu/p/9341494.html) 4. 為什麼不用v-autocomplete呢?因為v-autocomplete沒辦法新增自己想要的選項。例如: *, ? 如果事先做好各種*?的組合,清單會太多太長。 5. 提供表單時,如果都用選的,比較不會就被注入或亂填的風險。但是,如果讓人輸入的話,就一定要過濾。 一般會先把特殊符號全部濾掉,看要留下英文,數字,還是英數,中文。麻煩一點就是允許部分特殊符號,asterisk or ?。這邊指是單純過濾而已,還沒有驗證。 6. - 目前在IESWS用url的方式存取資料,指令送出後,是傳送到tecws1,由tecws1/var/www/html/IESWS/query/index.php進行處理。 雖然這種url取得資料的方式很方便,但會有資安的疑慮,因為帳號密碼需要一併輸入在url裡面,一旦封包被攔截,帳密就會外流。 因此,目前有個方案,是透過graphql作為api並且使用jtw作驗證,使用者在索取資料的時候,先用帳號密碼取得jtw key,然後使用這個jtw key去跟graphql要資料。 但是,這個方案就不能單純使用wget取得資料,要用curl或是寫script來取得。 - 沒有辦法用一個script切所有測站的波形資料,因為 -- 1.**測站撞名的問題,導致dataless不能夠合併** -- 2. 測站撞名的問題,**導致project必須要跟stations綁定**,才不會有抓到別的計劃底下的同名station的波形資料。e.g. 2014ILAN有E001,2008NSE也有E001。然後他們的net 都是TW,loc都是--。 -- 2.1 project必須要跟station綁定,在**傳遞參數時難以實作**。script不能儲存2維陣列。 -- 2.2 project必須要跟station綁定, api要怎麼傳遞參數? -- 3. 如果寫-proj 2014ILAN, 2009NSE -sta E001,E001這樣資料會各切2份出來,總共4份。 -- 4. 測站撞名的問題,就算是2個不同的計劃,**最後切出來的資料Sta.Net.Loc.Cha.Year.Jday全部一樣**? -- 5. **測站撞名,net又不止一個,project也不止一個。** -- 6. 這麼多選項要多選, projects, nets, stas, locs,chans, 5個多選,5個foreach, 這個效能!? -- 7. 如果要多選,那麼會需要知道所有資料,那在tecws2上面需要有5個文字檔紀錄我們有的projects, nets, stas, locs, chans。而且這份文件還會跟資料庫不同步,需要人維護。 -- 8. 好像不用一定要把project和sta綁在一起,找得到就有,找不到就沒有,就這樣而已。如果同名測站在同一個時間點位於同一個net,同一個loc,同一個chan,那本來就真的沒辦法處理。 - 重複呼叫同一個script1來切割不同計劃的資料, -- 1. 一樣還是需要再寫一個script2來使用script1 -- 2. 一樣還是會遇到參數傳遞的問題? -- 3. log檔的紀錄要如何設計? - 計劃 -- script只切1個project的資料 -- 外面用python去接收並切割不同project的station,再一個一個餵給script,最後在合併起來!? -- 可是平常資料都是放一起,遇到撞名就要分開放,還需要去檢查有沒有撞名,實在很難設計。 # **To do list** - [ ] 1. remove useless code - [ ] 2. zoom into the area after - [ ] 6. auto complete https://vuetifyjs.com/en/components/autocompletes/ 目前看到最接近我們需要的元件 但是規定的很死,不能打*或? https://vuetifyjs.com/en/components/combobox/#advanced-custom-options 可以用v-combobox達成 - [ ] 7. pop over - [ ] 10. json file output revise - [ ] 12. revise query.py - [ ] 15. connect to research gate? https://www.researchgate.net/profile/Po-Fei_Chen https://www.researchgate.net/profile/Yi_Ying_Wen https://www.researchgate.net/profile/Ruey-Juin_Rau https://www.researchgate.net/profile/Cheng_Horng_Lin https://www.researchgate.net/profile/Bor-Shouh_Huang https://www.researchgate.net/profile/Chau-Huei_Chen https://www.researchgate.net/profile/Chao-Shing_Lee https://www.researchgate.net/profile/Chien_Ying_Wang https://www.researchgate.net/profile/S_Lallemand - [ ] 17. 如何在graphql,只query特定編號的資料? Cuda says we sholud make some settings first - [ ] 19. make l-map a component which can be used in stations, projectDetail, and stationDetail - stations :map、marker、popup - projectDetail :map、marker、popup - stationDetail :map、marker、popup(X) - markers should be in the same color - stations and projectDetail use circle marker, but stationDetail use default marker - 索取資料的方式不同,資料的格式會不一樣 - popup是寫在popup裡面,只有2個地方要,一個地方不要,好像有點難控制 - stations和projectDetail的popup裡面要能夠連到stationDetail,但staionDetail不用這個popup - 不同project會有同名測站,所以網址應該要是 stationDetail/2014ILAN/E001 stationDetail/2009NSE/E001 而不是只有stationDetail/E001 - 地圖大小的控制也不盡相同 - 預設先寫好,其他要改再傳進來,用v-if判斷要不要啟用popup - zoom 一開始可以都8倍 - center stations要23其他就23.5 - mapOptions 一樣都0.5 - initMap 看起來只有stations需要 - class="map-container" 控制高度的,目前是stations需要 - :style="mapStyle" 控制高度的,看起來好像沒什麼用 - [ ] 20. add new tile - [ ] 22. how to set up a template for .vue component in vscode https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/757050/ vetur 好像可以做到,只是還沒研究好怎麼弄 - [ ] 23. 自動化排版 - [ ] 24. 寫作風格? - [ ] 26. stationDetail資訊 - project, name, description, lat, lon, elev, start time, end time - availability - channels, sensor, location, start time, end time - [ ] 28. 上拉載入,下拉重新整理 - [ ] 29. frontend validation - [ ] 33. rearrange data storage structure - it takes too long (8 sec) to find 2014ILAN with command ```=csh find . 2014ILAN ``` - [x] 要怎麼辨別哪個計劃的資料是放在哪年的資料夾裡面? 大部分的計劃都可以用開頭的年份辨別,可是那些開頭沒有年份的計劃該怎麼辦呢?像是TAIGER, TGOBS1, TGOBS2。 也是可以記錄在一份文件上面,不過要花額外動作維護就是了。 目前記錄在/open/project project_distribution.txt ```=csh project_distribution.txt ------------------------ 1998 Tarim 2003 2003NCKU 2008 2008NSE 2008 2008NSN 2008 2008NSS 2008 2008RATS 2008 2008TS 2009 2009NSE 2009 2009NSN 2009 2009NSS 2009 2009STTA 2009 2009TG 2010 2010ATSEE1 2010 2010ATSEE2 2010 2010ATSEE.shots 2011 2011SLIDE 2011 2011TX 2014 2014ILAN 2014 2014ITCH 2014 2014NCKU 2014 2014SEASHORE ------------------------ grep 2014ILAN project_distribution.txt | awk '{print $1}' >> 2014 grep Tarim project_distribution.txt | awk '{print $1}' >> 1998 ``` - [ ] 34. 版面太單調 - [ ] 35. cshell script 連線 db - [ ] 36. order log - [ ] 37. axios改apollo - [ ] 38. 把bootstrap 和 bootstrapVue 改成 Vuetify - [ ] 39. 閒置過久自動登出 - [ ] 40. 憑證到期自動登出 - [ ] 41. 憑證到期自動延長 **Questions:** - [ ] 1.how to download files through graphql mutation # Questions - 檔案的命名方式與目錄結構會(大)^n影響程式編寫。 - 測站撞名這件事情真的是很嚴重orz,這樣就沒有unique的欄位可以作辨別了。 - 到底需要哪些參數? -- [project] [station] [net] [location] [channel] [yyyy-mm-dd] [hh:mm:ss] [yyyy-mm-dd] [hh:mm:ss] [format] - 要怎麼做API? -- [RESTful Web API 設計指南- MIS 腳印](https://www.footmark.info/programming-language/design/restful-webapi-design-guide/) -- [RESTFul API 最佳實踐](https://yingclin.github.io/2017/RESTFul-API-Best-Practice.html) -- [API是什麼?認識 Web API、HTTP 和 JSON 資料交換格式](https://tw.alphacamp.co/blog/api-introduction-understand-web-api-http-json) -- 都只有概念,沒有實作orz - 要用shell還是python來處理資料? - 是要直接下載資料,還是要去訂單頁面? - 透過API索取資料可以做身份驗證嗎? - 做成API不就是要讓別人方便使用,還需要做身份驗證嗎?IRIS的web service就不用登入呀 - 測站名稱需要跟project綁在一起,那參數要怎麼傳遞? - 查詢時,空白表示全部,那空白要怎麼呼叫shell? - shell使用'*'會有問題,要怎麼實作wildcard? - 要怎麼跨機器呼叫shell? - 是要一次把所有參數傳給shell還是分開傳?一次傳所有參數會不會太長一串? - shell到底要寫成什麼樣?可以又能夠呼叫又是web api嗎?那要怎麼寫? - 我們的資料適合RESTful api設計嗎? - graphql與restful api有關係嗎? - c shell可以做api嗎? - python可以做api嗎? -- 好像要搭配flask -- 好像也可以搭配Django REST Framework - shell可以呼叫python。那python可以呼叫shell嗎?? - django跟flask可以並用嗎? - 在tecws2上面做web api是不是需要一個server處理http request? - api和一般吃-標籤的shell是可以並存的嗎?還是是兩件事情。還是可以用api去呼叫shell? - 因為不同project會有相同station,所以project和station是需要綁在一起的,如何寫參數? -- 或是如果假設不會有兩個計畫在同一個時間段裡面使用同樣的測站名稱,並用同一個channel,那其實不綁在一起也沒關係。也就是說,當測站名稱相同時,只要時間不重疊、net不相同、location不相同、channel不相同。不過時間、net、location、channel可能會一樣!? -- 或者是一個project就跑一次程式。不過這樣會不會跟api設計衝突? -- 所有計劃的所有測站要怎麼傳參數呢? - nets是不是需要多選?如果切的測站跨計劃,那麼nets不就需要多選 - gdms的dataless全部併成一份,所以可以用ALT_RESPONSE_FILE $dataless。但TAPs的dataless四散在各個project中。要怎麼用這個方式?不過只要一次處理一個project,好像就沒有這個問題。 - 但是,一次處理一個project,最後要如何把所有檔案壓縮起來? - TAPs可以把所有dataless整合成一份嗎?看起來不太行,因為dataless是用net.sta, yyyy,jday_00_00_00區別資料。可是(ILAN, E001), (2009NSE, E001)的net.sta都一樣。可能只有最後面不一樣。不知道rdseed在抓資料會不會有問題。 -- 實際運作:net.sta相同,但時間不同是可以區隔開來的。 -- 缺點: -- 1. 這樣的dataless很難維護。不同project的dataless混在一起,要更新,刪除都很困難。15個計劃,567個測站dataless全部混在一起。難以想像。 -- 2. dataless還不能一次全部剪貼,要一個一個剪貼... -- 3. 想一想這個方式實在不妥。如果兩個測站時間如果有重疊,rdseed是會去抓哪一個時間的dataless?如果抓錯dataless,這樣不OK。 ****-- 現在的情況相當於要一次切CWBSN和TSMIP底下的資料,而且他們還有同名的測站。然後net不止TW一個,然後dataless要混在一起。**** -- 結論: 還是一次切一個project比較實際。最後在把所有mseed cat起來或把所有SAC tar起來。 -- 世界網也會遇到同名測站,但他們會用net做區別。但我們是測站同名,然後net也相同,dataless無法區別。 - 如果分開切,再併起來,那log紀錄要怎麼設計?10個project要寫10次log? - bash, csh 不支援二維陣列,要怎麼儲存不同project各自的stations? - options如何寫? -- [Getopt example scripts](http://frodo.looijaard.name/project/getopt/misc/examples) - csh有沒有associative array? 沒有 -- [shell比較](https://hyperpolyglot.org/unix-shells) - 需要把不同計劃的測站變成一個字串,可以用什麼符號做連接?然後csh還要能夠parse。但是又不會違反url的規則,例如:+?%#/&=:@空格在url都有特別的意義,不能隨意使用,那還有什麼可以用? -- _ 底線好像ok唷。sta=a,b,c_d,e,f_g,h,i -- 不過dash - 更好! [why use - instead off _ in url](https://stackoverflow.com/questions/5362954/why-use-instead-off-in-url) - [ ] 使用python的subprocess可以呼叫.csh但無法傳遞參數? [Python, Subprocess and Multiple Arguments](https://blog.giladnaor.com/2009/09/python-subprocess-and-multiple.html) [Python 呼叫其他程式](https://medium.com/@alan81920/python-%E5%91%BC%E5%8F%AB%E5%85%B6%E4%BB%96%E7%A8%8B%E5%BC%8F-18a202c8b700) [Using the subprocess library: error: unrecognized arguments ](https://stackoverflow.com/questions/56740936/using-the-subprocess-library-error-unrecognized-arguments) - [ ] 指令錯誤 - xml.etree.ElementTree.ParseError: junk after document element: line 7, column 0 ```=python ``` - [ ] 在索取PZs or RESP時,是否要先將所取的名單與已知的net, sta, loc, cha進行比對,之後解開rdseed才不會做白工? > 先試試看直接處理好了,先不過濾。 - [ ] Unable to allocate memory for sac output data 不知道該怎麼解決 >**狀況分析**: 用rdseed5把mseed轉成sac時,如果結束時間大幅超過資料時間,轉檔就會失敗。例如:資料只有2008.107這天的00:00~07:00,但轉檔時輸入2008.107,00:00:00開始,2009,081,06:00:00結束,就會出現Err: Unable to allocate memory for sac output data. **目前方案**: mseed轉sac時,先不用輸入轉檔時間,因為前面用qmerge已經切好所需時間段的資料了。 - [ ] Error from chokidar https://www.footmark.info/programming-language/vuejs/vue-cli3-seting/ - [ ] GraphQL打不開,出現https error ``` [15/Dec/2020 16:47:52] code 400, message Bad request version ('o*Cd±\x02¶\x8bì§Iïf\x00"JJ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [15/Dec/2020 16:47:52] You're accessing the development server over HTTPS, but it only supports HTTP. ``` ### solved - [x] js控制小數點位數 [JavaScript 设置数字显示的小数位数](https://blog.csdn.net/sakenc/article/details/91612454) - [x] radio選到兩個該怎麼辦? 請共用同一個name - [x] 明明fix navbar為什麼會往上飄走?? 用了jumbotron jumbotron-fluid 要記得在下方加入<container> - [x] 如何控制font awesome icon size? ```= font-size ``` - [x] csh年份可以直接放在if裡面作比較嗎? 換成絕對秒數就可以比較了 - [x] 指令失敗 - Bad : modifier in $ ($). ```=csh incorrect: date +%s --date="$yr-$mon-$day $hr:$min:$sec" correct: date +%s --date="$yr-$mon-$day $hr":"$min":"$sec" 冒號需要用雙引號括起來才行 ``` - [x] getEvtWaveform怎樣會失敗? ```=csh [dmc@tecws2 revisions]$ getEvtWaveform_v1.0 -tb 2099-04-16T00:00:00 -te 2009-03-22T06:00:00 -proj 2008NSE,2009NSE -net TW -sta NSE01,E001 -loc -- -ch EHZ,EHN,EHE -fmt mseed -id 99999 -lab TEST projectYearDir : 2008 2008NSE : /open/project/2008/2008NSE/2008NSE.dataless projectYearDir : 2009 2009NSE : /open/project/2009/2009NSE/2009NSE.dataless /bin/cat: No match. /bin/rm: No match. 1. 輸入錯誤年份會導致cat 與 rm No match 2. 開始年份大於結束年份也沒有檢查到 >> 現在開始年份大於結束年份會留errMag ------------------------------------------------ getEvtWaveform_v1.0 -tb 2008-04-16T00:00:00 -te 2009-03-22T06:00:00 -proj 2008 -net TW -sta NSE01,E001 -loc -- -ch EHZ,EHN,EHE -fmt mseed -id 99999 -lab TEST set: Variable name must begin with a letter. 1. 輸入錯誤計劃會導致變數設定失敗 在query.py的階段 只要沒有符合的字串,就會跳出error,不會把錯誤的字串放入getEvtWaveform裡面。 if not pList: print(404) print(f'Projects: {projList} not available!') sys.exit(1) ``` - [x] How to clear the search value in the vuetify v-autocomplete? [javascript - 选择下拉项后,从vuetify v-autocomplete中清除键入的文本](https://www.coder.work/article/3941273) ## Technical debt - [ ] 4. stationtable sorting function - [ ] 8. mobile stationtable overflow bug fix - [ ] 11. request data btn setting URL Parameters to Pass Data Between Routes [Pass Data Between Routes In A Vue.js Web Application](https://www.thepolyglotdeveloper.com/2017/11/pass-data-between-routes-vuejs-web-application/) > I cannot do it in this way because * and ? is invalid in url. > Besides, we have abundant data parameters, which will exceed the url limitation. - [ ] 21. enable search function on the navbar - [ ] 25. 修正navbar的使用方式,避免每個下方的頁面都要用absolute來固定以及component都要加上relative - [ ] 27. move to geological boundary to draw - [ ] 28. 打開選單的時候,按上一頁,選單不會自己收起來 ### solved - [x] 27. 換頁時時回到最上面 ```=vue scrollBehavior(to, from, savedPosition){ if (to.hash){ return {selector: to.hash} } return {x:0, y:0} } ``` - [x] 3. radio btn reset use form check in bootstrap. Besides, remember to give those radio btns a same name # LOG ## Jan. 15, 2021 1. apolloClient -> axios ## Jan. 14, 2021 1. axios -> axios-auth ## Jan. 13, 2021 1. Time range search panel in project page 2. Waveform online plotting ## Jan. 12, 2021 1. Add data request sidebar 2. Form validation(start time and end time) ## Jan. 11, 2021 1. Enable gzip 2. Change date pick implement method from flatpickr to vuetify v-date-picker + date-fns. In this way, we can have better consistency. ## Dec. 28, 2020 1. Implement autoLogin and autoLogout. 2. Add response request in date request page. 3. rename dashboard to my account, order to request history ## Dec. 24, 2020 1. Show dialog and go to my orders after submitting the request form. 2. Make download url. ## Dec. 23, 2020 1. Move default label naming process from query.py to schema.py. In this way, we can record the correct label name in the database. 2. Update backend/model.py. a. Add Order and Customuser model. In this way, we can query order data from graphql(base on auth). b. Rewrite order_detail in order to fit json format. c. Remove token from arguments in DataRequestMutation because we should write token in the headers. 3. Add axios-auth.js to send post with jwt token in the headers. 4. Set up order and orderDetail page. (get data from DB) 5. Protect order and orderDetail page with router guard. 6. Move order link to dashboard page. ## Dec. 22, 2020 1. 重灌amazon,從CentOS8改回CentOS7 ## Dec. 18, 2020 1. 移除檔案索取過程中,schema.py把wildcard轉成all,而query.py再把all轉成wildcard的多餘步驟。 2. 預計從mutation移除token,因為token要寫在headers裡面。 3. 有jwt token的會員才能夠索取資料。 4. 2014ILAN的Affiliation從NCKU改NCU; 2008RATS的Affiliation從FR改Montpellier University; LALLEMAND Serge改Serge LALLEMAND 5. 凱勳來訪,他明天要去布朗大學當地震博士後。 ## Dec. 17, 2020 1. 原本是用token來建立資料夾的名字,現在改為用uuid來建立資料夾的名字 2. 目前order_Id有傳入query.py,不過尚未使用,之後要把資訊寫入DB時,會需要用這個ID來查詢訂單。 3. query.py 和 getEvtWaveform.csh所需要的環境變數,寫在.TAPsDB.env裡面。不放在source ~/Downloads/script/revisions/TAPs.cshrc了 4. 建立Order的model 5. 把最新的資料庫轉移到tecdb/cook。 ## Dec. 16, 2020 1. implement file download function in backend/fileResponse.py ## Dec. 15, 2020 1. add veutify settings in /bulid/webpack.base.conf.js and /src/plugins/vuetify.js 2. alert an error to remind user (UserAttributeSimilarityValidator, MinimumLengthValidator, CommonPasswordValidator, NumericPasswordValidator) ## Dec. 3, 2020 1. revise output file's name in getEvtWaveform.csh & getContWaveform.csh ## Dec. 2, 2020 1. 安裝qmerge, rdseed, rdseed5到production機器上。 ## Nov. 30, 2020 1. header renaming | projects -> project | stations -> station (router.js and Header.vue revised) 2. component renaming | Tws.vue -> Stations.vue ## Nov. 24, 2020 - improve the ability to display stations on a map 1. auto adjust map boundary according to the matched stations. 2. display stations on the project detail page more precisely. 3. ref: map.fitBounds() https://leafletjs.com/reference-1.7.1.html#latlngbounds - **Goal**: 1. 為了部署新網站,需要安裝Apache2.4, docker, Django3.0, Vuejs2.0。 - **Constraint**: 1. taps機器的系統版本(SL6.9 + Linux kernal 2.6.32)不足以裝Apache2.4, docker。 2. **發佈通知-維護並暫停服務**。但是,taps機器上有兩個硬碟是其他機器(TEC Antelope)在使用,如果要重灌taps機器版本,必須要先通知有使用TEC antelope的單位,如: 中正溫士忠老師的團隊,等等。告知他們我們的機器要維護,有幾天不能夠提供服務,要請他們先把正在跑的程式告一個段落。 3. **預約機房時間**。然後我們還需要跟青霖約機房可以作業的時間,才能夠施工。要先unmount這兩顆硬碟,並且準備好要灌的系統檔,灌好之後,首先要把這兩顆硬碟再裝回去,然後再mount上去。 4. **硬碟連線的卸載與安裝設定**。但是!青霖表示這兩顆硬碟的連接方式很特別,屬於*iscsi連線*,要unmount跟mount上去,需要額外的時間進行設定。 5. **青霖有空的時間**。並且12/2(三)的行程已經排滿了,需要再額外約時間。 - **Plan**: 1. 所以我們希望可以升級機器的版本,改成centos8。這樣才能夠安裝Apache2.4及docker。 - **Idea**: 1. 是否有必要一定要升級版本呢? ## Nov. 23, 2020 - 因為使用了vuetify.css 所以要對原本的設定做修正 ## Nov. 16, 2020 - 用vuetify來做autocomplete ## Nov. 13, 2020 implement autocomplete function, but it does not work very well. we can on scroll on the y axis ## Nov. 11, 2020 - [x] 1. revise name from Format to Output format ## Nov. 4, 2020 - [x] 1. create getContWavefrom ## Nov. 3, 2020 - [x] 1. 輸入的資訊有錯(ex: 沒有這個計劃, 觀測網, 測站, 位置, 分量)都是在query.py給予反饋。getEvtWaveform就只是用來切波形而已。頂多給完成的下載位置,失敗就給404。 - [x] 2. 建立初步curl時使用的csh script ## Nov. 2, 2020 - [x] 1. revise TAPs/backend/schema.py - [x] 2. revise TAPs/backend/query.py ```=graphql mutation{ dataRequestMutation( format: "mseed", tb: "2008-04-16T00:00:00", te: "2009-03-22T06:00:00", proj: "2008NSE,2009NSE", net: "TW", sta: "NSE01,E001", loc: "*", cha: "EH?", label: "20201023080000", token: "eyJh" ) { statusCode text downloadUrl } } ``` ## Oct. 30, 2020 - [x] 1. add Home page picture & services introduction - [x] 2. add footer.vue - [x] 3. replace position absolute setting in each pages with margin-top 56px. ## Oct. 29, 2020 - [x] 1. scroll from the top when changing pages. - [x] 2. db change affiliation FR to Montpellier University. - [x] 3. lat and lon round to 5 decimal place. - [x] 4. project sorted function. - 看起來排序年份可能影響較小,js的sort在不同瀏覽器的實作都不一樣 - [參考購物網站的篩選功能](http://demo.joomshaper.com/?template=arino) - [[JavaScript] 從 Array 的 sort 方法,聊到各瀏覽器的實作,沒想到 Chrome 和FireFox 的排序如此不同](https://medium.com/@realdennis/javascript-%E5%BE%9Earray%E7%9A%84sort%E6%96%B9%E6%B3%95-%E8%81%8A%E5%88%B0%E5%90%84%E5%AE%B6%E7%80%8F%E8%A6%BD%E5%99%A8%E7%9A%84%E5%AF%A6%E4%BD%9C%E7%AE%97%E6%B3%95-c23a335b1b80) - [x] 5. revise radio btn from <form-group> to <form-check>. Therefore, reset radio btn works now. - [x] 6. fix update btn on the top ## Oct. 15, 2020 ```graphql= query{ allStationlocation{ id stationId{ name projectId{ name } netId{ name } latitude longitude elevation } ondate offdate channels{ name } locationId{ name } } } ``` ## Oct. 13, 2020 - update stations in website ## Oct. 6, 2020 - 原本是讓shell去讀txt來索取資料,後來跟文蕙討論後,覺得不要再寫txt讓shell去讀,直接把參數餵給shell比較方便。 - shell最好是可以寫標籤 ## Sep. 30, 2020 - debug Django query on graphql. - [Django Debug Middleware - Graphene-Python](https://docs.graphene-python.org/projects/django/en/latest/debug/) ```graphql= query{ allStationlocation{ id stationId{ name projectId{ name } netId{ name } latitude longitude elevation } ondate offdate channels{ name } } _debug { sql { rawSql } } } ``` ## Sep. 29, 2020 - update graphql schema.py with fundamental tables. - update graphql in backend/ schema.py, models.py with ManytoManyfield. - search station info on graphql - http://127.0.0.1:8000/graphql ```graphql= query{ allStationlocation{ id stationId{ name projectId{ name } netId{ name } latitude longitude elevation } ondate offdate channels{ name } } } ```