修改前端包结构.

This commit is contained in:
lijiahang
2024-06-24 09:57:33 +08:00
parent 6c4e9cd5c6
commit ef10c8b8b6
11 changed files with 112 additions and 74 deletions

View File

@@ -13,6 +13,7 @@
:before-change="s => updateStatus(s as number)" />
</div>
</template>
<!-- 表单 -->
<a-spin v-show="config.status" :loading="loading" class="config-form-wrapper">
<!-- 表单 -->
<a-form :model="formModel"
@@ -140,16 +141,16 @@
<script lang="ts" setup>
import type { FieldRule } from '@arco-design/web-vue';
import type { HostSshConfig } from './types/const';
import type { HostSshConfig } from '../types/const';
import { reactive, ref, watch } from 'vue';
import { updateHostConfigStatus, updateHostConfig } from '@/api/asset/host-config';
import { sshAuthTypeKey, sshOsTypeKey, SshAuthType, SshOsType } from './types/const';
import rules from './types/form.rules';
import { sshAuthTypeKey, sshOsTypeKey, SshAuthType, SshOsType } from '../types/const';
import rules from '../types/ssh-form.rules';
import { Message } from '@arco-design/web-vue';
import useLoading from '@/hooks/loading';
import { useDictStore } from '@/store';
import { EnabledStatus } from '@/types/const';
import { HostConfigType } from '../../../types/const';
import { HostConfigType } from '../types/const';
import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
import HostIdentitySelector from '@/components/asset/host-identity/selector/index.vue';

View File

@@ -30,16 +30,15 @@
</script>
<script lang="ts" setup>
import type { HostConfigWrapper } from '../../types/const';
import type { HostSshConfig } from './ssh/types/const';
import type { HostConfigWrapper, HostSshConfig } from '../types/const';
import { ref } from 'vue';
import useVisible from '@/hooks/visible';
import useLoading from '@/hooks/loading';
import { Message } from '@arco-design/web-vue';
import { getHostConfigList } from '@/api/asset/host-config';
import { useCacheStore, useDictStore } from '@/store';
import { dictKeys } from './ssh/types/const';
import SshConfigForm from './ssh/ssh-config-form.vue';
import { dictKeys } from '../types/const';
import SshConfigForm from '../components/ssh-config-form.vue';
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();

View File

@@ -1,3 +1,10 @@
// 主机所有配置
export interface HostConfigWrapper {
ssh: HostSshConfig;
[key: string]: unknown;
}
// 主机 SSH 配置
export interface HostSshConfig {
osType?: string;
@@ -31,6 +38,11 @@ export const SshOsType = {
WINDOWS: 'WINDOWS',
};
// 主机配置类型
export const HostConfigType = {
SSH: 'ssh'
};
// 主机验证方式 字典项
export const sshAuthTypeKey = 'hostSshAuthType';

View File

@@ -72,7 +72,7 @@
import { useCacheStore } from '@/store';
import { Message } from '@arco-design/web-vue';
import { updateHostGroupRel } from '@/api/asset/host-group';
import HostTransfer from './host-transfer.vue';
import HostTransfer from '../components/host-transfer.vue';
import HostGroupTree from '@/components/asset/host-group/tree/index.vue';
const { visible, setVisible } = useVisible();

View File

@@ -37,8 +37,8 @@
import HostTable from './components/host-table.vue';
import HostCardList from './components/host-card-list.vue';
import HostFormModal from './components/host-form-modal.vue';
import HostConfigDrawer from './components/config/host-config-drawer.vue';
import HostGroupDrawer from './components/group/host-group-drawer.vue';
import HostConfigDrawer from '../host-config/drawer/index.vue';
import HostGroupDrawer from '../host-group/drawer/index.vue';
const table = ref();
const card = ref();

View File

@@ -1,17 +1,3 @@
import type { HostSshConfig } from '../components/config/ssh/types/const';
// 主机所有配置
export interface HostConfigWrapper {
ssh: HostSshConfig;
[key: string]: unknown;
}
// 主机配置类型
export const HostConfigType = {
SSH: 'ssh'
};
// tag 颜色
export const tagColor = [
'arcoblue',