| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2017 The LUCI Authors. All rights reserved. | 2 Copyright 2017 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"> | 7 <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"> |
| 8 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> | 8 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> |
| 9 <link rel="import" href="../../bower_components/paper-card/paper-card.html"> | 9 <link rel="import" href="../../bower_components/paper-card/paper-card.html"> |
| 10 <link rel="import" href="../../bower_components/polymer/polymer.html"> | 10 <link rel="import" href="../../bower_components/polymer/polymer.html"> |
| 11 <link rel="import" href="../../bower_components/iron-icons/maps-icons.html"> | 11 <link rel="import" href="../../bower_components/iron-icons/maps-icons.html"> |
| 12 <link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layou
t.html"> | 12 <link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layou
t.html"> |
| 13 <link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html
"> | 13 <link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html
"> |
| 14 <link rel="import" href="../../common/common-behaviors.html"> |
| 14 | 15 |
| 15 <dom-module id="config-set-card"> | 16 <dom-module id="config-set-card"> |
| 16 <template> | 17 <template> |
| 17 <style> | 18 <style> |
| 18 a { | |
| 19 text-decoration: none; | |
| 20 color: inherit; | |
| 21 } | |
| 22 | |
| 23 paper-card { | 19 paper-card { |
| 24 width: 100%; | 20 width: 100%; |
| 25 } | 21 } |
| 26 | 22 |
| 27 p { | 23 span { |
| 28 color: var(--paper-grey-600); | 24 color: var(--paper-grey-600); |
| 29 word-wrap: break-word; | 25 word-wrap: break-word; |
| 30 font-size: 90%; | 26 font-size: 90%; |
| 31 } | 27 } |
| 32 | 28 |
| 33 .config-title { | 29 .config-title { |
| 34 @apply --paper-font-headline; | 30 @apply --paper-font-headline; |
| 35 word-wrap: break-word; | 31 word-wrap: break-word; |
| 36 font-size: 120%; | 32 font-size: 120%; |
| 37 } | 33 } |
| 38 | 34 |
| 39 .validation { | 35 .validation { |
| 40 float: right; | 36 float: right; |
| 41 font-size: 15px; | 37 font-size: 15px; |
| 42 vertical-align: middle; | 38 vertical-align: middle; |
| 43 } | 39 } |
| 44 | 40 |
| 45 .paper-green { color: var(--paper-green-600); } | 41 .paper-green { color: var(--paper-green-600); } |
| 46 | 42 |
| 47 .paper-red { color: var(--paper-red-600); } | 43 .paper-red { color: var(--paper-red-600); } |
| 48 | 44 |
| 49 .paper-grey { color: var(--paper-grey-600); } | 45 .paper-grey { color: var(--paper-grey-600); } |
| 50 | 46 |
| 51 </style> | 47 </style> |
| 52 | 48 |
| 53 <a href="#/[[name]]"> | 49 <paper-card elevation="2" |
| 54 <paper-card elevation="2"> | 50 on-tap="_openConfigPage"> |
| 55 <div class="card-content"> | 51 <div class="card-content"> |
| 56 <div class="config-title">[[name]] | 52 <div class="config-title"> |
| 57 <div class="validation"> | 53 [[name]] |
| 58 <template is="dom-if" if="[[lastImportAttempt]]" restamp="true"> | 54 <div class="validation"> |
| 59 <template is="dom-if" if="[[lastImportAttempt.success]]" restamp
="true"> | 55 <iron-icon id="launch" |
| 60 <iron-icon id="successful-import" | 56 icon="icons:launch" |
| 61 icon="icons:check-circle" | 57 class="paper-grey" |
| 62 class="paper-green"> | 58 on-tap="_openConfigGitiles"> |
| 63 </iron-icon> | 59 </iron-icon> |
| 64 <paper-tooltip for="successful-import" offset="0"> | 60 <paper-tooltip for="launch" offset="0"> |
| 65 Last import succeeded. | 61 [[link]] |
| 66 </paper-tooltip> | 62 </paper-tooltip> |
| 67 </template> | 63 <template is="dom-if" if="[[lastImportAttempt]]" restamp="true"> |
| 68 <template is="dom-if" if="[[_not(lastImportAttempt.success)]]" r
estamp="true"> | 64 <template is="dom-if" if="[[lastImportAttempt.success]]" restamp="
true"> |
| 69 <iron-icon id="failed-import" | 65 <iron-icon id="successful-import" |
| 70 icon="icons:warning" | 66 icon="icons:check-circle" |
| 71 class="paper-red"> | 67 class="paper-green"> |
| 72 </iron-icon> | |
| 73 <paper-tooltip for="failed-import" offset="0"> | |
| 74 Last import failed. | |
| 75 </paper-tooltip> | |
| 76 </template> | |
| 77 </template> | |
| 78 <template is="dom-if" if="[[_not(lastImportAttempt)]]" restamp="tr
ue"> | |
| 79 <iron-icon id="no-import" | |
| 80 icon="icons:help" | |
| 81 class="paper-grey"> | |
| 82 </iron-icon> | 68 </iron-icon> |
| 83 <paper-tooltip for="no-import" offset="0"> | 69 <paper-tooltip for="successful-import" offset="0"> |
| 84 Last import attempt info not available. | 70 Last import succeeded. |
| 85 </paper-tooltip> | 71 </paper-tooltip> |
| 86 </template> | 72 </template> |
| 87 </div> | 73 <template is="dom-if" if="[[_not(lastImportAttempt.success)]]" res
tamp="true"> |
| 74 <iron-icon id="failed-import" |
| 75 icon="icons:warning" |
| 76 class="paper-red"> |
| 77 </iron-icon> |
| 78 <paper-tooltip for="failed-import" offset="0"> |
| 79 Last import failed. |
| 80 </paper-tooltip> |
| 81 </template> |
| 82 </template> |
| 83 <template is="dom-if" if="[[_not(lastImportAttempt)]]" restamp="true
"> |
| 84 <iron-icon id="no-import" |
| 85 icon="icons:help" |
| 86 class="paper-grey"> |
| 87 </iron-icon> |
| 88 <paper-tooltip for="no-import" offset="0"> |
| 89 Last import attempt info not available. |
| 90 </paper-tooltip> |
| 91 </template> |
| 92 </div> |
| 93 <div> |
| 94 <span id="revision">Revision: [[_formatRevision(revision)]]</span> |
| 95 <paper-tooltip for="revision" offset="0"> |
| 96 [[revision]] |
| 97 </paper-tooltip> |
| 98 <span id="timestamp">Timestamp: [[_formatDate(timestamp)]]</span> |
| 99 <paper-tooltip for="timestamp" offset="0"> |
| 100 [[_getExactTime(timestamp)]] |
| 101 </paper-tooltip> |
| 88 </div> | 102 </div> |
| 89 </div> | 103 </div> |
| 90 </paper-card> | 104 </div> |
| 91 </a> | 105 </paper-card> |
| 92 | 106 |
| 93 </template> | 107 </template> |
| 94 <script> | 108 <script> |
| 95 Polymer({ | 109 Polymer({ |
| 96 is: "config-set-card", | 110 is: "config-set-card", |
| 97 | 111 |
| 98 properties: { | 112 behaviors: [ConfigUIBehaviors.CommonBehavior], |
| 99 name: { | |
| 100 type: String | |
| 101 }, | |
| 102 | 113 |
| 103 lastImportAttempt: { | 114 _openConfigGitiles: function(event) { |
| 104 type: Object | 115 event.stopPropagation(); |
| 105 }, | 116 window.open(this.link); |
| 106 }, | 117 }, |
| 107 | 118 |
| 108 _not: function(b) { | 119 _openConfigPage: function() { |
| 109 return !b; | 120 window.location.href = window.location.href + this.name; |
| 110 }, | 121 }, |
| 111 | |
| 112 }); | 122 }); |
| 113 </script> | 123 </script> |
| 114 </dom-module> | 124 </dom-module> |
| 115 | 125 |
| OLD | NEW |