OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html i18n-values="dir:textdirection;"> | 2 <html i18n-values="dir:textdirection;"> |
3 <head> | 3 <head> |
4 <!-- If you change the title, make sure you also update | 4 <!-- If you change the title, make sure you also update |
5 chrome/test/functional/special_tabs.py. --> | 5 chrome/test/functional/special_tabs.py. --> |
6 <title>Sync Internals</title> | 6 <title>Sync Internals</title> |
7 <script> | 7 <script src="chrome_sync.js"></script> |
8 function onLoad() { | 8 <!-- Used by about.html. --> |
9 chrome.send('getAboutInfo'); | 9 <link rel="stylesheet" href="about.css" /> |
10 chrome.send('getNotificationState'); | |
11 chrome.send('getRootNode'); | |
12 } | |
13 | |
14 function onGetAboutInfoFinished(aboutInfo) { | |
15 var aboutInfoDiv = document.getElementById('aboutInfo'); | |
16 jstProcess(new JsEvalContext(aboutInfo), aboutInfoDiv); | |
17 } | |
18 | |
19 function onGetNotificationStateFinished(notificationsEnabled) { | |
20 onSyncNotificationStateChange(notificationsEnabled); | |
21 } | |
22 | |
23 function onGetRootNodeFinished(rootNodeInfo) { | |
24 onGetNodeByIdFinished(rootNodeInfo); | |
25 } | |
26 | |
27 function onGetNodeByIdFinished(nodeInfo) { | |
28 var nodeBrowser = document.getElementById('nodeBrowser'); | |
29 nodeInfo.specifics = JSON.stringify(nodeInfo.specifics); | |
30 jstProcess(new JsEvalContext(nodeInfo), nodeBrowser); | |
31 } | |
32 | |
33 function processNodeLink(link) { | |
34 var id = link.text; | |
35 chrome.send('getNodeById', [id]); | |
36 } | |
37 | |
38 function onSyncServiceStateChanged() { | |
39 chrome.send('getAboutInfo'); | |
40 } | |
41 | |
42 function onSyncNotificationStateChange(notificationsEnabled) { | |
43 var notificationsEnabledInfo = | |
44 document.getElementById('notificationsEnabledInfo'); | |
45 jstProcess( | |
46 new JsEvalContext({ 'notificationsEnabled': notificationsEnabled }), | |
47 notificationsEnabledInfo); | |
48 } | |
49 | |
50 var notificationCounts = {}; | |
51 | |
52 function onSyncIncomingNotification(changedTypes) { | |
53 for (var i = 0; i < changedTypes.length; ++i) { | |
54 var changedType = changedTypes[i]; | |
55 notificationCounts[changedType] = notificationCounts[changedType] || 0; | |
56 ++notificationCounts[changedType]; | |
57 } | |
58 | |
59 var infos = []; | |
60 for (var k in notificationCounts) { | |
61 var info = { 'modelType': k, 'notificationCount': notificationCounts[k] }; | |
62 infos.push(info); | |
63 } | |
64 | |
65 var notificationCountsInfo = | |
66 document.getElementById('notificationCountsInfo'); | |
67 jstProcess(new JsEvalContext({ 'notificationCounts': infos }), | |
68 notificationCountsInfo); | |
69 } | |
70 | |
71 // TODO(akalin): Do something with these notifications. | |
72 | |
73 function onChangesApplied(modelType, changes) { | |
74 console.log('onChangesApplied: ' + modelType + ': ' + JSON.stringify(changes))
; | |
75 } | |
76 | |
77 function onChangesComplete(modelType) { | |
78 console.log('onChangesComplete: ' + modelType); | |
79 } | |
80 | |
81 function onSyncCycleCompleted(snapshot) { | |
82 console.log('onSyncCycleCompleted: ' + JSON.stringify(snapshot)); | |
83 } | |
84 | |
85 function onAuthError(authError) { | |
86 console.log('onAuthError: ' + JSON.stringify(authError)); | |
87 } | |
88 | |
89 function onUpdatedToken(token) { | |
90 console.log('onUpdatedToken: ' + token); | |
91 } | |
92 | |
93 function onPassphraseRequired(forDecryption) { | |
94 console.log('onPassphraseRequired: ' + forDecryption); | |
95 } | |
96 | |
97 function onPassphraseAccepted(bootstrapToken) { | |
98 console.log('onPassphraseAccepted: ' + bootstrapToken); | |
99 } | |
100 | |
101 function onInitializationComplete() { | |
102 console.log('onInitializationComplete'); | |
103 } | |
104 | |
105 function onPaused() { | |
106 console.log('onPaused'); | |
107 } | |
108 | |
109 function onResumed() { | |
110 console.log('onResumed'); | |
111 } | |
112 | |
113 function onStopSyncingPermanently() { | |
114 console.log('onStopSyncingPermanently'); | |
115 } | |
116 | |
117 function onClearServerDataSucceeded() { | |
118 console.log('onClearServerDataSucceeded'); | |
119 } | |
120 | |
121 function onClearServerDataFailed() { | |
122 console.log('onClearServerDataFailed'); | |
123 } | |
124 </script> | |
125 | |
126 <style type="text/css"> | |
127 body { | |
128 padding: 0.75em; | |
129 margin: 0; | |
130 min-width: 45em; | |
131 } | |
132 | |
133 h1 { | |
134 font-size: 110%; | |
135 font-weight: bold; | |
136 color: #4a8ee6; | |
137 letter-spacing: -1px; | |
138 padding: 0; | |
139 margin: 0; | |
140 } | |
141 h2 { | |
142 font-size: 110%; | |
143 letter-spacing: -1px; | |
144 font-weight: normal; | |
145 color: #4a8ee6; | |
146 padding: 0; | |
147 margin: 0; | |
148 padding: 0.5em 1em; | |
149 color: #3a75bd; | |
150 margin-left: -38px; | |
151 padding-left: 38px; | |
152 | |
153 border-top: 1px solid #3a75bd; | |
154 padding-top: 0.5em; | |
155 | |
156 } | |
157 h2:first-child { | |
158 border-top: 0; | |
159 padding-top: 0; | |
160 } | |
161 | |
162 div#header { | |
163 padding: 0.75em 1em; | |
164 padding-top: 0.6em; | |
165 padding-left: 0; | |
166 margin-bottom: 0.75em; | |
167 position: relative; | |
168 overflow: hidden; | |
169 background: #5296de; | |
170 background-size: 100%; | |
171 border: 1px solid #3a75bd; | |
172 border-radius: 6px; | |
173 color: white; | |
174 text-shadow: 0 0 2px black; | |
175 } | |
176 div#header h1 { | |
177 padding-left: 37px; | |
178 margin: 0; | |
179 display: inline; | |
180 background: url('../../resources/shared/images/gear.png') 12px 60% no-repeat; | |
181 color: white; | |
182 } | |
183 | |
184 .err { | |
185 color: red; | |
186 } | |
187 | |
188 div#header p { | |
189 font-style: italic; | |
190 padding: 0; | |
191 margin: 0; | |
192 color: white; | |
193 padding-left: 0.4em; | |
194 display: inline; | |
195 } | |
196 | |
197 table.list { | |
198 line-height: 200%; | |
199 border-collapse: collapse; | |
200 table-layout: fixed; | |
201 } | |
202 table.list:not([class*='filtered']) tr:nth-child(odd) td { | |
203 background: #eff3ff; | |
204 } | |
205 table.list#details2 tr:nth-child(odd) td { | |
206 background: #ccffcc | |
207 } | |
208 | |
209 table.list td { | |
210 padding: 0 0.5em; | |
211 vertical-align: top; | |
212 line-height: 1.4em; | |
213 padding-top: 0.35em; | |
214 } | |
215 table.list tr td:nth-last-child(1), | |
216 table.list tr th:nth-last-child(1) { | |
217 padding-right: 1em; | |
218 } | |
219 table.list:not([class*='filtered']) .tab .name { | |
220 padding-left: 1.5em; | |
221 } | |
222 | |
223 table.list .name { | |
224 } | |
225 | |
226 table.list .name div { | |
227 height: 1.6em; | |
228 overflow: hidden; | |
229 white-space: nowrap; | |
230 text-overflow: ellipsis; | |
231 } | |
232 | |
233 table.list .number { | |
234 width: 7em; | |
235 text-align: right; | |
236 } | |
237 | |
238 table.list tr:not([class*='firstRow']) > *:nth-child(1), | |
239 table.list tr:not([class*='firstRow']) > *:nth-child(4), | |
240 table.list tr.firstRow th:nth-child(1), | |
241 table.list tr.firstRow th:nth-child(2) { | |
242 border-right: 1px solid #b5c6de; | |
243 } | |
244 table.list#details .name { | |
245 padding-left: 25px; | |
246 background-position: 5px center; | |
247 background-repeat: no-repeat; | |
248 } | |
249 </style> | |
250 | |
251 </head> | 10 </head> |
252 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize" | 11 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> |
253 onload="onLoad()"> | 12 <include src="about.html" /> |
254 | 13 <include src="notifications.html" /> |
255 <div id='aboutInfo'> | 14 <include src="sync_node_browser.html" /> |
256 <div id='header'> | 15 <include src="sync_events.html" /> |
257 <h1>Sync Internals</h1> | |
258 <p> Sync engine diagnostic data</p> | |
259 </div> | |
260 <div id='content'> | |
261 <table width="100%"> | |
262 <tr> | |
263 <td width="20%"> | |
264 <span class="desc"><h2> Summary </h2></span> | |
265 <strong jscontent="summary"></strong> | |
266 </td> | |
267 <td> | |
268 <div class="desc" jsdisplay="unrecoverable_error_detected"> | |
269 <span class="err">Unrecoverable Error Detected!</span> | |
270 <div jscontent="unrecoverable_error_message"></div> | |
271 <div jscontent="unrecoverable_error_location"></div> | |
272 </div> | |
273 </td> | |
274 </tr> | |
275 <tr> | |
276 <td colspan="2"> | |
277 <span class="desc"><h2> Sync URL </h2></span> | |
278 <strong jscontent="service_url"></strong> | |
279 </td> | |
280 </tr> | |
281 </table> | |
282 <br /><br /><br /> | |
283 <h2> </h2> | |
284 <table> | |
285 <tr> | |
286 <td> | |
287 <div class="desc"><h2> Details </h2></div> | |
288 <table class='list' id='details'> | |
289 <tr> | |
290 <td class='name'> Authenticated </td> | |
291 <td class='number'> | |
292 <div jscontent="authenticated"> </div> | |
293 <div jsdisplay="!authenticated" | |
294 style="color:red" | |
295 jscontent="auth_problem"></div> | |
296 </td> | |
297 </tr> | |
298 </tr> | |
299 <tr> | |
300 <td class='name'>Last Synced</td> | |
301 <td class='number' jscontent="time_since_sync"> </td> | |
302 </tr> | |
303 <tr jsselect="details"> | |
304 <td class='name'> | |
305 <div jscontent="stat_name"></div> | |
306 </td> | |
307 <td class='number'> | |
308 <div jscontent="stat_value"></div> | |
309 </td> | |
310 </tr> | |
311 </table> | |
312 </td> | |
313 <td valign="top"> | |
314 <div class="desc"><h2> Routing Info </h2></div> | |
315 <table class='list' id='details2'> | |
316 <tr jsselect="routing_info"> | |
317 <td class ='name'> | |
318 <div jscontent="model_type"></div> | |
319 </td> | |
320 <td class='number'> | |
321 <div jscontent="group"></div> | |
322 </td> | |
323 </tr> | |
324 </table> | |
325 </td> | |
326 </table> | |
327 </div> | |
328 </div> | |
329 | |
330 <div class="desc"><h2> Notifications </h2></div> | |
331 <p id='notificationsEnabledInfo'> | |
332 Enabled: <span jscontent='notificationsEnabled'></span> | |
333 </p> | |
334 | |
335 <table class='list' id='notificationCountsInfo'> | |
336 <tr jsselect='notificationCounts'> | |
337 <td class='name'> | |
338 <div jscontent='modelType'></div> | |
339 </td> | |
340 <td class='number'> | |
341 <div jscontent='notificationCount'></div> | |
342 </td> | |
343 </tr> | |
344 </table> | |
345 </td> | |
346 | |
347 <div class="desc"><h2> Node Browser </h2></div> | |
348 <ul id='nodeBrowser'> | |
349 <li>ID: <span jscontent='id'></span></li> | |
350 <li>Modification Time: <span jscontent='modificationTime'></span></li> | |
351 <li>Parent: <a jscontent='parentId' href="#" onclick="processNodeLink(this); ret
urn false"></a></li> | |
352 <li>Is Folder: <span jscontent='isFolder'></span></li> | |
353 <li>Title: <span jscontent='title'></span></li> | |
354 <li>Type: <span jscontent='type'></span></li> | |
355 <li>Specifics: <span jscontent='specifics'></span></li> | |
356 <li>External ID: <span jscontent='externalId'></span></li> | |
357 <li>Predecessor: <a jscontent='predecessorId' href="#" onclick="processNodeLink(
this); return false"></a></li> | |
358 <li>Successor: <a jscontent='successorId' href="#" onclick="processNodeLink(this
); return false"></a></li> | |
359 <li>First Child: <a jscontent='firstChildId' href="#" onclick="processNodeLink(t
his); return false"></a></li> | |
360 </ul> | |
361 | |
362 </body> | 16 </body> |
363 </html> | 17 </html> |
OLD | NEW |