mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
refatoring: minor changes to PR #13149
This commit is contained in:
parent
777010b20b
commit
dc236b5063
@ -130,9 +130,8 @@ export class SearchCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const max = flattenedResult.length;
|
const max = flattenedResult.length;
|
||||||
let newIndex = this.selectedIndex + direction;
|
const newIndex = (this.selectedIndex + direction) % max;
|
||||||
const something = (newIndex %= max);
|
this.selectedIndex = newIndex < 0 ? newIndex + max : newIndex;
|
||||||
this.selectedIndex = something < 0 ? newIndex + max : newIndex;
|
|
||||||
const selectedItem = flattenedResult[this.selectedIndex];
|
const selectedItem = flattenedResult[this.selectedIndex];
|
||||||
|
|
||||||
if (selectedItem.dashboardIndex === undefined && this.results[selectedItem.folderIndex].id === 0) {
|
if (selectedItem.dashboardIndex === undefined && this.results[selectedItem.folderIndex].id === 0) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
|
import locationUtil from 'app/core/utils/location_util';
|
||||||
|
|
||||||
export class DashboardImportCtrl {
|
export class DashboardImportCtrl {
|
||||||
navModel: any;
|
navModel: any;
|
||||||
@ -179,7 +180,8 @@ export class DashboardImportCtrl {
|
|||||||
folderId: this.folderId,
|
folderId: this.folderId,
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$location.url(res.importedUrl);
|
const dashUrl = locationUtil.stripBaseFromUrl(res.importedUrl);
|
||||||
|
this.$location.url(dashUrl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +37,14 @@ function uploadDashboardDirective(timer, alertSrv, $location) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let f = files[i];
|
let file = files[i];
|
||||||
for (i; f; i++) {
|
|
||||||
|
while (file) {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.onload = readerOnload();
|
reader.onload = readerOnload();
|
||||||
reader.readAsText(f);
|
reader.readAsText(file);
|
||||||
f = files[i];
|
i += 1;
|
||||||
|
file = files[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,6 +192,10 @@
|
|||||||
&:hover,
|
&:hover,
|
||||||
&.selected {
|
&.selected {
|
||||||
background: $list-item-hover-bg;
|
background: $list-item-hover-bg;
|
||||||
|
|
||||||
|
.search-item__body-title {
|
||||||
|
color: $text-color-strong;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user