OLD | NEW |
---|---|
1 <link rel="import" href="../../../../packages/polymer/polymer.html"> | 1 <link rel="import" href="../../../../packages/polymer/polymer.html"> |
2 <link rel="import" href="action_link.html"> | 2 <link rel="import" href="action_link.html"> |
3 <link rel="import" href="observatory_element.html"> | 3 <link rel="import" href="observatory_element.html"> |
4 | 4 |
5 <polymer-element name="nav-bar" extends="observatory-element"> | 5 <polymer-element name="nav-bar" extends="observatory-element"> |
6 <template> | 6 <template> |
7 <link rel="stylesheet" href="css/shared.css"> | 7 <link rel="stylesheet" href="css/shared.css"> |
8 <style> | 8 <style> |
9 nav { | 9 nav { |
10 position: fixed; | 10 position: fixed; |
(...skipping 15 matching lines...) Expand all Loading... | |
26 nav ul:after { | 26 nav ul:after { |
27 content: ""; clear: both; display: block; | 27 content: ""; clear: both; display: block; |
28 } | 28 } |
29 .vertical-spacer { | 29 .vertical-spacer { |
30 height: 40px; | 30 height: 40px; |
31 background-color: #0489c3; | 31 background-color: #0489c3; |
32 } | 32 } |
33 </style> | 33 </style> |
34 <nav> | 34 <nav> |
35 <ul> | 35 <ul> |
36 <template if="{{ showNotify }}"> | 36 <nav-notify notifications="{{ app.notifications }}" |
37 <nav-notify events="{{ app.notifications }}"></nav-notify> | 37 notifyOnPause="{{ notifyOnPause }}"></nav-notify> |
38 </template> | |
39 <content></content> | 38 <content></content> |
40 </ul> | 39 </ul> |
41 </nav> | 40 </nav> |
42 <div class="vertical-spacer"> | 41 <div class="vertical-spacer"> |
43 </div> | 42 </div> |
44 <template if="{{ pad }}"> | 43 <template if="{{ pad }}"> |
45 <br> | 44 <br> |
46 </template> | 45 </template> |
47 </template> | 46 </template> |
48 </polymer-element> | 47 </polymer-element> |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 width: auto; | 238 width: auto; |
240 z-index: 1000; | 239 z-index: 1000; |
241 font: 400 12px 'Montserrat', sans-serif; | 240 font: 400 12px 'Montserrat', sans-serif; |
242 color: white; | 241 color: white; |
243 background: none; | 242 background: none; |
244 } | 243 } |
245 </style> | 244 </style> |
246 | 245 |
247 <div class="menu"> | 246 <div class="menu"> |
248 <div class="list"> | 247 <div class="list"> |
249 <template repeat="{{ event in events }}"> | 248 <template repeat="{{ notification in notifications }}"> |
250 <nav-notify-item events="{{ events }}" event="{{ event }}"> | 249 <template if="{{ notification.event != null }}"> |
251 </nav-notify-item> | 250 <nav-notify-event notifications="{{ notifications }}" |
251 notification="{{ notification }}" | |
252 event="{{ notification.event }}" | |
253 notifyOnPause="{{ notifyOnPause }}"> | |
254 </nav-notify-event> | |
255 </template> | |
256 <template if="{{ notification.exception != null }}"> | |
257 <nav-notify-exception notifications="{{ notifications }}" | |
258 notification="{{ notification }}" | |
259 exception="{{ notification.exception }}" | |
260 stacktrace="{{ notification.stacktrace }}"> | |
261 </nav-notify-exception> | |
262 </template> | |
252 </template> | 263 </template> |
253 </div> | 264 </div> |
254 </div> | 265 </div> |
255 </template> | 266 </template> |
256 </polymer-element> | 267 </polymer-element> |
257 | 268 |
258 <polymer-element name="nav-notify-item" extends="observatory-element"> | 269 <polymer-element name="nav-notify-event" extends="observatory-element"> |
259 <template> | 270 <template> |
260 <style> | 271 <style> |
261 .item { | 272 .item { |
262 position: relative; | 273 position: relative; |
263 padding: 16px; | 274 padding: 16px; |
264 margin-top: 10px; | 275 margin-top: 10px; |
265 margin-right: 10px; | 276 margin-right: 10px; |
266 padding-right: 25px; | 277 padding-right: 25px; |
267 width: 225px; | 278 width: 250px; |
268 color: #ddd; | 279 color: #ddd; |
269 background: rgba(0,0,0,.6); | 280 background: rgba(0,0,0,.6); |
270 border: solid 2px white; | 281 border: solid 2px white; |
271 box-shadow: 0 0 5px black; | 282 box-shadow: 0 0 5px black; |
272 border-radius: 5px; | 283 border-radius: 5px; |
273 animation: fadein 1s; | 284 animation: fadein 1s; |
274 } | 285 } |
275 | 286 |
276 @keyframes fadein { | 287 @keyframes fadein { |
277 from { opacity: 0; } | 288 from { opacity: 0; } |
(...skipping 19 matching lines...) Expand all Loading... | |
297 border-radius: 9px; | 308 border-radius: 9px; |
298 color: white; | 309 color: white; |
299 font-size: 18px; | 310 font-size: 18px; |
300 cursor: pointer; | 311 cursor: pointer; |
301 text-align: center; | 312 text-align: center; |
302 } | 313 } |
303 a.boxclose:hover { | 314 a.boxclose:hover { |
304 background: rgba(255,255,255,0.5); | 315 background: rgba(255,255,255,0.5); |
305 } | 316 } |
306 </style> | 317 </style> |
307 <template if="{{ event.eventType == 'IsolateInterrupted' || | 318 <template if="{{ event != null }}"> |
308 event.eventType == 'BreakpointReached' || | 319 <template if="{{ notifyOnPause && |
309 event.eventType == 'ExceptionThrown' }}"> | 320 (event.eventType == 'PauseStart' || |
310 <div class="item"> | 321 event.eventType == 'PauseExit' || |
311 Isolate | 322 event.eventType == 'PauseBreakpoint' || |
312 <a class="link" on-click="{{ goto }}" | 323 event.eventType == 'PauseInterrupted' || |
Cutch
2015/05/13 17:50:09
Can you move this logic outside of the template? i
turnidge
2015/05/14 17:53:43
Done.
| |
313 _href="{{ gotoLink('/inspect', event.isolate) }}">{{ event.isolate.na me }}</a> | 324 event.eventType == 'PauseException') }}"> |
314 is paused | 325 <div class="item"> |
315 <template if="{{ event.breakpoint != null }}"> | 326 Isolate |
316 at breakpoint {{ event.breakpoint.number }} | 327 <a class="link" on-click="{{ goto }}" |
317 </template> | 328 _href="{{ gotoLink('/inspect', event.isolate) }}">{{ event.isolate. name }}</a> |
318 <template if="{{ event.eventType == 'ExceptionThrown' }}"> | 329 is paused |
319 at exception | 330 <template if="{{ event.eventType == 'PauseStart' }}"> |
320 </template> | 331 at isolate start |
332 </template> | |
333 <template if="{{ event.eventType == 'PauseExit' }}"> | |
334 at isolate exit | |
335 </template> | |
336 <template if="{{ event.breakpoint != null }}"> | |
337 at breakpoint {{ event.breakpoint.number }} | |
338 </template> | |
339 <template if="{{ event.eventType == 'PauseException' }}"> | |
340 due to exception | |
341 </template> | |
321 | 342 |
322 <br><br> | 343 <br><br> |
323 [<a class="link" on-click="{{ goto }}" | 344 [<a class="link" on-click="{{ goto }}" |
324 _href="{{ gotoLink('/debugger', event.isolate) }}">debug</a>] | 345 _href="{{ gotoLink('/debugger', event.isolate) }}">debug</a>] |
325 | 346 |
326 <a class="boxclose" on-click="{{ closeItem }}">×</a> | 347 <a class="boxclose" on-click="{{ closeItem }}">×</a> |
327 </div> | 348 </div> |
328 </template> | 349 </template> |
329 <template if="{{ event.eventType == 'VMDisconnected' }}"> | 350 <template if="{{ event.eventType == 'ConnectionClosed' }}"> |
330 <div class="item"> | 351 <div class="item"> |
331 Disconnected from VM | 352 Disconnected from VM: {{ event.reason }} |
332 <br><br> | 353 <br><br> |
333 <a class="boxclose" on-click="{{ closeItem }}">×</a> | 354 [<a class="link" on-click="{{ goto }}" |
334 </div> | 355 _href="{{ gotoLink('vm-connect') }}">Connect to a different VM</a> ] |
335 </template> | 356 <a class="boxclose" on-click="{{ closeItem }}">×</a> |
336 <template if="{{ event.eventType == 'Inspect' }}"> | 357 </div> |
337 <div class="item"> | 358 </template> |
338 Inspect <any-service-ref ref="{{ event.inspectee }}"></any-service-ref> | 359 <template if="{{ event.eventType == 'Inspect' }}"> |
339 <br><br> | 360 <div class="item"> |
340 <a class="boxclose" on-click="{{ closeItem }}">×</a> | 361 Inspect <any-service-ref ref="{{ event.inspectee }}"></any-service-ref > |
341 </div> | 362 <br><br> |
363 <a class="boxclose" on-click="{{ closeItem }}">×</a> | |
364 </div> | |
365 </template> | |
342 </template> | 366 </template> |
343 </template> | 367 </template> |
344 </polymer-element> | 368 </polymer-element> |
369 | |
370 | |
371 <polymer-element name="nav-notify-exception" extends="observatory-element"> | |
372 <template> | |
373 <style> | |
374 .item { | |
375 position: relative; | |
376 padding: 16px; | |
377 margin-top: 10px; | |
378 margin-right: 10px; | |
379 padding-right: 25px; | |
380 width: 250px; | |
381 color: #ddd; | |
382 background: rgba(0,0,0,.6); | |
383 border: solid 2px white; | |
384 box-shadow: 0 0 5px black; | |
385 border-radius: 5px; | |
386 animation: fadein 1s; | |
387 } | |
388 | |
389 @keyframes fadein { | |
390 from { opacity: 0; } | |
391 to { opacity: 1; } | |
392 } | |
393 | |
394 a.link { | |
395 color: white; | |
396 text-decoration: none; | |
397 } | |
398 a.link:hover { | |
399 text-decoration: underline; | |
400 } | |
401 .indent { | |
402 margin-left:20px; | |
403 } | |
404 | |
405 a.boxclose { | |
406 position: absolute; | |
407 display: block; | |
408 top: 4px; | |
409 right: 4px; | |
410 height: 18px; | |
411 width: 18px; | |
412 line-height: 16px; | |
413 border-radius: 9px; | |
414 color: white; | |
415 font-size: 18px; | |
416 cursor: pointer; | |
417 text-align: center; | |
418 } | |
419 a.boxclose:hover { | |
420 background: rgba(255,255,255,0.5); | |
421 } | |
422 </style> | |
423 <template if="{{ isUnexpectedError }}"> | |
424 <!-- TODO(turnidge): Add a file-a-bug link to this notification --> | |
425 <div class="item"> | |
426 Unexpected exception:<br><br> | |
427 <div class="indent">{{ exception.toString() }}</div><br> | |
428 <template if="{{ stacktrace != null }}"> | |
429 Stacktrace:<br><br> | |
430 <div class="indent">{{ stacktrace.toString() }}</div> | |
431 <br> | |
432 </template> | |
433 [<a class="link" on-click="{{ goto }}" | |
434 _href="{{ gotoLink('vm-connect') }}">Connect to a different VM</a>] | |
435 <a class="boxclose" on-click="{{ closeItem }}">×</a> | |
436 </div> | |
437 </template> | |
438 <template if="{{ isNetworkError }}"> | |
439 <div class="item"> | |
440 The request cannot be completed because the VM is currently | |
441 disconnected. | |
442 <br><br> | |
443 [<a class="link" on-click="{{ goto }}" | |
444 _href="{{ gotoLink('vm-connect') }}">Connect to a different VM</a>] | |
445 <a class="boxclose" on-click="{{ closeItem }}">×</a> | |
446 </div> | |
447 </template> | |
448 </template> | |
449 </polymer-element> | |
345 | 450 |
346 | 451 |
347 <script type="application/dart" src="nav_bar.dart"></script> | 452 <script type="application/dart" src="nav_bar.dart"></script> |
OLD | NEW |