Add HTTPS warning

This commit is contained in:
Kane York
2015-06-30 21:21:14 -07:00
parent 1ea74847ae
commit 88d7fa955a
6 changed files with 26 additions and 10 deletions
@@ -46,8 +46,8 @@ const QueryResultComponent = Ember.Component.extend({
columnHandlers: function() {
const self = this;
if (!this.get('content')) {
return;
if (!this.get('columns')) {
return [];
}
if (self.get('opts.notransform')) {
return this.get('columns').map(function(colName) {
@@ -35,6 +35,14 @@ export default Ember.ArrayController.extend({
this.set('results', null);
},
not_https: function() {
return !(
window.location.protocol === "https:" ||
window.location.hostname === "localhost" ||
window.location.hostname.endsWith(".local")
);
}.property(),
actions: {
dummy() {},
@@ -1,5 +1,12 @@
<h2>Queries</h2>
{{#if not_https}}
<div class="https-warning">
{{fa-icon "warning"}}
{{i18n "explorer.https_warning"}}
</div>
{{/if}}
<div class="query-list">
{{combo-box valueAttribute="id" value=selectedQueryId nameProperty="listName" content=content castInteger="true" nameChanges="true"}}
{{d-button action="showCreate" icon="plus" class="no-text"}}
@@ -19,8 +26,6 @@
{{partial "admin/plugins-explorer-show" model=selectedItem}}
</div>
{{conditional-loading-spinner condition=loading}}
<div class="query-run">
{{#if selectedItem.param_names}}
<div class="query-params">
@@ -44,6 +49,8 @@
<hr>
{{conditional-loading-spinner condition=loading}}
{{#if results}}
<div class="query-results">
{{#if showResults}}