mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 04:39:54 -05:00
added connector config ui
This commit is contained in:
74
vue3/src/components/model_editors/ConnectorConfigEditor.vue
Normal file
74
vue3/src/components/model_editors/ConnectorConfigEditor.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<model-editor-base
|
||||
:loading="loading"
|
||||
:dialog="dialog"
|
||||
@save="saveObject"
|
||||
@delete="deleteObject"
|
||||
@close="emit('close'); editingObjChanged = false"
|
||||
:is-update="isUpdate()"
|
||||
:is-changed="editingObjChanged"
|
||||
:model-class="modelClass"
|
||||
:object-name="editingObjName()">
|
||||
<v-card-text>
|
||||
<v-form :disabled="loading">
|
||||
|
||||
<v-text-field :label="$t('Name')" v-model="editingObj.name"></v-text-field>
|
||||
<v-select :label="$t('Type')" :items="['HomeAssistant']" v-model="editingObj.type"></v-select>
|
||||
|
||||
<v-text-field :label="$t('Url')" v-model="editingObj.url"></v-text-field>
|
||||
<v-text-field :label="$t('Access_Token')" v-model="editingObj.token"></v-text-field>
|
||||
|
||||
<v-text-field label="Todo entity" v-model="editingObj.todoEntity"></v-text-field>
|
||||
<v-checkbox :label="$t('SupportsDescriptionField')" hide-details v-model="editingObj.supportsDescriptionField"></v-checkbox>
|
||||
|
||||
<v-checkbox :label="$t('Enabled')" v-model="editingObj.enabled"></v-checkbox>
|
||||
|
||||
<h3> {{ $t('Events') }}</h3>
|
||||
<v-checkbox :label="$t('ShoppingListEntry') + ' - ' + $t('Created')" hide-details v-model="editingObj.onShoppingListEntryCreatedEnabled"></v-checkbox>
|
||||
<v-checkbox :label="$t('ShoppingListEntry') + ' - ' + $t('Updated')" hide-details v-model="editingObj.onShoppingListEntryUpdatedEnabled"></v-checkbox>
|
||||
<v-checkbox :label="$t('ShoppingListEntry') + ' - ' + $t('Deleted')" hide-details v-model="editingObj.onShoppingListEntryDeletedEnabled"></v-checkbox>
|
||||
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
</model-editor-base>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import {onMounted, PropType} from "vue";
|
||||
import {ConnectorConfig} from "@/openapi";
|
||||
import ModelEditorBase from "@/components/model_editors/ModelEditorBase.vue";
|
||||
import {useModelEditorFunctions} from "@/composables/useModelEditorFunctions";
|
||||
|
||||
const props = defineProps({
|
||||
item: {type: {} as PropType<ConnectorConfig>, required: false, default: null},
|
||||
itemId: {type: [Number, String], required: false, default: undefined},
|
||||
itemDefaults: {type: {} as PropType<ConnectorConfig>, required: false, default: {} as ConnectorConfig},
|
||||
dialog: {type: Boolean, default: false}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['create', 'save', 'delete', 'close'])
|
||||
const {
|
||||
setupState,
|
||||
deleteObject,
|
||||
saveObject,
|
||||
isUpdate,
|
||||
editingObjName,
|
||||
loading,
|
||||
editingObj,
|
||||
editingObjChanged,
|
||||
modelClass
|
||||
} = useModelEditorFunctions<ConnectorConfig>('ConnectorConfig', emit)
|
||||
|
||||
// object specific data (for selects/display)
|
||||
|
||||
onMounted(() => {
|
||||
setupState(props.item, props.itemId, {itemDefaults: props.itemDefaults})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user