| Index: appengine/config_service/ui/src/config-ui/config-set.html
|
| diff --git a/appengine/config_service/ui/src/config-ui/config-set.html b/appengine/config_service/ui/src/config-ui/config-set.html
|
| index 82567a80c4911656d3601a23ee04b707d0016e60..3f5fe8a4b9ff969dc900655c8e0415440135f167 100644
|
| --- a/appengine/config_service/ui/src/config-ui/config-set.html
|
| +++ b/appengine/config_service/ui/src/config-ui/config-set.html
|
| @@ -16,8 +16,10 @@
|
| <dom-module id="config-set">
|
| <template>
|
| <style>
|
| - .spinner {
|
| - text-align: center;
|
| + @media only screen and (min-width: 768px) {
|
| + .center {
|
| + width: 550px;
|
| + }
|
| }
|
|
|
| .category {
|
| @@ -25,11 +27,16 @@
|
| font-family: sans-serif;
|
| }
|
|
|
| + .name {
|
| + font-size: 200%;
|
| + font-family: sans-serif;
|
| + word-wrap: break-word;
|
| + }
|
| +
|
| .center {
|
| - width: 20%;
|
| margin: auto;
|
| text-align: left;
|
| - }
|
| + }
|
|
|
| .config-card {
|
| padding-bottom: 1%;
|
| @@ -41,24 +48,23 @@
|
| to {opacity: 1}
|
| }
|
|
|
| - .name {
|
| - font-size: 200%;
|
| - font-family: sans-serif;
|
| - word-wrap: break-word;
|
| - }
|
| -
|
| - #refreshStatus { font-size: 80%; }
|
| -
|
| .title {
|
| padding-bottom: 1%;
|
| padding-top: 5%;
|
| }
|
|
|
| + #refreshStatus { font-size: 80%; }
|
| +
|
| .paper-green { color: var(--paper-green-600); }
|
|
|
| .paper-red { color: var(--paper-red-600); }
|
|
|
| .paper-grey { color: var(--paper-grey-600); }
|
| +
|
| + .spinner {
|
| + text-align: center;
|
| + }
|
| +
|
| </style>
|
|
|
| <iron-ajax
|
| @@ -66,6 +72,7 @@
|
| id="requestConfigs"
|
| url="/_ah/api/config/v1/config-sets?config_set=[[category]]/[[name]][[route.path]]&include_files=true&include_last_import_attempt=true"
|
| handle-as="json"
|
| + on-error="_onRequestError"
|
| on-response="_onGotConfigFiles"
|
| headers="[[auth_headers]]">
|
| </iron-ajax>
|
| @@ -124,34 +131,41 @@
|
| <p id="refreshStatus">[[refreshMessage]]</p>
|
| </div>
|
| </div>
|
| - <template is="dom-if" if="[[isRefreshing]]">
|
| - <div class="spinner">
|
| - <paper-spinner active></paper-spinner>
|
| - </div>
|
| - </template>
|
| - <template is="dom-if" if="[[_not(isRefreshing)]]">
|
| - <template is="dom-if" if="[[isLoading]]">
|
| + <template is="dom-if" if="[[_not(errorMessage)]]">
|
| + <template is="dom-if" if="[[isRefreshing]]">
|
| <div class="spinner">
|
| <paper-spinner active></paper-spinner>
|
| </div>
|
| </template>
|
| - <template is="dom-if" if="[[_not(isLoading)]]">
|
| - <template is="dom-if" if="[[_isEmpty(files)]]">
|
| - <div class="center" style="font-family: sans-serif;">
|
| - No config files found.
|
| + <template is="dom-if" if="[[_not(isRefreshing)]]">
|
| + <template is="dom-if" if="[[isLoading]]">
|
| + <div class="spinner">
|
| + <paper-spinner active></paper-spinner>
|
| </div>
|
| </template>
|
| - <template is="dom-if" if="[[_not(_isEmpty(files))]]">
|
| - <template is="dom-repeat" items="[[files]]" as="file">
|
| - <div class="center config-card">
|
| - <config-file-card
|
| - name="[[file.path]]" link="[[location]]/[[file.path]]">
|
| - </config-file-card>
|
| + <template is="dom-if" if="[[_not(isLoading)]]">
|
| + <template is="dom-if" if="[[_isEmpty(files)]]">
|
| + <div class="center" style="font-family: sans-serif;">
|
| + No config files found.
|
| </div>
|
| </template>
|
| + <template is="dom-if" if="[[_not(_isEmpty(files))]]">
|
| + <template is="dom-repeat" items="[[files]]" as="file">
|
| + <div class="center config-card">
|
| + <config-file-card
|
| + name="[[file.path]]" link="[[location]]/[[file.path]]">
|
| + </config-file-card>
|
| + </div>
|
| + </template>
|
| + </template>
|
| </template>
|
| </template>
|
| </template>
|
| + <template is="dom-if" if="[[errorMessage]]">
|
| + <div class="center">
|
| + <p>[[errorMessage]]</p>
|
| + </div>
|
| + </template>
|
| </template>
|
| <script>
|
| Polymer({
|
| @@ -197,6 +211,11 @@
|
| refreshMessage: {
|
| type: String,
|
| value: null
|
| + },
|
| +
|
| + errorMessage: {
|
| + type: String,
|
| + value: null
|
| }
|
| },
|
|
|
| @@ -242,6 +261,7 @@
|
| this.lastImportAttempt =
|
| event.detail.response.config_sets[0].last_import_attempt || null;
|
| this.isLoading = false;
|
| + this.errorMessage = null;
|
| this.fire('processedConfigFiles');
|
| },
|
|
|
| @@ -249,7 +269,22 @@
|
| this.isRefreshing = false;
|
| this.refreshMessage = "Error: Files could not be refreshed.";
|
| this.fire('refreshError');
|
| + },
|
| +
|
| + _onRequestError: function(event) {
|
| + var error = parseInt(event.detail.error.message.match(/\d+/g));
|
| + this.isLoading = false;
|
| + if (error === 403) {
|
| + this.errorMessage = "Authorization required to view this config set. You " +
|
| + "need to sign in first.";
|
| + } else if (error >= 500 && error < 600) {
|
| + this.errorMessage = "Internal server error.";
|
| + } else {
|
| + this.errorMessage = "Error occured. Try again later.";
|
| + }
|
| + this.fire('fetchError');
|
| }
|
| +
|
| });
|
| </script>
|
| </dom-module>
|
|
|