Skip to content
This repository was archived by the owner on Nov 16, 2025. It is now read-only.

Commit 93e835d

Browse files
feat(ui): file picker support (#9)
* chore: update npm packages * feat(ui): impl simple NC File Picker support * bumped Visionatrix to the latest version Signed-off-by: bigcat88 <bigcat88@icloud.com> * chore: add NEXTCLOUD_INTEGRATION=true flag for client * chore: update screenshots --------- Signed-off-by: bigcat88 <bigcat88@icloud.com> Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
1 parent 5b07f20 commit 93e835d

15 files changed

+8088
-9505
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.2.1 - 2025-02-23]
6+
7+
The Visionatrix service has been updated from version `1.11.0` to `1.11.1`.
8+
9+
## Added
10+
11+
- Support for `File Picker` to select media files from a Nextcloud instance.
12+
13+
### Fixed
14+
15+
- Now works correctly on fresh installations with no flows installed.
16+
- Prompt translations using **Gemini** now works correctly.
17+
518
## [1.2.0 - 2025-02-17]
619

720
The Visionatrix service has been updated from version `1.9.0` to `1.11.0`.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ RUN cd /Visionatrix && \
7070
rm -rf visionatrix/client && \
7171
cd web && \
7272
npm ci && \
73-
NUXT_APP_BASE_URL="/index.php/apps/app_api/proxy/visionatrix/" npm run build && \
73+
NUXT_APP_BASE_URL="/index.php/apps/app_api/proxy/visionatrix/" NEXTCLOUD_INTEGRATION=true npm run build && \
7474
cp -r .output/public ../visionatrix/client && \
7575
rm -rf node_modules
7676

appinfo/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Share your custom workflows, big or small. For guidance on creating AI workflows
3434
3535
📚 For more details, visit the [repository](https://github.com/cloud-py-api/visionatrix) readme.
3636
]]></description>
37-
<version>1.2.0</version>
37+
<version>1.2.1</version>
3838
<licence>MIT</licence>
3939
<author mail="andrey18106x@gmail.com" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
4040
<author mail="bigcat88@icloud.com" homepage="https://github.com/bigcat88">Alexander Piskun</author>
@@ -55,7 +55,7 @@ Share your custom workflows, big or small. For guidance on creating AI workflows
5555
<docker-install>
5656
<registry>ghcr.io</registry>
5757
<image>cloud-py-api/visionatrix</image>
58-
<image-tag>1.11.0</image-tag>
58+
<image-tag>1.11.1</image-tag>
5959
</docker-install>
6060
<routes>
6161
<route>

ex_app/src/bootstrap.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import Vue from 'vue'
22
import { translate, translatePlural } from '@nextcloud/l10n'
3-
import { generateUrl } from '@nextcloud/router'
4-
import { APP_API_PROXY_URL_PREFIX, EX_APP_ID } from './constants/AppAPI.js'
5-
import { getRequestToken } from '@nextcloud/auth'
3+
import { getCSPNonce } from '@nextcloud/auth'
64

75
Vue.prototype.t = translate
86
Vue.prototype.n = translatePlural
97
Vue.prototype.OC = window.OC
108
Vue.prototype.OCA = window.OCA
119

12-
__webpack_public_path__ = generateUrl(`${APP_API_PROXY_URL_PREFIX}/${EX_APP_ID}/js/`) // eslint-disable-line
13-
__webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-line
10+
__webpack_nonce__ = getCSPNonce() // eslint-disable-line

ex_app/src/views/IframeView.vue

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
2929
3030
import { APP_API_PROXY_URL_PREFIX, EX_APP_ID } from '../constants/AppAPI.js'
3131
32+
import { getFilePickerBuilder } from '@nextcloud/dialogs'
33+
import '@nextcloud/dialogs/style.css'
34+
3235
export default {
3336
name: 'IframeView',
3437
components: {
@@ -58,6 +61,38 @@ export default {
5861
this.error = true
5962
this.loading = false
6063
})
64+
window.addEventListener('message', (event) => {
65+
if (event.data.type === 'openNextcloudFilePicker') {
66+
this.showFilePicker(event)
67+
}
68+
})
69+
},
70+
methods: {
71+
showFilePicker(event) {
72+
if (!event.data.inputParamName) {
73+
return
74+
}
75+
const inputParamName = event.data.inputParamName
76+
getFilePickerBuilder(t('visionatrix', 'Select a file'))
77+
.setMultiSelect(false)
78+
.allowDirectories(false)
79+
.addMimeTypeFilter('image/*')
80+
.addButton({
81+
label: t('visionatrix', 'Select'),
82+
callback: (nodes) => {
83+
this.sendSelectedFilesToIframe(nodes, inputParamName)
84+
},
85+
})
86+
.build().pick().catch(() => {})
87+
},
88+
sendSelectedFilesToIframe(nodes, inputParamName) {
89+
const files = nodes.map((node) => {
90+
return {
91+
...node?._data,
92+
}
93+
})
94+
this.$refs.iframe.contentWindow.postMessage({ files, inputParamName }, '*')
95+
},
6196
},
6297
}
6398
</script>

0 commit comments

Comments
 (0)