Mercurial > code > home > repos > reposync
annotate index.html @ 6:a0d9679c4f4a
loginbar element moves out
author | drewp@bigasterisk.com |
---|---|
date | Fri, 24 Jul 2020 15:22:06 -0700 |
parents | f714a6a7842c |
children | 6f38aa08408d |
rev | line source |
---|---|
4
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
1 <!DOCTYPE html> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
2 <html> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
3 <head> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
4 <meta charset="utf8" /> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
5 <meta name="viewport" content="width=device-width, initial-scale=1" /> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
6 <title>reposync</title> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
7 <style> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
8 body { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
9 background: #1f1f1f; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
10 color: white; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
11 font-family: monospace; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
12 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
13 th { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
14 text-align: left; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
15 white-space: nowrap; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
16 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
17 td.github { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
18 white-space: nowrap; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
19 opacity: 0.5; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
20 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
21 td.github.on { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
22 opacity: 1; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
23 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
24 span.check { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
25 font-size: 200%; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
26 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
27 </style> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
28 </head> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
29 <body> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
30 <h1>repo statuses</h1> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
31 |
6 | 32 <script type="module" src="/loginBar.js"> |
4
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
33 </script> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
34 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
35 <script type="module"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
36 import Litedom from "https://bigasterisk.com/lib/litedom/0.12.1/litedom.es.js"; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
37 const repos = [{ dir: "dir1", summary: "ok" }]; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
38 Litedom({ |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
39 tagName: "reposync-top", |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
40 template: `<div id="top"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
41 <table> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
42 <tr :for="repo in this.repos"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
43 <th>{repo.path}</th> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
44 <td> {repo.status.error || ''} |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
45 <span :if="repo.status.changed==0 && repo.status.unknown==0"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
46 clean |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
47 </span> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
48 <span :else> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
49 changed {repo.status.changed}, unknown {repo.status.unknown} |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
50 </span> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
51 </td> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
52 <td :class="github: true; on: repo.github"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
53 <span class="check" :if="repo.github">☑</span> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
54 <span class="check" :else>☐</span> github |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
55 <span :if="repo.github"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
56 <table style="display: inline-block"> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
57 <tr><td>github latest</td><td>{repo.githubLatest.t}</td></tr> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
58 <tr><td>home latest</td><td>{repo.hgLatest.t}</td></tr> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
59 </table> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
60 </span> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
61 </td> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
62 </tr> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
63 </table> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
64 </div>`, |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
65 data: { repos: [] }, |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
66 created() { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
67 const statuses = new EventSource("status/events"); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
68 statuses.addEventListener("message", (ev) => { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
69 const update = JSON.parse(ev.data); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
70 update.update.repoDir = update.key; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
71 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
72 var found = false; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
73 this.data.repos.forEach((r) => { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
74 if (r.repoDir == update.key) { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
75 found = true; |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
76 Object.assign(r, update.update); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
77 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
78 }); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
79 if (!found) { |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
80 this.data.repos.push(update.update); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
81 this.data.repos.sort((a, b) => (a.repoDir > b.repoDir ? 1 : -1)); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
82 } |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
83 }); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
84 }, |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
85 }); |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
86 </script> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
87 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
88 <reposync-top></reposync-top> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
89 <bigast-loginbar></bigast-loginbar> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
90 <pre> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
91 repo1 clean synced to github github up to date [sync now] |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
92 dirty [msg____] [commit] |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
93 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
94 repo1 is a link to my hgserve |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
95 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
96 GET /status/events |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
97 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
98 GET /recent?repo=/my/dir |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
99 GET /recent?all |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
100 GET /recent/events?repo=/my/dir|all |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
101 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
102 POST /githubSync?all |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
103 POST /githubSync?repo=/my/dir |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
104 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
105 GET /homepage -> a CE table of all changes using /recent |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
106 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
107 each event are a json message: |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
108 key: string |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
109 update: replace the data for that key |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
110 Here, keys are repo paths. |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
111 |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
112 </pre> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
113 </body> |
f714a6a7842c
start new web view for hgand github syncing
drewp@bigasterisk.com
parents:
diff
changeset
|
114 </html> |