{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/comments/166786749","pull_request_review_id":94905907,"id":166786749,"diff_hunk":"@@ -0,0 +1,260 @@\n+<link rel='import' href='../../bower_components/polymer/polymer-element.html'>\n+<link rel='import' href='../../bower_components/paper-dialog/paper-dialog.html'>\n+<link rel='import' href='../../bower_components/paper-checkbox/paper-checkbox.html'>\n+<link rel='import' href='../../bower_components/paper-button/paper-button.html'>\n+\n+<dom-module id='hassio-snapshot'>\n+  <template>\n+    <style include='ha-style'>\n+      .content {\n+        width: 400px;\n+        padding: 16px 48px 0 48px;\n+      }\n+      iron-icon {\n+        float: left;\n+        color: var(--primary-color);\n+      }\n+      paper-checkbox {\n+        display: block;\n+        margin: 4px 8px 4px 48px;\n+      }\n+      .snapshot {\n+        margin-bottom: 32px;\n+        margin-left: 32px;\n+        font-size: 1.2em;\n+      }\n+      .snapshot-type {\n+        color: var(--secondary-text-color);\n+        font-size: 0.9em;\n+      }\n+      .addon-version {\n+        color: var(--secondary-text-color);\n+      }      \n+      .card-actions {\n+        border-top: 1px solid #e8e8e8;\n+        padding: 5px 16px;\n+        margin: 0;\n+      }\n+      .warning {\n+        color: var(--google-red-500);\n+      }\n+      .error {\n+        color: var(--google-red-500);\n+      }\n+      @media screen and (max-width: 600px) {\n+        paper-dialog {\n+          position: absolute !important;\n+          bottom: 0; left: 0; right: 0;\n+          border-bottom-left-radius: 0;\n+          border-bottom-right-radius: 0;\n+          margin: 0;\n+        }\n+      }\n+    </style>\n+    <paper-dialog id='dialog' with-backdrop on-iron-overlay-closed='dialogClosed'>\n+      <div class='content'>\n+        <iron-icon icon='[[computeIcon(snapshot.type)]]' class='primary'\n+        ></iron-icon>\n+        <div class='snapshot'>\n+          [[computeName(snapshot)]]\n+          <div class='snapshot-type'>\n+            [[computeType(snapshot.type)]] ([[computeSize(snapshot.size)]])<br/>\n+            [[formatDatetime(snapshot.date)]]\n+          </div>\n+        </div>\n+        <div>\n+          Home Assistant:\n+          <paper-checkbox checked='{{restoreHass}}'>\n+            Home Assistant [[snapshot.homeassistant]]\n+          </paper-checkbox>\n+        </div>\n+        <div>\n+          Folders:\n+          <template is='dom-repeat' items='[[snapshot.folders]]'>\n+            <paper-checkbox checked='{{item.checked}}'>\n+              [[item.name]]\n+            </paper-checkbox>\n+          </template>\n+        </div>\n+        <template is='dom-if' if='[[showAddons(snapshot.addons)]]'>\n+          <div>\n+            Add-ons:\n+            <template is='dom-repeat' items='[[snapshot.addons]]' sort='sortAddons'>\n+              <paper-checkbox checked='{{item.checked}}'>\n+                [[item.name]]\n+                <span class='addon-version'>([[item.version]])</span>\n+              </paper-checkbox>\n+            </template>\n+          </div>\n+        </template>\n+        <template is='dom-if' if='[[error]]'>\n+          <p class='error'>Error: [[error]]</p>\n+        </template>\n+      </div>\n+      <div class='card-actions'>\n+        <paper-button class='warning' on-tap='deleteTapped'>Delete</paper-button>\n+        <paper-button on-tap='partialRestoreTapped'>Partial restore</paper-button>\n+        <template is='dom-if' if='[[isFullSnapshot(snapshot.type)]]'>\n+          <paper-button on-tap='fullRestoreTapped'>Full restore</paper-button>\n+        </template>\n+      </div>\n+    </paper-dialog>\n+  </template>\n+</dom-module>\n+\n+<script>\n+class HassioSnapshot extends window.hassMixins.EventsMixin(Polymer.Element) {\n+  static get is() { return 'hassio-snapshot'; }\n+\n+  static get properties() {\n+    return {\n+      hass: Object,\n+      snapshotSlug: {\n+        type: String,\n+        observer: 'computeSnapshot',\n+      },\n+      snapshot: Object,\n+      restoreHass: {\n+        type: Boolean,\n+        value: true,\n+      },\n+      opened: {\n+        type: Boolean,\n+        observer: 'openedChanged',\n+        notify: true,\n+      },\n+      updateOverview: {\n+        type: Boolean,\n+        notify: true,\n+      },\n+      error: String,\n+    };\n+  }\n+\n+  computeSnapshot(snapshotSlug) {\n+    this.hass.callApi('get', 'hassio/snapshots/' + snapshotSlug + '/info')\n+      .then(function (info) {","path":"hassio/snapshots/hassio-snapshot.html","position":136,"original_position":136,"commit_id":"1e59f183a9e9ce212862a810eedf5e620a33ec57","original_commit_id":"1e59f183a9e9ce212862a810eedf5e620a33ec57","user":{"login":"balloob","id":1444314,"avatar_url":"https://avatars3.githubusercontent.com/u/1444314?v=4","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"body":"Don't use `function() { }.bind(this)` but instead use `=>`. `=>` is a lambda function that will keep the `this` context of the context where it is defined.\r\n\r\n```js\r\nthis.hass.callApi(…).then((info) => {\r\n\r\n})\r\n```","created_at":"2018-02-07T23:10:31Z","updated_at":"2018-02-07T23:10:31Z","html_url":"https://github.com/home-assistant/home-assistant-polymer/pull/872#discussion_r166786749","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/comments/166786749"},"html":{"href":"https://github.com/home-assistant/home-assistant-polymer/pull/872#discussion_r166786749"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872"}}},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872","id":167826321,"html_url":"https://github.com/home-assistant/home-assistant-polymer/pull/872","diff_url":"https://github.com/home-assistant/home-assistant-polymer/pull/872.diff","patch_url":"https://github.com/home-assistant/home-assistant-polymer/pull/872.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/872","number":872,"state":"open","locked":false,"title":"Hass.io improved snapshot view","user":{"login":"c727","id":11984118,"avatar_url":"https://avatars3.githubusercontent.com/u/11984118?v=4","gravatar_id":"","url":"https://api.github.com/users/c727","html_url":"https://github.com/c727","followers_url":"https://api.github.com/users/c727/followers","following_url":"https://api.github.com/users/c727/following{/other_user}","gists_url":"https://api.github.com/users/c727/gists{/gist_id}","starred_url":"https://api.github.com/users/c727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c727/subscriptions","organizations_url":"https://api.github.com/users/c727/orgs","repos_url":"https://api.github.com/users/c727/repos","events_url":"https://api.github.com/users/c727/events{/privacy}","received_events_url":"https://api.github.com/users/c727/received_events","type":"User","site_admin":false},"body":"partial snapshot restore is broken atm: https://github.com/home-assistant/hassio/issues/346\r\n\r\nold:\r\n![s0](https://user-images.githubusercontent.com/11984118/35944775-00d3af1e-0c5e-11e8-86f7-dd18c0f2d554.PNG)\r\n\r\nnew:\r\n![s1](https://user-images.githubusercontent.com/11984118/35944712-af47f6aa-0c5d-11e8-9bb4-851bc1737d52.PNG)\r\n![s2](https://user-images.githubusercontent.com/11984118/35944713-af5e371c-0c5d-11e8-8db5-3935ddaa42db.PNG)\r\n\r\nPS: git mv seems to be fail since I also renamed the folder, in VS Code it was OK :angel: \r\n(old assio-snapshot.html is new assio-snapshot**s**.html)","created_at":"2018-02-07T22:25:12Z","updated_at":"2018-02-07T23:10:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec154114ee8d630952ab852ae5e7353199b83c6b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872/comments","review_comment_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/872/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/statuses/1e59f183a9e9ce212862a810eedf5e620a33ec57","head":{"label":"c727:snapshots","ref":"snapshots","sha":"1e59f183a9e9ce212862a810eedf5e620a33ec57","user":{"login":"c727","id":11984118,"avatar_url":"https://avatars3.githubusercontent.com/u/11984118?v=4","gravatar_id":"","url":"https://api.github.com/users/c727","html_url":"https://github.com/c727","followers_url":"https://api.github.com/users/c727/followers","following_url":"https://api.github.com/users/c727/following{/other_user}","gists_url":"https://api.github.com/users/c727/gists{/gist_id}","starred_url":"https://api.github.com/users/c727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c727/subscriptions","organizations_url":"https://api.github.com/users/c727/orgs","repos_url":"https://api.github.com/users/c727/repos","events_url":"https://api.github.com/users/c727/events{/privacy}","received_events_url":"https://api.github.com/users/c727/received_events","type":"User","site_admin":false},"repo":{"id":118481107,"name":"home-assistant-polymer","full_name":"c727/home-assistant-polymer","owner":{"login":"c727","id":11984118,"avatar_url":"https://avatars3.githubusercontent.com/u/11984118?v=4","gravatar_id":"","url":"https://api.github.com/users/c727","html_url":"https://github.com/c727","followers_url":"https://api.github.com/users/c727/followers","following_url":"https://api.github.com/users/c727/following{/other_user}","gists_url":"https://api.github.com/users/c727/gists{/gist_id}","starred_url":"https://api.github.com/users/c727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c727/subscriptions","organizations_url":"https://api.github.com/users/c727/orgs","repos_url":"https://api.github.com/users/c727/repos","events_url":"https://api.github.com/users/c727/events{/privacy}","received_events_url":"https://api.github.com/users/c727/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/c727/home-assistant-polymer","description":":lollipop: Polymer frontend for Home Assistant","fork":true,"url":"https://api.github.com/repos/c727/home-assistant-polymer","forks_url":"https://api.github.com/repos/c727/home-assistant-polymer/forks","keys_url":"https://api.github.com/repos/c727/home-assistant-polymer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c727/home-assistant-polymer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c727/home-assistant-polymer/teams","hooks_url":"https://api.github.com/repos/c727/home-assistant-polymer/hooks","issue_events_url":"https://api.github.com/repos/c727/home-assistant-polymer/issues/events{/number}","events_url":"https://api.github.com/repos/c727/home-assistant-polymer/events","assignees_url":"https://api.github.com/repos/c727/home-assistant-polymer/assignees{/user}","branches_url":"https://api.github.com/repos/c727/home-assistant-polymer/branches{/branch}","tags_url":"https://api.github.com/repos/c727/home-assistant-polymer/tags","blobs_url":"https://api.github.com/repos/c727/home-assistant-polymer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c727/home-assistant-polymer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c727/home-assistant-polymer/git/refs{/sha}","trees_url":"https://api.github.com/repos/c727/home-assistant-polymer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c727/home-assistant-polymer/statuses/{sha}","languages_url":"https://api.github.com/repos/c727/home-assistant-polymer/languages","stargazers_url":"https://api.github.com/repos/c727/home-assistant-polymer/stargazers","contributors_url":"https://api.github.com/repos/c727/home-assistant-polymer/contributors","subscribers_url":"https://api.github.com/repos/c727/home-assistant-polymer/subscribers","subscription_url":"https://api.github.com/repos/c727/home-assistant-polymer/subscription","commits_url":"https://api.github.com/repos/c727/home-assistant-polymer/commits{/sha}","git_commits_url":"https://api.github.com/repos/c727/home-assistant-polymer/git/commits{/sha}","comments_url":"https://api.github.com/repos/c727/home-assistant-polymer/comments{/number}","issue_comment_url":"https://api.github.com/repos/c727/home-assistant-polymer/issues/comments{/number}","contents_url":"https://api.github.com/repos/c727/home-assistant-polymer/contents/{+path}","compare_url":"https://api.github.com/repos/c727/home-assistant-polymer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c727/home-assistant-polymer/merges","archive_url":"https://api.github.com/repos/c727/home-assistant-polymer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c727/home-assistant-polymer/downloads","issues_url":"https://api.github.com/repos/c727/home-assistant-polymer/issues{/number}","pulls_url":"https://api.github.com/repos/c727/home-assistant-polymer/pulls{/number}","milestones_url":"https://api.github.com/repos/c727/home-assistant-polymer/milestones{/number}","notifications_url":"https://api.github.com/repos/c727/home-assistant-polymer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c727/home-assistant-polymer/labels{/name}","releases_url":"https://api.github.com/repos/c727/home-assistant-polymer/releases{/id}","deployments_url":"https://api.github.com/repos/c727/home-assistant-polymer/deployments","created_at":"2018-01-22T16:10:19Z","updated_at":"2018-01-22T16:10:21Z","pushed_at":"2018-02-07T22:31:55Z","git_url":"git://github.com/c727/home-assistant-polymer.git","ssh_url":"git@github.com:c727/home-assistant-polymer.git","clone_url":"https://github.com/c727/home-assistant-polymer.git","svn_url":"https://github.com/c727/home-assistant-polymer","homepage":"https://home-assistant.io","size":4774,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"home-assistant:master","ref":"master","sha":"ec930d2c565a0885f59a7da01f3321159706cd88","user":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars3.githubusercontent.com/u/13844975?v=4","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"repo":{"id":38982731,"name":"home-assistant-polymer","full_name":"home-assistant/home-assistant-polymer","owner":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars3.githubusercontent.com/u/13844975?v=4","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/home-assistant/home-assistant-polymer","description":":lollipop: Polymer frontend for Home Assistant","fork":false,"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer","forks_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/forks","keys_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/teams","hooks_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/hooks","issue_events_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/events{/number}","events_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/events","assignees_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/assignees{/user}","branches_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/branches{/branch}","tags_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/tags","blobs_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/git/refs{/sha}","trees_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/statuses/{sha}","languages_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/languages","stargazers_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/stargazers","contributors_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/contributors","subscribers_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/subscribers","subscription_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/subscription","commits_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/commits{/sha}","git_commits_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/git/commits{/sha}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/comments{/number}","issue_comment_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/comments{/number}","contents_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/contents/{+path}","compare_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/merges","archive_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/downloads","issues_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues{/number}","pulls_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls{/number}","milestones_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/milestones{/number}","notifications_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/labels{/name}","releases_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/releases{/id}","deployments_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/deployments","created_at":"2015-07-12T23:58:06Z","updated_at":"2018-02-07T15:32:45Z","pushed_at":"2018-02-07T22:32:38Z","git_url":"git://github.com/home-assistant/home-assistant-polymer.git","ssh_url":"git@github.com:home-assistant/home-assistant-polymer.git","clone_url":"https://github.com/home-assistant/home-assistant-polymer.git","svn_url":"https://github.com/home-assistant/home-assistant-polymer","homepage":"https://home-assistant.io","size":4778,"stargazers_count":221,"watchers_count":221,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":308,"mirror_url":null,"archived":false,"open_issues_count":95,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":308,"open_issues":95,"watchers":221,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872"},"html":{"href":"https://github.com/home-assistant/home-assistant-polymer/pull/872"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/872"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/872/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872/comments"},"review_comment":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/872/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant-polymer/statuses/1e59f183a9e9ce212862a810eedf5e620a33ec57"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"balloob"}}