🔨 优化主机逻辑.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { LabelExtraSettingModel } from '../../../types/define';
|
||||
import type { HostLabelExtraSettingModel } from '@/api/asset/host-extra';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { tabColorKey } from '../../../types/const';
|
||||
import { getHostExtraItem } from '@/api/asset/host-extra';
|
||||
@@ -48,13 +48,13 @@
|
||||
|
||||
const { toOptions } = useDictStore();
|
||||
|
||||
const formModel = ref<LabelExtraSettingModel>({
|
||||
const formModel = ref<Partial<HostLabelExtraSettingModel>>({
|
||||
color: '',
|
||||
});
|
||||
|
||||
// 渲染表单
|
||||
const renderForm = async () => {
|
||||
const { data } = await getHostExtraItem<LabelExtraSettingModel>({ hostId: props.hostId, item: props.item });
|
||||
const { data } = await getHostExtraItem<HostLabelExtraSettingModel>({ hostId: props.hostId, item: props.item });
|
||||
formModel.value = data;
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { SshExtraSettingModel } from '../../../types/define';
|
||||
import type { HostSshExtraSettingModel } from '@/api/asset/host-extra';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getHostExtraItem } from '@/api/asset/host-extra';
|
||||
import { ExtraSshAuthType, extraSshAuthTypeKey } from '../../../types/const';
|
||||
@@ -58,13 +58,13 @@
|
||||
const { toRadioOptions } = useDictStore();
|
||||
|
||||
const formRef = ref();
|
||||
const formModel = ref<SshExtraSettingModel>({
|
||||
authType: ExtraSshAuthType.DEFAULT
|
||||
const formModel = ref<Partial<HostSshExtraSettingModel>>({
|
||||
authType: ExtraSshAuthType.DEFAULT,
|
||||
});
|
||||
|
||||
// 渲染表单
|
||||
const renderForm = async () => {
|
||||
const { data } = await getHostExtraItem<SshExtraSettingModel>({ hostId: props.hostId, item: props.item });
|
||||
const { data } = await getHostExtraItem<HostSshExtraSettingModel>({ hostId: props.hostId, item: props.item });
|
||||
formModel.value = data;
|
||||
};
|
||||
|
||||
|
||||
@@ -57,20 +57,6 @@ export interface ShortcutKeyItem {
|
||||
type: number;
|
||||
}
|
||||
|
||||
// SSH 额外配置
|
||||
export interface SshExtraSettingModel {
|
||||
authType?: string;
|
||||
username?: string;
|
||||
keyId?: number;
|
||||
identityId?: number;
|
||||
}
|
||||
|
||||
// 标签额外配置
|
||||
export interface LabelExtraSettingModel {
|
||||
alias?: string;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
// session tab
|
||||
export interface PanelSessionTabType {
|
||||
type: string;
|
||||
|
||||
Reference in New Issue
Block a user