| <!-- |
| This in an HTML Import-able file that contains the definition |
| of the following elements: |
| |
| <force-sync-sk> |
| |
| This element displays when the mirror was last synced, how often it is |
| normally synced, and a button to force a sync. |
| |
| To use this file import it: |
| |
| <link href="force-sync-sk.html" rel="import" /> |
| |
| Usage: |
| |
| <force-sync-sk></force-sync-sk> |
| |
| Attributes: |
| mirrorLastSynced - Time when the mirror was last synced. |
| mirrorUpdateDuration - How often the mirror is synced. |
| mirrorUpdateRunning - If the mirror is currently being synced. |
| |
| Events: |
| None |
| --> |
| |
| <dom-module id="force-sync-sk"> |
| <template> |
| <style include="iron-positioning android-compile-app-style"> |
| table.forcesync { |
| border:solid black 1px; |
| border-spacing: 0px; |
| width: 80%; |
| } |
| tr.headers { |
| background-color: #CCCCFF; |
| text-align: center; |
| } |
| tr { |
| text-align: center; |
| } |
| td { |
| white-space: nowrap; |
| padding: 5px; |
| border:solid black 1px; |
| } |
| paper-button { |
| color: #1F78B4; |
| } |
| </style> |
| |
| <table class="forcesync"> |
| <tr class="headers"> |
| <td colspan=3>Instances</td> |
| </tr> |
| <template is="dom-repeat" items="[[androidCompileInstances]]"> |
| <tr> |
| <td> |
| {{item.name}} |
| </td> |
| <td> |
| Last synced at: {{item.mirror_last_synced}} |
| </td> |
| <td> |
| Periodic syncs done every: {{item.mirror_update_duration}} |
| </td> |
| </tr> |
| </template> |
| <tr> |
| <td colspan=3> |
| <paper-button raised id="force_sync">Force Sync All Instances</paper-button> |
| </td> |
| </tr> |
| </table> |
| |
| </template> |
| |
| <script> |
| Polymer({ |
| is: "force-sync-sk", |
| properties: { |
| androidCompileInstances: { |
| type: Array, |
| value: [], |
| }, |
| }, |
| |
| ready: function() { |
| this.$.force_sync.addEventListener('click', function(e) { |
| sk.post("/_/force_sync").then(function(resp) { |
| window.location.href = "/"; |
| }).catch(sk.errorMessage); |
| }); |
| }, |
| }); |
| </script> |
| </dom-module> |