添加主机身份页面.

This commit is contained in:
lijiahang
2023-09-21 13:50:42 +08:00
parent fbc40116f0
commit b13cbd8cca
39 changed files with 444 additions and 649 deletions

View File

@@ -0,0 +1,52 @@
<template>
<a-select v-model:model-value="value"
:options="optionData()"
placeholder="请选择主机秘钥"
allow-clear />
</template>
<script lang="ts">
export default {
name: 'host-key-selector'
};
</script>
<script lang="ts" setup>
import { computed } from 'vue';
import { useCacheStore } from '@/store';
import { SelectOptionData } from '@arco-design/web-vue';
const props = defineProps({
modelValue: Number,
});
const emits = defineEmits(['update:modelValue']);
const value = computed({
get() {
return props.modelValue;
},
set(e) {
if (e) {
emits('update:modelValue', e);
} else {
emits('update:modelValue', null);
}
}
});
// 选项数据
const cacheStore = useCacheStore();
const optionData = (): SelectOptionData[] => {
return cacheStore.hostKeys.map(s => {
return {
label: s.name,
value: s.id,
};
});
};
</script>
<style scoped>
</style>