自動更新文字檔內容

Table of contents

背景

  • 程式在背景執行,一直猛按瀏覽器的重現更新鍵,來更新最新的輸出結果,這樣也不是個辦法,應該有更聰明的html來做這事吧?!
    • 自動更新可以用meta tag更新 ,不必自己點按。
    • 讀文字檔案可以用object連到指定的文字檔即可

html

isc3/aermod

  • 只需更新文字檔案的目錄(/isc_results/isc3_ RAND /log.out)即可
<!DOCTYPE html>
<html>
  
<head>
    <title>isc3/aermod progress</title>
    <meta http-equiv="refresh" content="10">
</head>
  
<body>
    <h2>Welcome To ISC3/AERMOD Remote Center</h2>
    <p>The log will reload after 10s.</p>
    <object height=300 width=950 type='text/plain' border=0 data=/isc_results/isc3_RAND/log.out></object>
</body>
  
</html>

CALPUFF

root@114-32-164-198 /Library/WebServer/Documents/cpuff_results/demo
# cat autorefresh.html 
<!DOCTYPE html>
<html>
  
<head>
    <title>cpuff progress</title>
    <meta http-equiv="refresh" content="10">
</head>
  
<body>
    <h2>Welcome To CALPUFF Remote Center</h2>
    <p>The log will reload after 10s.</p>
    <object height=300 width=950 type='text/plain' border=0 data=/cpuff_results/cpuf_RAND/cpuff.out></object>
</body>
  
</html>