mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Avoid fetching IPs twice
This commit is contained in:
parent
514397fe2b
commit
092803d428
@ -20,7 +20,11 @@ export class PatternHandler {
|
||||
|
||||
async getPatternList() {
|
||||
try {
|
||||
const patternList = await this.genericReq.request('GET', '/elastic/index-patterns', {});
|
||||
const patternList = await this.genericReq.request(
|
||||
'GET',
|
||||
'/elastic/index-patterns',
|
||||
{}
|
||||
);
|
||||
|
||||
if (!patternList.data.data.length) {
|
||||
this.wzMisc.setBlankScr('Sorry but no valid index patterns were found');
|
||||
|
@ -39,14 +39,14 @@ export function getIp(
|
||||
|
||||
const { savedObjects } = savedObjectsData;
|
||||
|
||||
const data = await genericReq.request('GET', '/elastic/index-patterns');
|
||||
|
||||
let currentPattern = '';
|
||||
|
||||
if (appState.getCurrentPattern()) {
|
||||
// There's cookie for the pattern
|
||||
currentPattern = appState.getCurrentPattern();
|
||||
} else {
|
||||
const data = await genericReq.request('GET', '/elastic/index-patterns');
|
||||
|
||||
if (!data || !data.data || !data.data.data || !data.data.data.length) {
|
||||
wzMisc.setBlankScr('Sorry but no valid index patterns were found');
|
||||
$location.search('tab', null);
|
||||
|
Loading…
Reference in New Issue
Block a user