Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Weather Data</title>
  4. <style>
  5. td {
  6. width: 40px;
  7. height: 40px;
  8. border: 1px solid black;
  9. }
  10. table {
  11. border: 1px solid black;
  12. border-spacing: 0;
  13. }
  14. </style>
  15. <script type = 'module'>
  16. import model from './model.js'
  17. import store from './store.js'
  18. import view from './view.js'
  19. import dispatcher from './dispatcher.js'
  20.  
  21. window.init = async function init() {
  22. try {
  23. const data_res = await fetch('http://localhost:8080/data')
  24. const data = await data_res.json()
  25. const prediction = await fetch('http://localhost:8080/forecast').then(res => res.json())
  26. const modelData = model(data, employees)
  27. const modelPrediction = model(data, employees)
  28. let theDispatcher
  29. const { view: theView, renderer } = view(window, () => theDispatcher)
  30. const theStore = store(theModel, theView, renderer)
  31. theDispatcher = dispatcher(theStore)
  32. renderer(theView(theModel))
  33. } catch (err) {
  34. console.log(err)
  35. }
  36. }
  37. </script>
  38. </head>
  39. <body onload="init()">
  40. <div id='base'>
  41. <h1>Weather Data</h1>
  42. <table id='employees'>
  43. <thead><tr><td>Id</td><td>Name</td><td>Employee id</td><td>Salary</td><td>Manager</td></tr></thead>
  44. <tbody id='employee_data'></tbody>
  45. </table>
  46. </div>
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement