Skip to content

Commit c440c91

Browse files
committed
automatic merge to finish v1.1.2
2 parents 1e91bbe + 5ad13c0 commit c440c91

File tree

23 files changed

+265
-21
lines changed

23 files changed

+265
-21
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.1.2
4+
5+
This version re-adds the automatic updater for the desktop app. Since the update to tauri 2.0
6+
(done in elasticvue `1.1.0`) the automatic updater was missing. You need to manually install a new version of elasticvue
7+
if you are using the desktop app. Sorry for the inconvenience.
8+
39
## 1.1.1
410

511
* truncate long fields in search results table, fixes [#211](https://github.com/cars10/elasticvue/issues/211)

browser_extension/chrome/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Elasticvue",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Elasticsearch frontend",
55
"manifest_version": 3,
66
"icons": {

browser_extension/firefox/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Elasticvue",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Elasticsearch frontend",
55
"manifest_version": 2,
66
"icons": {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "elasticvue",
33
"private": true,
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
@@ -28,6 +28,7 @@
2828
"@tauri-apps/plugin-clipboard-manager": "2.0.1",
2929
"@tauri-apps/plugin-dialog": "^2.0.1",
3030
"@tauri-apps/plugin-fs": "^2.0.3",
31+
"@tauri-apps/plugin-process": "~2",
3132
"@tauri-apps/plugin-updater": "^2.0.0",
3233
"codemirror": "^6.0.1",
3334
"idb": "^8.0.0",

src-tauri/Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env_logger = "0.11.3"
2626
tauri-plugin-fs = "2"
2727
tauri-plugin-dialog = "2"
2828
tauri-plugin-clipboard-manager = "2"
29+
tauri-plugin-process = "2"
2930

3031
[features]
3132
# by default Tauri runs in production mode

src-tauri/capabilities/desktop.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"linux"
77
],
88
"permissions": [
9-
"updater:default"
9+
"updater:default",
10+
"process:default"
1011
]
1112
}

src-tauri/capabilities/migrated.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
"core:app:allow-app-hide",
6161
"fs:default",
6262
"dialog:default",
63-
"clipboard-manager:default"
63+
"clipboard-manager:default",
64+
"process:default",
65+
"updater:default"
6466
]
6567
}

src-tauri/gen/schemas/acl-manifests.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"permissions":["updater:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","fs:default","dialog:default","clipboard-manager:default"]}}
1+
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"permissions":["updater:default","process:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","fs:default","dialog:default","clipboard-manager:default","process:default","updater:default"]}}

src-tauri/gen/schemas/desktop-schema.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4728,6 +4728,31 @@
47284728
"type": "string",
47294729
"const": "fs:write-files"
47304730
},
4731+
{
4732+
"description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n",
4733+
"type": "string",
4734+
"const": "process:default"
4735+
},
4736+
{
4737+
"description": "Enables the exit command without any pre-configured scope.",
4738+
"type": "string",
4739+
"const": "process:allow-exit"
4740+
},
4741+
{
4742+
"description": "Enables the restart command without any pre-configured scope.",
4743+
"type": "string",
4744+
"const": "process:allow-restart"
4745+
},
4746+
{
4747+
"description": "Denies the exit command without any pre-configured scope.",
4748+
"type": "string",
4749+
"const": "process:deny-exit"
4750+
},
4751+
{
4752+
"description": "Denies the restart command without any pre-configured scope.",
4753+
"type": "string",
4754+
"const": "process:deny-restart"
4755+
},
47314756
{
47324757
"description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n",
47334758
"type": "string",

src-tauri/gen/schemas/linux-schema.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4728,6 +4728,31 @@
47284728
"type": "string",
47294729
"const": "fs:write-files"
47304730
},
4731+
{
4732+
"description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n",
4733+
"type": "string",
4734+
"const": "process:default"
4735+
},
4736+
{
4737+
"description": "Enables the exit command without any pre-configured scope.",
4738+
"type": "string",
4739+
"const": "process:allow-exit"
4740+
},
4741+
{
4742+
"description": "Enables the restart command without any pre-configured scope.",
4743+
"type": "string",
4744+
"const": "process:allow-restart"
4745+
},
4746+
{
4747+
"description": "Denies the exit command without any pre-configured scope.",
4748+
"type": "string",
4749+
"const": "process:deny-exit"
4750+
},
4751+
{
4752+
"description": "Denies the restart command without any pre-configured scope.",
4753+
"type": "string",
4754+
"const": "process:deny-restart"
4755+
},
47314756
{
47324757
"description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n",
47334758
"type": "string",

src-tauri/gen/schemas/macOS-schema.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4728,6 +4728,31 @@
47284728
"type": "string",
47294729
"const": "fs:write-files"
47304730
},
4731+
{
4732+
"description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n",
4733+
"type": "string",
4734+
"const": "process:default"
4735+
},
4736+
{
4737+
"description": "Enables the exit command without any pre-configured scope.",
4738+
"type": "string",
4739+
"const": "process:allow-exit"
4740+
},
4741+
{
4742+
"description": "Enables the restart command without any pre-configured scope.",
4743+
"type": "string",
4744+
"const": "process:allow-restart"
4745+
},
4746+
{
4747+
"description": "Denies the exit command without any pre-configured scope.",
4748+
"type": "string",
4749+
"const": "process:deny-exit"
4750+
},
4751+
{
4752+
"description": "Denies the restart command without any pre-configured scope.",
4753+
"type": "string",
4754+
"const": "process:deny-restart"
4755+
},
47314756
{
47324757
"description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n",
47334758
"type": "string",

src-tauri/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub fn run() {
1919
let ctx = tauri::generate_context!();
2020

2121
tauri::Builder::default()
22+
.plugin(tauri_plugin_process::init())
2223
.plugin(tauri_plugin_updater::Builder::new().build())
2324
.plugin(tauri_plugin_clipboard_manager::init())
2425
.plugin(tauri_plugin_dialog::init())

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"productName": "elasticvue",
4444
"mainBinaryName": "elasticvue",
45-
"version": "1.1.1",
45+
"version": "1.1.2",
4646
"identifier": "com.elasticvue.app",
4747
"plugins": {
4848
"updater": {

src/App.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<modal-loader />
1919
<alert-snackbar />
20+
<update-check v-if="buildConfig.tauri" />
2021

2122
<app-footer />
2223
</q-layout>
@@ -33,6 +34,8 @@
3334
import { useThemeStore } from './store/theme.ts'
3435
import { useConnectionStore } from './store/connection'
3536
import { setAppThemeCss, setupThemeListener } from './helpers/theme.ts'
37+
import UpdateCheck from './components/base/UpdateCheck.vue'
38+
import { buildConfig } from './buildConfig.ts'
3639
3740
const themeStore = useThemeStore()
3841
const connectionStore = useConnectionStore()

src/components/base/AppFooter.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
</div>
88

99
<div class="col-md-4 text-center">
10-
<div class="text-subtitle-1">
11-
Elasticvue {{ version }}-{{ VERSION_NAME }} |
12-
<a href="https://github.com/cars10/elasticvue/blob/master/CHANGELOG.md" rel="nofollow" target="_blank"
13-
class="decoration-none">
14-
{{ t('base.app_footer.changelog') }}
15-
</a>
10+
<div>
11+
Elasticvue {{ version }}-{{ VERSION_NAME }}
12+
</div>
13+
<div>
14+
&copy;{{ new Date().getFullYear() }} - Carsten K&ouml;nig
1615
</div>
17-
&copy;{{ new Date().getFullYear() }} - Carsten K&ouml;nig
1816
</div>
1917

2018
<div class="col-md-4 text-right">

src/components/base/UpdateCheck.vue

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<template>
2+
<q-dialog v-model="dialog" transition-duration="100">
3+
<q-card style="width: 500px">
4+
<q-card-section class="flex justify-between">
5+
<h2 class="text-h6 q-my-none">
6+
{{ t('update_check.heading') }}
7+
</h2>
8+
<q-btn v-if="!downloading && !installing" v-close-popup icon="close" flat round dense />
9+
</q-card-section>
10+
11+
<q-separator />
12+
13+
<q-card-section>
14+
<div v-if="downloading">
15+
{{ t('update_check.downloading', { progress: Math.floor(downloadProgress * 100) }) }}
16+
<q-linear-progress instant-feedback :value="downloadProgress" size="12" class="q-mt-sm" />
17+
</div>
18+
<div v-else-if="installing">
19+
{{ t('update_check.installing') }}
20+
</div>
21+
<div v-else-if="updateInfo">
22+
{{ t('update_check.update_info', { version: updateInfo.version }) }}
23+
</div>
24+
</q-card-section>
25+
26+
<q-card-section v-if="!downloading && !installing">
27+
<q-btn :label="t('update_check.yes')"
28+
color="positive"
29+
type="submit"
30+
class="q-mr-md"
31+
@click="downloadUpdate" />
32+
<q-btn v-close-popup flat :label="t('defaults.cancel')" />
33+
</q-card-section>
34+
</q-card>
35+
</q-dialog>
36+
</template>
37+
38+
<script setup lang="ts">
39+
import { onMounted } from 'vue'
40+
import { useTranslation } from '../../composables/i18n.ts'
41+
import { useUpdateCheck } from '../../composables/UpdateCheck.ts'
42+
43+
const t = useTranslation()
44+
45+
onMounted(() => checkUpdate())
46+
47+
const {
48+
checkUpdate,
49+
downloadUpdate,
50+
downloading,
51+
downloadProgress,
52+
installing,
53+
updateInfo,
54+
dialog
55+
} = useUpdateCheck()
56+
</script>

src/composables/UpdateCheck.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { Ref, ref } from 'vue'
2+
import { check, Update } from '@tauri-apps/plugin-updater'
3+
import { relaunch } from '@tauri-apps/plugin-process'
4+
5+
type UpdateInfo = {
6+
version: string
7+
}
8+
9+
export const useUpdateCheck = () => {
10+
const dialog = ref(false)
11+
const downloading = ref(false)
12+
const downloadProgress = ref(0)
13+
const installing = ref(false)
14+
const updateInfo: Ref<UpdateInfo | null> = ref(null)
15+
let update: Update | null = null
16+
17+
const checkUpdate = async () => {
18+
update = await check()
19+
20+
if (update) {
21+
updateInfo.value = { version: update.version }
22+
dialog.value = true
23+
} else {
24+
updateInfo.value = null
25+
}
26+
}
27+
28+
const downloadUpdate = async () => {
29+
if (!update) return
30+
31+
let downloaded = 0
32+
let contentLength = 0
33+
34+
downloading.value = true
35+
36+
await update.downloadAndInstall((event) => {
37+
switch (event.event) {
38+
case 'Started':
39+
contentLength = event.data.contentLength || -1
40+
break
41+
case 'Progress':
42+
downloaded += event.data.chunkLength
43+
downloadProgress.value = downloaded / contentLength
44+
break
45+
case 'Finished':
46+
downloading.value = false
47+
installing.value = true
48+
break
49+
}
50+
})
51+
52+
await relaunch()
53+
}
54+
55+
return {
56+
checkUpdate,
57+
downloadUpdate,
58+
dialog,
59+
downloading,
60+
downloadProgress,
61+
installing,
62+
updateInfo
63+
}
64+
}

0 commit comments

Comments
 (0)