From 8b035ac68ee16773ddf2b37a2ad05f5630a6c998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 17 Dec 2024 14:39:43 +0100 Subject: [PATCH 01/15] test workflow --- .github/workflows/ubuntu_test.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ubuntu_test.yml diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml new file mode 100644 index 00000000..82a288ba --- /dev/null +++ b/.github/workflows/ubuntu_test.yml @@ -0,0 +1,51 @@ +name: ubuntu_test + +on: + workflow_dispatch: + push: + branches: + - ubuntu_test +jobs: + build_desktop: + name: Build desktop app for ${{ matrix.platform }} + strategy: + matrix: + platform: [ ubuntu-24.04 ] + runs-on: ${{ matrix.platform }} + env: + TAURI_SIGNING_PRIVATE_KEY: "${{ secrets.TAURI_PRIVATE_KEY }}" + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: "${{ secrets.TAURI_KEY_PASSWORD }}" + + steps: + ### system setup + + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '22.5.1' + cache: 'yarn' + + - run: yarn + + - run: rustup toolchain install stable + + - name: linux > install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + + ### build linux + + - name: linux > build + run: yarn tauri:build + + - name: linux > upload artifacts + uses: actions/upload-artifact@v4 + with: + name: linux_artifacts + if-no-files-found: error + path: | + src-tauri/target/release/bundle/deb/elasticvue_*_amd64.deb + src-tauri/target/release/bundle/appimage/elasticvue_*_amd64.* + src-tauri/target/release/elasticvue From 82e5aac2f9a4056785c72df19bc3d9775fec9595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 17 Dec 2024 15:00:14 +0100 Subject: [PATCH 02/15] try ubuntu-22.04 --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 82a288ba..652738a4 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -10,7 +10,7 @@ jobs: name: Build desktop app for ${{ matrix.platform }} strategy: matrix: - platform: [ ubuntu-24.04 ] + platform: [ ubuntu-22.04 ] runs-on: ${{ matrix.platform }} env: TAURI_SIGNING_PRIVATE_KEY: "${{ secrets.TAURI_PRIVATE_KEY }}" From 84b25c09f423155195f8b85d00dfbb00fd76e2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 17 Dec 2024 15:05:39 +0100 Subject: [PATCH 03/15] older version of libwebkit2gtk --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 652738a4..1e52b1e3 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.0-2 libwebkit2gtk-4.1-dev=2.44.0-2 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From 85260a184185ad05947f9f579b6d53fb044f6165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 17 Dec 2024 15:08:51 +0100 Subject: [PATCH 04/15] older version of libwebkit2gtk - 2.44.3-0 --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 1e52b1e3..a02df8a6 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.0-2 libwebkit2gtk-4.1-dev=2.44.0-2 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.3-0 libwebkit2gtk-4.1-dev=2.44.3-0 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From 535ff7ae075ba3ea246729f5ffa51d8419b3bdbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 17 Dec 2024 15:10:41 +0100 Subject: [PATCH 05/15] older version of libwebkit2gtk - 2.44.3 --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index a02df8a6..73ce6dca 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.3-0 libwebkit2gtk-4.1-dev=2.44.3-0 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.3 libwebkit2gtk-4.1-dev=2.44.3 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From cfde91b25472e660b56175228416f5b0965d38b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Fri, 20 Dec 2024 22:52:07 +0100 Subject: [PATCH 06/15] test ubuntu build with older webkit --- .github/workflows/ubuntu_test.yml | 2 +- src-tauri/src/lib.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 73ce6dca..8a042a5e 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.3 libwebkit2gtk-4.1-dev=2.44.3 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.0-37=2.36.0-2ubuntu1 libwebkit2gtk-4.0-dev=2.36.0-2ubuntu1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index efc4153d..bcbe5bbc 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -17,6 +17,8 @@ pub fn run() { env_logger::init(); let ctx = tauri::generate_context!(); + std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); + std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1"); tauri::Builder::default() .plugin(tauri_plugin_process::init()) From 6dc711df07d0b685ec9660e674af741ab48bcfa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Fri, 20 Dec 2024 22:53:41 +0100 Subject: [PATCH 07/15] more old versions --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 8a042a5e..e07d080b 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-37=2.36.0-2ubuntu1 libwebkit2gtk-4.0-dev=2.36.0-2ubuntu1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.0-37=2.36.0-2ubuntu1 libwebkit2gtk-4.0-dev=2.36.0-2ubuntu1 libjavascriptcoregtk-4.0-18=2.36.0-2ubuntu1 libjavascriptcoregtk-4.0-dev=2.36.0-2ubuntu1 gir1.2-javascriptcoregtk-4.0=2.36.0-2ubuntu1 gir1.2-webkit2-4.0=2.36.0-2ubuntu1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From ee4f88e2cbc5e50aeccb916841936860b5131bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Fri, 20 Dec 2024 23:04:48 +0100 Subject: [PATCH 08/15] more old versions --- .github/workflows/ubuntu_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index e07d080b..8bee573e 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -10,7 +10,7 @@ jobs: name: Build desktop app for ${{ matrix.platform }} strategy: matrix: - platform: [ ubuntu-22.04 ] + platform: [ ubuntu-24.04 ] runs-on: ${{ matrix.platform }} env: TAURI_SIGNING_PRIVATE_KEY: "${{ secrets.TAURI_PRIVATE_KEY }}" @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-37=2.36.0-2ubuntu1 libwebkit2gtk-4.0-dev=2.36.0-2ubuntu1 libjavascriptcoregtk-4.0-18=2.36.0-2ubuntu1 libjavascriptcoregtk-4.0-dev=2.36.0-2ubuntu1 gir1.2-javascriptcoregtk-4.0=2.36.0-2ubuntu1 gir1.2-webkit2-4.0=2.36.0-2ubuntu1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0 2.44.3-0ubuntu0.24.04.1 libwebkit2gtk-4.1-dev 2.44.3-0ubuntu0.24.04.1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From 585c0ac2a2a2aba67d5e0cc4b287aab958765bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Fri, 20 Dec 2024 23:06:45 +0100 Subject: [PATCH 09/15] more old versions --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 8bee573e..1d81d7fe 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0 2.44.3-0ubuntu0.24.04.1 libwebkit2gtk-4.1-dev 2.44.3-0ubuntu0.24.04.1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.3-0ubuntu0.24.04.1 libwebkit2gtk-4.1-dev=2.44.3-0ubuntu0.24.04.1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From 14b65899fbf009fb1c93c6a5c505b18a40039b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Fri, 20 Dec 2024 23:18:42 +0100 Subject: [PATCH 10/15] more old versions --- .github/workflows/ubuntu_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml index 1d81d7fe..583aa2ed 100644 --- a/.github/workflows/ubuntu_test.yml +++ b/.github/workflows/ubuntu_test.yml @@ -33,7 +33,7 @@ jobs: - name: linux > install dependencies run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.3-0ubuntu0.24.04.1 libwebkit2gtk-4.1-dev=2.44.3-0ubuntu0.24.04.1 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.0-2 libwebkit2gtk-4.1-dev=2.44.0-2 libjavascriptcoregtk-4.1-0=2.44.0-2 libjavascriptcoregtk-4.1-dev=2.44.0-2 gir1.2-javascriptcoregtk-4.1=2.44.0-2 gir1.2-webkit2-4.1=2.44.0-2 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build linux From 8f693a11bd933d7c93d1ff527a61419e33cb17b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Sat, 21 Dec 2024 15:44:28 +0100 Subject: [PATCH 11/15] remove unused workflow --- .github/workflows/ubuntu_test.yml | 51 ------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 .github/workflows/ubuntu_test.yml diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ubuntu_test.yml deleted file mode 100644 index 583aa2ed..00000000 --- a/.github/workflows/ubuntu_test.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: ubuntu_test - -on: - workflow_dispatch: - push: - branches: - - ubuntu_test -jobs: - build_desktop: - name: Build desktop app for ${{ matrix.platform }} - strategy: - matrix: - platform: [ ubuntu-24.04 ] - runs-on: ${{ matrix.platform }} - env: - TAURI_SIGNING_PRIVATE_KEY: "${{ secrets.TAURI_PRIVATE_KEY }}" - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: "${{ secrets.TAURI_KEY_PASSWORD }}" - - steps: - ### system setup - - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '22.5.1' - cache: 'yarn' - - - run: yarn - - - run: rustup toolchain install stable - - - name: linux > install dependencies - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.0-2 libwebkit2gtk-4.1-dev=2.44.0-2 libjavascriptcoregtk-4.1-0=2.44.0-2 libjavascriptcoregtk-4.1-dev=2.44.0-2 gir1.2-javascriptcoregtk-4.1=2.44.0-2 gir1.2-webkit2-4.1=2.44.0-2 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev - - ### build linux - - - name: linux > build - run: yarn tauri:build - - - name: linux > upload artifacts - uses: actions/upload-artifact@v4 - with: - name: linux_artifacts - if-no-files-found: error - path: | - src-tauri/target/release/bundle/deb/elasticvue_*_amd64.deb - src-tauri/target/release/bundle/appimage/elasticvue_*_amd64.* - src-tauri/target/release/elasticvue From 2cc65cfbb40fa001eb8b306ad53c4948d6f64ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Sat, 21 Dec 2024 16:26:46 +0100 Subject: [PATCH 12/15] adds support for date math in index names, fixes #267 --- CHANGELOG.md | 5 +++ .../components/rest/RestQueryForm.ts | 9 +++-- src/helpers/cleanIndexName.ts | 14 +++++++ src/services/ElasticsearchAdapter.ts | 28 ++++--------- tests/unit/helpers/cleanIndexName.spec.ts | 39 +++++++++++++++++++ 5 files changed, 70 insertions(+), 25 deletions(-) create mode 100644 src/helpers/cleanIndexName.ts create mode 100644 tests/unit/helpers/cleanIndexName.spec.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 162500d5..b39414ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# 1.2.0 + +* adds support for date math in index names. You can use something like `` as your index name, when +searching and also in the `REST` view. fixes [#267](https://github.com/cars10/elasticvue/issues/267) + ## 1.1.2 This version re-adds the automatic updater for the desktop app. Since the update to tauri 2.0 diff --git a/src/composables/components/rest/RestQueryForm.ts b/src/composables/components/rest/RestQueryForm.ts index de2d110f..45c61795 100644 --- a/src/composables/components/rest/RestQueryForm.ts +++ b/src/composables/components/rest/RestQueryForm.ts @@ -9,6 +9,7 @@ import { fetchMethod } from '../../../helpers/fetch' import { IdbRestQueryTab, IdbRestQueryTabRequest } from '../../../db/types.ts' import { debounce } from '../../../helpers/debounce.ts' import { parseKibana } from '../../../helpers/parseKibana.ts' +import { cleanIndexName } from '../../../helpers/cleanIndexName.ts' type RestQueryFormProps = { tab: IdbRestQueryTab @@ -48,7 +49,7 @@ export const useRestQueryForm = (props: RestQueryFormProps, emit: any) => { let url = connectionStore.activeCluster.uri if (!url.endsWith('/') && !props.tab.request.path.startsWith('/')) url += '/' - url += props.tab.request.path + url += cleanIndexName(props.tab.request.path) try { const fetchResponse = await fetchMethod(url, options) @@ -143,11 +144,11 @@ export const useRestQueryForm = (props: RestQueryFormProps, emit: any) => { const onPaste = (data: string) => { const kibanaRequest = parseKibana(data) - nextTick(() => { + nextTick(() => { if (kibanaRequest.method) { ownTab.value.request.method = kibanaRequest.method - ownTab.value.request.path = kibanaRequest.path || '' - ownTab.value.request.body = kibanaRequest.body || '' + ownTab.value.request.path = kibanaRequest.path || '' + ownTab.value.request.body = kibanaRequest.body || '' } }) } diff --git a/src/helpers/cleanIndexName.ts b/src/helpers/cleanIndexName.ts new file mode 100644 index 00000000..e2cdc036 --- /dev/null +++ b/src/helpers/cleanIndexName.ts @@ -0,0 +1,14 @@ +export const cleanIndexName = (index: string) => { + return index.replace(/%/g, '%25').replace(/<.*?>/g, (match) => { + return match + .replace(//g, '%3E') + .replace(/\//g, '%2F') + .replace(/\{/g, '%7B') + .replace(/\}/g, '%7D') + .replace(/\|/g, '%7C') + .replace(/\+/g, '%2B') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C') + }) +} diff --git a/src/services/ElasticsearchAdapter.ts b/src/services/ElasticsearchAdapter.ts index c9b137b3..e9d2d03c 100644 --- a/src/services/ElasticsearchAdapter.ts +++ b/src/services/ElasticsearchAdapter.ts @@ -3,6 +3,7 @@ import { REQUEST_DEFAULT_HEADERS } from '../consts' import { fetchMethod } from '../helpers/fetch' import { stringifyJson } from '../helpers/json/stringify.ts' import { ElasticsearchClusterCredentials } from '../store/connection.ts' +import { cleanIndexName } from '../helpers/cleanIndexName.ts' interface IndexGetArgs { routing?: string @@ -131,7 +132,7 @@ export default class ElasticsearchAdapter { if (indices.length > MAX_INDICES_PER_REQUEST) { return this.callInChunks({ method: 'indexClose', indices }) } else { - return this.request(`${indices.join(',')}/_close`, 'POST') + return this.request(`${cleanIndexName(indices.join(','))}/_close`, 'POST') } } @@ -139,7 +140,7 @@ export default class ElasticsearchAdapter { if (indices.length > MAX_INDICES_PER_REQUEST) { return this.callInChunks({ method: 'indexOpen', indices }) } else { - return this.request(`${indices.join(',')}/_open`, 'POST') + return this.request(`${cleanIndexName(indices.join(','))}/_open`, 'POST') } } @@ -147,7 +148,7 @@ export default class ElasticsearchAdapter { if (indices.length > MAX_INDICES_PER_REQUEST) { return this.callInChunks({ method: 'indexForcemerge', indices }) } else { - return this.request(`${indices.join(',')}/_forcemerge`, 'POST') + return this.request(`${cleanIndexName(indices.join(','))}/_forcemerge`, 'POST') } } @@ -155,7 +156,7 @@ export default class ElasticsearchAdapter { if (indices.length > MAX_INDICES_PER_REQUEST) { return this.callInChunks({ method: 'indexRefresh', indices }) } else { - return this.request(`${indices.join(',')}/_refresh`, 'POST') + return this.request(`${cleanIndexName(indices.join(','))}/_refresh`, 'POST') } } @@ -163,7 +164,7 @@ export default class ElasticsearchAdapter { if (indices.length > MAX_INDICES_PER_REQUEST) { return this.callInChunks({ method: 'indexClearCache', indices }) } else { - return this.request(`${indices.join(',')}/_cache/clear`, 'POST') + return this.request(`${cleanIndexName(indices.join(','))}/_cache/clear`, 'POST') } } @@ -171,7 +172,7 @@ export default class ElasticsearchAdapter { if (indices.length > MAX_INDICES_PER_REQUEST) { return this.callInChunks({ method: 'indexFlush', indices }) } else { - return this.request(`${indices.join(',')}/_flush`, 'POST') + return this.request(`${cleanIndexName(indices.join(','))}/_flush`, 'POST') } } @@ -316,19 +317,4 @@ export default class ElasticsearchAdapter { return Promise.reject(e) } } - - /********/ - - /** - * Creates multiple indices, one for each word. Only creates if they do not already exist - * @param names {Array} - */ - async createIndices (names: string[]) { - for (const name of [...new Set(names)]) { - const exists = await this.indexExists({ index: name }) - if (!exists) await this.indexCreate({ index: name }) - } - } } - -const cleanIndexName = (index: string) => (index.replace(/%/g, '%25')) diff --git a/tests/unit/helpers/cleanIndexName.spec.ts b/tests/unit/helpers/cleanIndexName.spec.ts new file mode 100644 index 00000000..546e29f3 --- /dev/null +++ b/tests/unit/helpers/cleanIndexName.spec.ts @@ -0,0 +1,39 @@ +import { describe, it, expect } from 'vitest' +import { cleanIndexName } from '../../../src/helpers/cleanIndexName' + +describe.concurrent('helpers/cleanIndexName.ts', () => { + it('should do nothing when no special characters are present', () => { + const indexNames = [ + '', + 'movies', + 'kube-2024.12.21' + ] + indexNames.forEach(indexName => { + expect(cleanIndexName(indexName)).toBe(indexName) + }) + }) + + it('should encode special characters inside < and >', () => { + const indexName = 'foo//_doc' + const cleanedName = 'foo/%3Ckube-%7Bnow%2Fd%7D%3E/_doc' + expect(cleanIndexName(indexName)).toBe(cleanedName) + }) + + it('should encode multiple <...> segments correctly', () => { + const indexName = 'foo//bar/' + const cleanedName = 'foo/%3Ckube-%7Bnow%2Fd%7D%3E/bar/%3Cbaz%2Bfoo%3E' + expect(cleanIndexName(indexName)).toBe(cleanedName) + }) + + it('should encode % everywhere, but other characters only inside < and >', () => { + const indexName = 'foo/%//bar' + const cleanedName = 'foo/%25/%3Ckube%25%2B%3E/bar' + expect(cleanIndexName(indexName)).toBe(cleanedName) + }) + + it('should not encode characters outside of < and >', () => { + const indexName = 'movies/kube+foo/bar' + const cleanedName = 'movies/kube+foo/bar' + expect(cleanIndexName(indexName)).toBe(cleanedName) + }) +}) From 421c185bb69eef7ff2a05916e3e912c555c3d924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Sat, 21 Dec 2024 19:05:58 +0100 Subject: [PATCH 13/15] fix ui bug when relocating shards --- src/assets/stylesheets/style.scss | 1 - .../stylesheets/theme/components/shards.css | 17 ----------------- src/components/shards/ShardsTable.vue | 12 ++++++------ 3 files changed, 6 insertions(+), 24 deletions(-) delete mode 100644 src/assets/stylesheets/theme/components/shards.css diff --git a/src/assets/stylesheets/style.scss b/src/assets/stylesheets/style.scss index a23dc9fe..b12ee533 100644 --- a/src/assets/stylesheets/style.scss +++ b/src/assets/stylesheets/style.scss @@ -16,7 +16,6 @@ @import 'theme/components/list'; @import 'theme/components/reload_button'; @import 'theme/components/resizable'; -@import 'theme/components/shards'; @import 'theme/components/snackbar'; @import 'theme/components/table'; @import 'theme/components/text'; diff --git a/src/assets/stylesheets/theme/components/shards.css b/src/assets/stylesheets/theme/components/shards.css deleted file mode 100644 index 4e27ed90..00000000 --- a/src/assets/stylesheets/theme/components/shards.css +++ /dev/null @@ -1,17 +0,0 @@ -.shard-reroute-target { - background-color: transparent; - position: absolute; - height: 100%; - width: 100%; - top: 0; - left: 0; - right: 0; - bottom: 0; - border: 2px dashed grey; - color: var(--theme-muted-color) !important; -} - -.shard-reroute-target:hover { - background-color: rgba(150, 150, 150, 0.5); - cursor: pointer; -} \ No newline at end of file diff --git a/src/components/shards/ShardsTable.vue b/src/components/shards/ShardsTable.vue index 9925c284..37911278 100644 --- a/src/components/shards/ShardsTable.vue +++ b/src/components/shards/ShardsTable.vue @@ -80,6 +80,12 @@ :class="{marked: markedColumnIndex === i}" @mouseover="markColumn(i)" @mouseleave="unmarkColumn"> +
+ + {{ t('shards.shards_table.reroute.label', { node: row }) }} + +
+
- -
- -
From 1665350ca2d9e339340f5ad0c350924f68af1b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Sun, 22 Dec 2024 11:06:27 +0100 Subject: [PATCH 14/15] use older dependency versions in linux build --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b375e087..ec05643b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.0-2 libwebkit2gtk-4.1-dev=2.44.0-2 libjavascriptcoregtk-4.1-0=2.44.0-2 libjavascriptcoregtk-4.1-dev=2.44.0-2 gir1.2-javascriptcoregtk-4.1=2.44.0-2 gir1.2-webkit2-4.1=2.44.0-2 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev ### build apple arm From d57e142278a580cae6fedccff6e0ceaa21e7d386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Sun, 22 Dec 2024 11:06:51 +0100 Subject: [PATCH 15/15] bumps version to 1.2.0 --- browser_extension/chrome/manifest.json | 2 +- browser_extension/firefox/manifest.json | 2 +- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/browser_extension/chrome/manifest.json b/browser_extension/chrome/manifest.json index a75424b4..69871a00 100644 --- a/browser_extension/chrome/manifest.json +++ b/browser_extension/chrome/manifest.json @@ -1,6 +1,6 @@ { "name": "Elasticvue", - "version": "1.1.2", + "version": "1.2.0", "description": "Elasticsearch frontend", "manifest_version": 3, "icons": { diff --git a/browser_extension/firefox/manifest.json b/browser_extension/firefox/manifest.json index 1d2cdb1c..d85ed41c 100644 --- a/browser_extension/firefox/manifest.json +++ b/browser_extension/firefox/manifest.json @@ -1,6 +1,6 @@ { "name": "Elasticvue", - "version": "1.1.2", + "version": "1.2.0", "description": "Elasticsearch frontend", "manifest_version": 2, "icons": { diff --git a/package.json b/package.json index 431a7748..a6dba8b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elasticvue", "private": true, - "version": "1.1.2", + "version": "1.2.0", "scripts": { "dev": "vite", "build": "vite build", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 76408f30..6e3b1446 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -42,7 +42,7 @@ }, "productName": "elasticvue", "mainBinaryName": "elasticvue", - "version": "1.1.2", + "version": "1.2.0", "identifier": "com.elasticvue.app", "plugins": { "updater": {