diff --git a/src/App.vue b/src/App.vue index 4de273d..4483377 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,9 @@ import { ref, onBeforeMount } from 'vue'; const url = ref('http://localhost:3000') const token = ref('your_jwt') +const connected = ref(false) + + const models = ref([]) const selectedModel = ref('') @@ -20,17 +23,22 @@ const saveHandler = async () => { url: url.value, token: token.value }) - const res = await window.electron.checkConnection() - new Notification("Open WebUI", { body: res ? 'Server Connection Verified' : 'Server Connection Failed' }) - if (res) { + connected.value = await window.electron.checkConnection() + + new Notification("Open WebUI", { body: connected.value ? 'Server Connection Verified' : 'Server Connection Failed' }) + + if (connected.value) { models.value = await window.electron.getModels() - console.log(models.value) } } +const editHandler = () => { + connected.value = false +} + const selectModelHandler = async () => { console.log(selectedModel.value) @@ -60,18 +68,29 @@ onBeforeMount(async () => {
Open WebUI Assistant
- +
+ +
+ +
+ +
+ +
+ class=" w-full bg-gray-100 hover:bg-gray-200 transition rounded-lg py-1 px-2 text-xs outline-none disabled:bg-gray-100 disabled:text-gray-500 dark:disabled:text-gray-500" + placeholder="Open WebUI URL" :disabled='connected' /> + class=" w-full bg-gray-100 hover:bg-gray-200 transition rounded-lg py-1 px-2 text-xs outline-none disabled:bg-gray-100 disabled:text-gray-500 dark:disabled:text-gray-500" + placeholder="Open WebUI Token" :disabled='connected' />