mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Merge branch 'master' into feature/tooltip
This commit is contained in:
commit
a9748c2c23
12 changed files with 70 additions and 60 deletions
|
@ -91,7 +91,7 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<div class="form-group" ng-if="index.isTimeBased">
|
||||
<div class="form-group" ng-if="index.isTimeBased && !index.fetchFieldsError">
|
||||
<label>
|
||||
Time-field name
|
||||
|
||||
|
@ -108,16 +108,14 @@
|
|||
ng-model="index.timeField"
|
||||
class="form-control">
|
||||
</select>
|
||||
<select ng-if="index.fetchFieldsError" class="form-control" disabled >
|
||||
<option>{{index.fetchFieldsError}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button
|
||||
ng-disabled="form.$invalid || index.fetchFieldsError"
|
||||
ng-class="index.fetchFieldsError ? 'btn-default' : 'btn-success'"
|
||||
type="submit"
|
||||
class="btn btn-success">
|
||||
{{index.fetchFieldsError ? "No indices found" : "Create" }}
|
||||
class="btn">
|
||||
{{index.fetchFieldsError || "Create" }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -76,7 +76,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
$scope.refreshFieldList = _.debounce(function () {
|
||||
index.dateFields = index.timeField = index.fetchFieldsError = index.listUsed = null;
|
||||
index.dateFields = index.timeField = index.listUsed = null;
|
||||
var useIndexList = index.isTimeBased && index.nameIsPattern;
|
||||
|
||||
// we don't have enough info to continue
|
||||
|
@ -118,9 +118,12 @@ define(function (require) {
|
|||
});
|
||||
})
|
||||
.then(function (fields) {
|
||||
index.dateFields = fields.filter(function (field) {
|
||||
return field.type === 'date';
|
||||
});
|
||||
if (fields.length > 0) {
|
||||
index.fetchFieldsError = null;
|
||||
index.dateFields = fields.filter(function (field) {
|
||||
return field.type === 'date';
|
||||
});
|
||||
}
|
||||
}, notify.fatal);
|
||||
}, 50, { leading: true, trailing: false });
|
||||
|
||||
|
|
|
@ -26,30 +26,31 @@
|
|||
|
||||
<!-- controls !!!actually disabling buttons will break tooltips¡¡¡ -->
|
||||
<div class="vis-editor-agg-header-controls btn-group">
|
||||
<!-- up button -->
|
||||
<button
|
||||
ng-if="group.length > 1"
|
||||
ng-class="{ disabled: $first }"
|
||||
ng-click="moveUp(agg)"
|
||||
tooltip="Increase Priority"
|
||||
tooltip-append-to-body="true"
|
||||
|
||||
type="button"
|
||||
class="btn btn-xs btn-default">
|
||||
<i class="fa fa-caret-up"></i>
|
||||
</button>
|
||||
|
||||
<!-- down button -->
|
||||
<button
|
||||
ng-if="group.length > 1"
|
||||
ng-class="{ disabled: $last }"
|
||||
ng-click="moveDown(agg)"
|
||||
tooltip="Decrease Priority"
|
||||
tooltip-append-to-body="true"
|
||||
|
||||
type="button"
|
||||
class="btn btn-xs btn-default">
|
||||
<i class="fa fa-caret-down"></i>
|
||||
</button>
|
||||
|
||||
<!-- remove button -->
|
||||
<button
|
||||
ng-if="group.length > groupMin"
|
||||
ng-click="remove(agg)"
|
||||
|
|
|
@ -19,7 +19,6 @@ define(function (require) {
|
|||
link: function ($scope) {
|
||||
$scope.hideErrors = true;
|
||||
$scope.dontApply = function () {
|
||||
console.log('showing validation');
|
||||
$scope.hideErrors = false;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,5 +14,7 @@
|
|||
required
|
||||
type="number"
|
||||
class="form-control"
|
||||
name="interval" />
|
||||
name="interval"
|
||||
min="0"
|
||||
>
|
||||
</div>
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
ng-model="params.size"
|
||||
required
|
||||
class="form-control"
|
||||
type="number">
|
||||
type="number"
|
||||
min="0"
|
||||
>
|
||||
</div>
|
||||
</div>
|
|
@ -4,7 +4,7 @@ define(function (require) {
|
|||
|
||||
var inherits = require('lodash').inherits;
|
||||
|
||||
return function DocSourceFactory(Private, Promise, es, storage) {
|
||||
return function DocSourceFactory(Private, Promise, es, sessionStorage) {
|
||||
var sendToEs = Private(require('components/courier/data_source/_doc_send_to_es'));
|
||||
var SourceAbstract = Private(require('components/courier/data_source/_abstract'));
|
||||
|
||||
|
@ -123,7 +123,7 @@ define(function (require) {
|
|||
var key = this._versionKey();
|
||||
if (!key) return;
|
||||
|
||||
var v = storage.get(key);
|
||||
var v = sessionStorage.get(key);
|
||||
this._version = v ? _.parseInt(v) : void 0;
|
||||
return this._version;
|
||||
};
|
||||
|
@ -139,7 +139,7 @@ define(function (require) {
|
|||
var key = this._versionKey();
|
||||
if (!key) return;
|
||||
this._version = version;
|
||||
storage.set(key, version);
|
||||
sessionStorage.set(key, version);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -148,7 +148,7 @@ define(function (require) {
|
|||
DocSource.prototype._clearVersion = function () {
|
||||
var key = this._versionKey();
|
||||
if (!key) return;
|
||||
storage.remove(key);
|
||||
sessionStorage.remove(key);
|
||||
};
|
||||
|
||||
return DocSource;
|
||||
|
|
|
@ -3,13 +3,13 @@ define(function (require) {
|
|||
var _ = require('lodash');
|
||||
|
||||
modules.get('kibana/persisted_log')
|
||||
.factory('PersistedLog', function ($window, storage) {
|
||||
.factory('PersistedLog', function ($window, localStorage) {
|
||||
function PersistedLog(name, options) {
|
||||
options = options || {};
|
||||
this.name = name;
|
||||
this.maxLength = options.maxLength || 0;
|
||||
this.filterDuplicates = options.filterDuplicates || false;
|
||||
this.items = storage.get(this.name) || [];
|
||||
this.items = localStorage.get(this.name) || [];
|
||||
}
|
||||
|
||||
PersistedLog.prototype.add = function (val) {
|
||||
|
@ -35,7 +35,7 @@ define(function (require) {
|
|||
}
|
||||
|
||||
// persist the stack
|
||||
storage.set(this.name, stack);
|
||||
localStorage.set(this.name, stack);
|
||||
return this.items = stack;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,37 +1,42 @@
|
|||
define(function (require) {
|
||||
var modules = require('modules');
|
||||
|
||||
function Storage(store) {
|
||||
var self = this;
|
||||
self.store = store;
|
||||
|
||||
self.get = function (key) {
|
||||
try {
|
||||
return JSON.parse(self.store.getItem(key));
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
self.set = function (key, value) {
|
||||
try {
|
||||
return self.store.setItem(key, JSON.stringify(value));
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
self.remove = function (key) {
|
||||
return self.store.removeItem(key);
|
||||
};
|
||||
|
||||
self.clear = function () {
|
||||
return self.store.clear();
|
||||
};
|
||||
}
|
||||
|
||||
var createService = function (type) {
|
||||
return function ($window) {
|
||||
return new Storage($window[type]);
|
||||
};
|
||||
};
|
||||
|
||||
modules.get('kibana/storage')
|
||||
.service('storage', function ($window) {
|
||||
function Storage() {
|
||||
var self = this;
|
||||
self.store = $window.localStorage;
|
||||
|
||||
self.get = function (key) {
|
||||
try {
|
||||
return JSON.parse(self.store.getItem(key));
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
self.set = function (key, value) {
|
||||
try {
|
||||
return self.store.setItem(key, JSON.stringify(value));
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
self.remove = function (key) {
|
||||
return self.store.removeItem(key);
|
||||
};
|
||||
|
||||
self.clear = function () {
|
||||
return self.store.clear();
|
||||
};
|
||||
}
|
||||
|
||||
return new Storage();
|
||||
});
|
||||
.service('localStorage', createService('localStorage'))
|
||||
.service('sessionStorage', createService('sessionStorage'));
|
||||
});
|
|
@ -94,7 +94,7 @@ define(function (require) {
|
|||
config.init()
|
||||
]).then(function () {
|
||||
$scope.setupComplete = true;
|
||||
$injector.invoke(function ($rootScope, courier, config, configFile, storage, $timeout, $location, timefilter, globalState) {
|
||||
$injector.invoke(function ($rootScope, courier, config, configFile, sessionStorage, $timeout, $location, timefilter, globalState) {
|
||||
|
||||
$rootScope.globalState = globalState;
|
||||
|
||||
|
@ -102,11 +102,11 @@ define(function (require) {
|
|||
var lastPathFor = function (app, path) {
|
||||
var key = 'lastPath:' + app.id;
|
||||
if (path === void 0) {
|
||||
app.lastPath = storage.get(key) || '/' + app.id;
|
||||
app.lastPath = sessionStorage.get(key) || '/' + app.id;
|
||||
return app.lastPath;
|
||||
} else {
|
||||
app.lastPath = path;
|
||||
return storage.set(key, path);
|
||||
return sessionStorage.set(key, path);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ define(function (require) {
|
|||
function init() {
|
||||
module('kibana/persisted_log', function ($provide) {
|
||||
// mock storage service
|
||||
$provide.service('storage', function () {
|
||||
$provide.service('localStorage', function () {
|
||||
this.get = sinon.stub();
|
||||
this.set = sinon.stub();
|
||||
this.remove = sinon.spy();
|
||||
|
@ -27,7 +27,7 @@ define(function (require) {
|
|||
});
|
||||
|
||||
inject(function ($injector) {
|
||||
storage = $injector.get('storage');
|
||||
storage = $injector.get('localStorage');
|
||||
PersistedLog = $injector.get('PersistedLog');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ define(function (require) {
|
|||
});
|
||||
|
||||
inject(function ($injector) {
|
||||
storage = $injector.get('storage');
|
||||
storage = $injector.get('localStorage');
|
||||
$window = $injector.get('$window');
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue