Add updated Leafcutter app
This commit is contained in:
parent
60f6061d49
commit
38343f4219
10 changed files with 3391 additions and 20 deletions
|
|
@ -119,12 +119,22 @@ export const saveUserMetadata = async (username: string, metadata: any) => {
|
|||
const getCurrentUserIndex = async (email: string) => {
|
||||
const userIndexName = email.replace(/[\W\d_]/g, "").toLowerCase();
|
||||
const client = createClient();
|
||||
const aliasesResponse = await client.indices.getAlias({
|
||||
name: `.kibana_*_${userIndexName}`,
|
||||
});
|
||||
|
||||
// prefer alias if it exists
|
||||
if (Object.keys(aliasesResponse.body).length > 0) {
|
||||
return Object.keys(aliasesResponse.body)[0];
|
||||
}
|
||||
|
||||
const indicesResponse = await client.indices.get({
|
||||
index: `.kibana_*_${userIndexName}_1`,
|
||||
})
|
||||
const currentUserIndex = Object.keys(indicesResponse.body)[0];
|
||||
|
||||
return currentUserIndex;
|
||||
};
|
||||
}
|
||||
|
||||
const getIndexPattern = async (index: string) => {
|
||||
const client = createClient();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue