UNPKG

api-console-assets

Version:

This repo only exists to publish api console components to npm

654 lines (635 loc) 27.6 kB
<!-- @license Copyright 2016 The Advanced REST client authors <arc@mulesoft.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> <link rel="import" href="../paper-button/paper-button.html"> <link rel="import" href="../iron-icon/iron-icon.html"> <link rel="import" href="../iron-pages/iron-pages.html"> <link rel="import" href="../paper-button/paper-button.html"> <link rel="import" href="../arc-icons/arc-icons.html"> <!-- `<response-error-view>` A view for the response error. The element displays predefined error message with icon and depending on the `message` property it will display custom message or a predefined explanation if the message is one of the Chrome's network errors (net::*). If the `message` property is not set then a defaulot message will be displayed. ### Example #### Custom message ``` <response-error-view message="Unable to run the request"></response-error-view> ``` ### predefined message (chrome network error) ``` <response-error-view message="net::ERR_BAD_SSL_CLIENT_AUTH_CERT"></response-error-view> <response-error-view message="net::ERR_CONNECTION_REFUSED"></response-error-view> ``` ## Predefined messages - Request aborted - net::ERR_CERT_AUTHORITY_INVALID - net::ERR_CONNECTION_REFUSED - net::ERR_CERT_COMMON_NAME_INVALID - net::ERR_ADDRESS_UNREACHABLE - net::ERR_BAD_SSL_CLIENT_AUTH_CERT - net::ERR_BLOCKED_BY_ADMINISTRATOR - net::ERR_BLOCKED_BY_CLIENT - net::ERR_BLOCKED_ENROLLMENT_CHECK_PENDING - net::ERR_CERT_CONTAINS_ERRORS - net::ERR_CERT_DATE_INVALID - net::ERR_CERT_END - net::ERR_CERT_ERROR_IN_SSL_RENEGOTIATION - net::ERR_CERT_INVALID - net::ERR_CERT_NAME_CONSTRAINT_VIOLATION - net::ERR_CERT_NON_UNIQUE_NAME - net::ERR_CERT_NO_REVOCATION_MECHANISM - net::ERR_CERT_REVOKED - net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION - net::ERR_CERT_VALIDITY_TOO_LONG - net::ERR_CERT_WEAK_KEY - net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM - net::ERR_CONNECTION_CLOSED - net::ERR_CONNECTION_RESET - net::ERR_CONNECTION_FAILED - net::ERR_CONNECTION_REFUSED - net::ERR_CONNECTION_TIMED_OUT - net::ERR_CONTENT_LENGTH_MISMATCH - net::ERR_INCOMPLETE_CHUNKED_ENCODING - net::ERR_FILE_NOT_FOUND - net::ERR_ICANN_NAME_COLLISION - net::ERR_INTERNET_DISCONNECTED - net::ERR_NAME_NOT_RESOLVED - net::ERR_NAME_RESOLUTION_FAILED - net::ERR_NETWORK_ACCESS_DENIED - net::ERR_NETWORK_CHANGED - net::ERR_NETWORK_IO_SUSPENDED - net::ERR_PROXY_CONNECTION_FAILED - net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION - net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH - net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION - net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION - net::ERR_SSL_PROTOCOL_ERROR - net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN - net::ERR_SSL_SERVER_CERT_BAD_FORMAT - net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH - net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY - net::ERR_TEMPORARY_BACKOFF - net::ERR_TIMED_OUT - net::ERR_TOO_MANY_REDIRECTS ### Styling The styling is consistent with the `error-message` element styling options. `<response-error-view>` provides the following custom properties and mixins for styling: Custom property | Description | Default ----------------|-------------|---------- `--response-error-view` | Mixin applied to the element | `{}` `--error-message-icon-color` | Color of the icon | `rgba(0, 0, 0, 0.56)` `--error-message-icon` | Mixin apllied to the icon | `{}` `--arc-font-subhead` | Theme mixin, applied to the predefined description message. | `{}` `--error-message-color` | Color of the predefined description message | `#db4437` `--error-message-text` | Mixin applied ot the predefined description message | `{}` `--error-message-code-color` | Color of the message passed to the element. It's meant to be a less visible information and probably define an error code. | `#9e9e9e` @group UI Elements @element response-error-view @demo demo/index.html --> <dom-module id="response-error-view"> <template> <style> :host { @apply(--layout-vertical); @apply(--layout-flex); -webkit-user-select: text; margin: 0 16px; @apply(--response-error-view); } .message-wrapper { @apply(--layout-horizontal); @apply(--layout-center); } .error-icon { width: 128px; height: 128px; color: var(--error-message-icon-color, rgba(0, 0, 0, 0.56)); @apply(--error-message-icon); } .error-desc { @apply(--arc-font-subhead); color: var(--error-message-color, #db4437); @apply(--error-message-text); } .error-code { color: var(--error-message-code-color, #9e9e9e); } .inherit { color: inherit !important; background-color: inherit !important; text-decoration: inherit !important; } p, h3 { cursor: text; } </style> <div class="message-wrapper"> <div> <iron-icon class="error-icon" icon="[[icon]]"></iron-icon> </div> <div class="error-desc"> <iron-pages selected="[[detailsPage]]"> <section> <!-- 0 --> <h3>The requested URL can't be reached</h3> <p>The service might be temporarily down or it may have moved permanently to a new web address.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 1 --> <h3>Install self signed certificate in Chrome</h3> <p>The app can't work if the self-signed certificate is not installed in Chrome.</p> <a class="inherit" href="http://restforchrome.blogspot.co.uk/2016/04/advanced-rest-client.html" target="_blank"> <paper-button raised>Tell me more</paper-button> </a> <p class="error-code">[[message]]</p> </section> <section> <!-- 2 --> <h3>The requested URL can't be reached</h3> <p>The service refused to connect.</p> <p> Please, check if: </p> <ul> <li>you and remote machine are connected to the internet,</li> <li>all required services (like www) are up and running on server</li> <li>port number is correct</li> <li>url is correct</li> </ul> <p>Search Google for <a href="https://www.google.com/search?q=chrome%20network%20error%20102" target="_blank">chrome network error 102</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 3 --> <h3>Certificate is invalid for given domain</h3> <p>Certificate presented to the app has different CN (common name) than the domain of the request.</p> <p>Please, generate certificate again with valid domain name or use free certificate service like <a href="https://letsencrypt.org/" target="_blank">letsencrypt.org</a> to get a new certificate.</p> <a class="inherit" href="http://restforchrome.blogspot.co.uk/2016/04/advanced-rest-client.html" target="_blank"> <paper-button raised>Tell me more</paper-button> </a> <a class="inherit" href="https://bugs.chromium.org/p/chromium/issues/detail?id=603104" target="_blank"> <paper-button raised>See CR bug</paper-button> </a> <p class="error-code">[[message]]</p> </section> <section> <!-- 4 --> <h3>Abort / timeout</h3> <p>The request has been aborted manually or because of the conection timeout. There were no response from the server but the connection wasn't closed.</p> <p>You can adjust timeout in settings.</p> <p> Try to: </p> <ul> <li>add "Connection: close" header which should be used by the server to close the connection after it finish generating response</li> </ul> <p> Please, check if: </p> <ul> <li>all required services (like www) are up and running on server</li> <li>method is correct</li> <li>port number is correct</li> <li>url is correct</li> <li>all required headers and/or payload has been added to the request</li> </ul> <h4>Example</h4> <p> Sometimes it may happen when you use <b>http</b> protocol instead of <b>https</b>. Also it may happen when you use different URL (port / protocol) and the server is not configured properly. </p> </section> <section> <!-- 5 --> <h3>The requested URL can't be reached</h3> <p>The service is unreachable.</p> <p>Search Google for <a href="https://www.google.com/search?q=chrome%20network%20error%20109" target="_blank">chrome network error 109</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 6 --> <h3>The requested URL can’t provide a secure connection</h3> <p><b>The URL</b> didn’t accept your login certificate or your login certificate may have expired.</p> <p>Try contacting the system admin.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 7 --> <h3>The URL is blocked</h3> <p>The person who set up this computer has chosen to block this site.</p> <p>Try contacting the system admin.</p> <p><b>Check your administrator's policies</b></p> <p>Visit <b>chrome://policy</b> to see the list of blacklisted URLs and other policies enforced by your system administrator.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 8 --> <h3>The URL is blocked</h3> <p>Requests to the server have been blocked by an extension.</p> <p>Try</p> <ul> <li>Again...</li> <li>Disabling your extensions</li> </ul> <p class="error-code">[[message]]</p> </section> <section> <!-- 9 --> <h3>There is no Internet connection</h3> <p>Chrome OS hasn’t completed its initial setup.</p> <ul> <li>Fix your connection using the <a href="data:text/html,chromewebdata#buttons" target="_blank">diagnostics app</a></li> <li>Sign out and complete setup</li> </ul> <p class="error-code">[[message]]</p> </section> <section> <!-- 10 --> <h3>Certificate error</h3> <p>Certificate presented to the app is invalid.</p> <p>Please, generate certificate again or use free certificate service like <a href="https://letsencrypt.org/" target="_blank">letsencrypt.org</a> to get a new certificate.</p> <a class="inherit" href="http://restforchrome.blogspot.co.uk/2016/04/advanced-rest-client.html" target="_blank"> <paper-button raised>Tell me more</paper-button> </a> <p class="error-code">[[message]]</p> </section> <section> <!-- 11 --> <h3>The requested URL can't be reached</h3> <p>The service unexpectedly closed the connection.</p> <p>Try</p> <ul> <li>Again...</li> <li>Checking the connection</li> <li>Checking the proxy and the firewall</li> </ul> <p class="error-code">[[message]]</p> <p><b>Check your Internet connection</b></p> <p>Check any cables and reboot any routers, modems or other network devices you may be using.</p> <p><b>Allow Chrome to access the network in your firewall or antivirus settings.</b></p> <p>If it is already listed as a program allowed to access the network, try removing it from the list and adding it again.</p> <p><b>If you use a proxy server...</b></p> <p>Check your proxy settings or contact your network administrator to make sure that the proxy server is working. If you don't believe you should be using a proxy server: Go to the Chrome menu > Settings > + Show advanced settings > Change proxy settings... and make sure your configuration is set to "no proxy" or "direct."</p> </section> <section> <!-- 12 --> <h3>The requested URL can't be reached</h3> <p>The service is unreachable.</p> <p>Search Google for <a href="https://www.google.co.uk/search?q=chrome%20network%20error%20104" target="_blank">chrome network error 104</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 13 --> <h3>The requested URL can't be reached</h3> <p>The service refused to connect.</p> <p>Search Google for <a href="https://www.google.com/search?q=chrome%20network%20error%20102" target="_blank">chrome network error 102</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 14 --> <h3>The requested URL can't be reached</h3> <p>The service took too long to respond.</p> <p>Search Google for <a href="https://www.google.com/search?q=chrome%20network%20error%20118" target="_blank">chrome network error 118</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 15 --> <h3>The requested URL isn’t working</h3> <p>The service unexpectedly closed the connection.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 16 --> <h3>The requested URL was not found</h3> <p>It may have been moved or deleted.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 17 --> <h3>The requested URL can’t be reached</h3> <p>This site on the company, organisation or school intranet has the same URL as an external website.</p> <p>Try contacting your system administrator.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 18 --> <h3>There is no Internet connection</h3> <p>Your computer is offline.</p> <p>Try:</p> <ul> <li>Checking the network cable or router</li> <li>Resetting the modem or router</li> <li>Reconnecting to Wi-Fi</li> </ul> <p class="error-code">[[message]]</p> </section> <section> <!-- 19 --> <h3>The requested URL can't be reached</h3> <p>The service's server DNS address could not be found.</p> <p>Search Google for <a href="https://www.google.com/search?q=chrome%20network%20error%20105" target="_blank">chrome network error 105</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 20 --> <h3>The requested URL can't be reached</h3> <p>The service might be temporarily down or it may have moved permanently to a new web address.</p> <p>Search Google for <a href="https://www.google.com/search?q=chrome%20network%20error%20137" target="_blank">chrome network error 137</a></p> <p class="error-code">[[message]]</p> </section> <section> <!-- 21 --> <h3>Your Internet access is blocked</h3> <p>Firewall or antivirus software may have blocked the connection.</p> <p>Try:</p> <ul> <li>Checking the connection</li> <li>Checking firewall and antivirus configurations</li> </ul> <p class="error-code">[[message]]</p> <p><b>Check your Internet connection</b></p> <p>Check any cables and reboot any routers, modems or other network devices you may be using.</p> <p><b>Allow Chrome to access the network in your firewall or antivirus settings</b></p> <p>If it is already listed as a program allowed to access the network, try removing it from the list and adding it again.</p> </section> <section> <!-- 22 --> <h3>Your connection was interrupted</h3> <p>A network change was detected.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 23 --> <h3>Your connection was interrupted</h3> <p>Your computer went to sleep. Zzzzzzz.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 24 --> <h3>There is no Internet connection</h3> <p>There is something wrong with the proxy server or the address is incorrect.</p> <p>Try:</p> <ul> <li>Checking the proxy address</li> <li>Contacting the system admin</li> </ul> <p class="error-code">[[message]]</p> <p><b>If you use a proxy server...</b></p> <p>Check your proxy settings or contact your network administrator to make sure that the proxy server is working. If you don't believe you should be using a proxy server: Go to the Chrome menu > Settings > + Show advanced settings > Change proxy settings... and make sure your configuration is set to "no proxy" or "direct."</p> </section> <section> <!-- 25 --> <h3>The requested URL isn’t working</h3> <p>The service sent an invalid response.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 26 --> <h3>The requested URL can’t provide a secure connection</h3> <p><b>The URL</b> sent an invalid response.</p> <p><a href="https://support.google.com/chrome?p=ir_ssl_error" target="_blank">Learn more</a> about this problem.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 27 --> <h3>The requested URL can’t provide a secure connection</h3> <p>The server presented a certificate that doesn't match built-in expectations. These expectations are included for certain, high-security websites in order to protect you.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 28 --> <h3>The requested URL can’t provide a secure connection</h3> <p>The server doesn't adhere to security standards.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 29 --> <h3>The requested URL can’t provide a secure connection</h3> <p>The server uses an unsupported protocol.</p> <p class="error-code">[[message]]</p> <p><b>Unsupported protocol</b></p> <p>The client and server don't support a common SSL protocol version or cipher suite. This is likely to be caused when the server needs RC4, which is no longer considered secure.</p> </section> <section> <!-- 30 --> <h3>The requested URL can’t provide a secure connection</h3> <p>The server doesn't adhere to security standards.</p> <p><a href="https://support.google.com/chrome?p=dh_error&" target="_blank">Learn more</a> about this problem.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 31 --> <h3>Access to network-error was denied</h3> <p>The server hosting the web page might be overloaded or under maintenance. In order to avoid generating too much traffic and make the situation worse, requests to this URL have been temporarily disallowed.</p> <p class="error-code">[[message]]</p> </section> <section> <!-- 32 --> <h3>The requested URL can't be reached</h3> <p>The service took too long to respond.</p> <p>Try</p> <ul> <li>Again...</li> <li>Checking the connection</li> <li>Checking the proxy and the firewall</li> </ul> <p class="error-code">[[message]]</p> <p><b>Check your Internet connection</b></p> <p>Check any cables and reboot any routers, modems or other network devices you may be using.</p> <p><b>Allow the browser to access the network in your firewall or antivirus settings.</b></p> <p>If it is already listed as a program allowed to access the network, try removing it from the list and adding it again.</p> <p><b>If you use a proxy server...</b></p> <p>Check your proxy settings or contact your network administrator to make sure that the proxy server is working. If you don't believe you should be using a proxy server: Go to the Chrome menu > Settings > + Show advanced settings > Change proxy settings... and make sure your configuration is set to "no proxy" or "direct."</p> </section> <section> <!-- 33 --> <h3>The requested URL isn’t working</h3> <p>The service redirected you too many times.</p> <p>Try</p> <ul> <li>Again...</li> <li>Clearing your cookies</li> </ul> <p class="error-code">[[message]]</p> <p><b>Clearing your cookies</b></p> <p>Go to app's settings and click on "Clear cookies".</p> </section> </iron-pages> </div> </div> </template> <script> Polymer({ is: 'response-error-view', properties: { /** * Message to display. * * The message can be one of the Chrome's net::* error codes. In this * case the element will display predefined message. */ message: { type: String, observer: '_messageChanged' }, /** * An icon to display. */ icon: { type: String, value: 'arc:sentiment-very-dissatisfied' }, // Opened detailed message page. detailsPage: Number }, ready: function() { if (this.detailsPage === undefined) { this.detailsPage = 0; } }, // handler to the message change event. _messageChanged: function(msg) { if (msg) { msg = msg.trim(); } switch (msg) { case 'net::ERR_CERT_AUTHORITY_INVALID': this.detailsPage = 1; break; case 'net::ERR_CONNECTION_REFUSED': this.detailsPage = 2; break; case 'net::ERR_CERT_COMMON_NAME_INVALID': this.detailsPage = 3; break; case 'Request aborted': this.detailsPage = 4; break; case 'net::ERR_ADDRESS_UNREACHABLE': this.detailsPage = 5; break; case 'net::ERR_BAD_SSL_CLIENT_AUTH_CERT': this.detailsPage = 6; break; case 'net::ERR_BLOCKED_BY_ADMINISTRATOR': this.detailsPage = 7; break; case 'net::ERR_BLOCKED_BY_CLIENT': this.detailsPage = 8; break; case 'net::ERR_BLOCKED_ENROLLMENT_CHECK_PENDING': this.detailsPage = 9; break; case 'net::ERR_CERT_CONTAINS_ERRORS': case 'net::ERR_CERT_DATE_INVALID': case 'net::ERR_CERT_END': case 'net::ERR_CERT_ERROR_IN_SSL_RENEGOTIATION': case 'net::ERR_CERT_INVALID': case 'net::ERR_CERT_NAME_CONSTRAINT_VIOLATION': case 'net::ERR_CERT_NON_UNIQUE_NAME': case 'net::ERR_CERT_NO_REVOCATION_MECHANISM': case 'net::ERR_CERT_REVOKED': case 'net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION': case 'net::ERR_CERT_VALIDITY_TOO_LONG': case 'net::ERR_CERT_WEAK_KEY': case 'net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM': this.detailsPage = 10; break; case 'net::ERR_CONNECTION_CLOSED': case 'net::ERR_CONNECTION_RESET': this.detailsPage = 11; break; case 'net::ERR_CONNECTION_FAILED': this.detailsPage = 12; break; case 'net::ERR_CONNECTION_REFUSED': this.detailsPage = 13; break; case 'net::ERR_CONNECTION_TIMED_OUT': this.detailsPage = 14; break; case 'net::ERR_CONTENT_LENGTH_MISMATCH': case 'net::ERR_INCOMPLETE_CHUNKED_ENCODING': this.detailsPage = 15; break; case 'net::ERR_FILE_NOT_FOUND': this.detailsPage = 16; break; case 'net::ERR_ICANN_NAME_COLLISION': this.detailsPage = 17; break; case 'net::ERR_INTERNET_DISCONNECTED': this.detailsPage = 18; break; case 'net::ERR_NAME_NOT_RESOLVED': this.detailsPage = 19; break; case 'net::ERR_NAME_RESOLUTION_FAILED': this.detailsPage = 20; break; case 'net::ERR_NETWORK_ACCESS_DENIED': this.detailsPage = 21; break; case 'net::ERR_NETWORK_CHANGED': this.detailsPage = 22; break; case 'net::ERR_NETWORK_IO_SUSPENDED': this.detailsPage = 23; break; case 'net::ERR_PROXY_CONNECTION_FAILED': this.detailsPage = 24; break; case 'net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION': case 'net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH': case 'net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION': this.detailsPage = 25; break; case 'net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION': case 'net::ERR_SSL_PROTOCOL_ERROR': this.detailsPage = 26; break; case 'net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN': this.detailsPage = 27; break; case 'net::ERR_SSL_SERVER_CERT_BAD_FORMAT': this.detailsPage = 28; break; case 'net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH': this.detailsPage = 29; break; case 'net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY': this.detailsPage = 30; break; case 'net::ERR_TEMPORARY_BACKOFF': this.detailsPage = 31; break; case 'net::ERR_TIMED_OUT': this.detailsPage = 32; break; case 'net::ERR_TOO_MANY_REDIRECTS': this.detailsPage = 33; break; default: this.detailsPage = 0; break; } } }); </script> </dom-module>