|
@@ -2,93 +2,37 @@
|
|
|
<div class="edit">
|
|
<div class="edit">
|
|
|
<div class="edit-top">
|
|
<div class="edit-top">
|
|
|
<span>Host Setting</span>
|
|
<span>Host Setting</span>
|
|
|
- <Icon
|
|
|
|
|
- name="close"
|
|
|
|
|
- :size="20"
|
|
|
|
|
- @click="callBack(false)"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <Icon name="close" :size="20" @click="callBack(false)" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="edit-content">
|
|
<div class="edit-content">
|
|
|
- <Icon
|
|
|
|
|
- name="form"
|
|
|
|
|
- :size="240"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <Icon name="form" :size="240" />
|
|
|
|
|
|
|
|
<div>
|
|
<div>
|
|
|
- <n-form
|
|
|
|
|
- ref="formRef"
|
|
|
|
|
- :model="formData"
|
|
|
|
|
- :rules="rules"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <n-form ref="formRef" :model="formData" :rules="rules">
|
|
|
<div>
|
|
<div>
|
|
|
- <n-form-item
|
|
|
|
|
- label="Address"
|
|
|
|
|
- path="host"
|
|
|
|
|
- inline
|
|
|
|
|
- >
|
|
|
|
|
- <n-input
|
|
|
|
|
- v-model:value="formData.host"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- clearable
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <n-form-item label="Address" path="host" inline>
|
|
|
|
|
+ <n-input v-model:value="formData.host" placeholder="请输入" clearable />
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
|
- <n-form-item
|
|
|
|
|
- label="Port"
|
|
|
|
|
- path="port"
|
|
|
|
|
- inline
|
|
|
|
|
- >
|
|
|
|
|
- <n-input
|
|
|
|
|
- v-model:value="formData.port"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- clearable
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <n-form-item label="Port" path="port" inline>
|
|
|
|
|
+ <n-input v-model:value="formData.port" placeholder="请输入" clearable />
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <n-form-item
|
|
|
|
|
- label="Label"
|
|
|
|
|
- path="label"
|
|
|
|
|
- >
|
|
|
|
|
- <n-input
|
|
|
|
|
- v-model:value="formData.label"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- clearable
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <n-form-item label="Label" path="label">
|
|
|
|
|
+ <n-input v-model:value="formData.label" placeholder="请输入" clearable />
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
|
- <n-form-item
|
|
|
|
|
- label="UserName"
|
|
|
|
|
- path="userName"
|
|
|
|
|
- >
|
|
|
|
|
- <n-input
|
|
|
|
|
- v-model:value="formData.userName"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- clearable
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <n-form-item label="UserName" path="userName">
|
|
|
|
|
+ <n-input v-model:value="formData.userName" placeholder="请输入" clearable />
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
|
- <n-form-item
|
|
|
|
|
- label="Passord"
|
|
|
|
|
- path="password"
|
|
|
|
|
- >
|
|
|
|
|
- <n-input
|
|
|
|
|
- v-model:value="formData.password"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- clearable
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <n-form-item label="Passord" path="password">
|
|
|
|
|
+ <n-input v-model:value="formData.password" placeholder="请输入" clearable />
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
|
</n-form>
|
|
</n-form>
|
|
|
<div>
|
|
<div>
|
|
|
- <n-button
|
|
|
|
|
- ghost
|
|
|
|
|
- type="tertiary"
|
|
|
|
|
- @click="callBack(false)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <n-button ghost type="tertiary" @click="callBack(false)">
|
|
|
Cancel
|
|
Cancel
|
|
|
</n-button>
|
|
</n-button>
|
|
|
- <n-button
|
|
|
|
|
- type="info"
|
|
|
|
|
- ghost
|
|
|
|
|
- @click="callBack(true)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <n-button type="info" ghost @click="callBack(true)">
|
|
|
Save
|
|
Save
|
|
|
</n-button>
|
|
</n-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -107,11 +51,13 @@ export interface FormData {
|
|
|
label: string,
|
|
label: string,
|
|
|
userName: string,
|
|
userName: string,
|
|
|
password: string,
|
|
password: string,
|
|
|
- icon?:string,
|
|
|
|
|
- size?:number
|
|
|
|
|
|
|
+ icon?: string,
|
|
|
|
|
+ size?: number,
|
|
|
|
|
+ sshCom?: any,
|
|
|
|
|
+ sftpCom?: any
|
|
|
}
|
|
}
|
|
|
const props = withDefaults(defineProps<{
|
|
const props = withDefaults(defineProps<{
|
|
|
- data?:FormData
|
|
|
|
|
|
|
+ data?: FormData
|
|
|
}>(), {
|
|
}>(), {
|
|
|
data: () => ({
|
|
data: () => ({
|
|
|
host: '',
|
|
host: '',
|
|
@@ -121,7 +67,7 @@ const props = withDefaults(defineProps<{
|
|
|
password: ''
|
|
password: ''
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
-const emit = defineEmits<{(evt: 'callBack', value: FormData | null): void}>()
|
|
|
|
|
|
|
+const emit = defineEmits<{ (evt: 'callBack', value: FormData | null): void }>()
|
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
|
class FormOldData {
|
|
class FormOldData {
|
|
|
host: string
|
|
host: string
|
|
@@ -161,7 +107,7 @@ const rules = ref({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-async function callBack(type:boolean) {
|
|
|
|
|
|
|
+async function callBack(type: boolean) {
|
|
|
const data = type ? { ...formData.value } : null
|
|
const data = type ? { ...formData.value } : null
|
|
|
if (type) await formRef.value.validate()
|
|
if (type) await formRef.value.validate()
|
|
|
emit('callBack', data)
|
|
emit('callBack', data)
|
|
@@ -208,9 +154,11 @@ async function callBack(type:boolean) {
|
|
|
--n-border-hover: rgba(0, 0, 0, 0);
|
|
--n-border-hover: rgba(0, 0, 0, 0);
|
|
|
--n-box-shadow-focus: 0 0 0 2px rgba(0, 0, 0, .2);
|
|
--n-box-shadow-focus: 0 0 0 2px rgba(0, 0, 0, .2);
|
|
|
}
|
|
}
|
|
|
- &>div:first-child{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ &>div:first-child {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- &>div:first-child{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ &>div:first-child {
|
|
|
width: 78%;
|
|
width: 78%;
|
|
|
margin-right: 2%;
|
|
margin-right: 2%;
|
|
|
}
|
|
}
|
|
@@ -225,10 +173,11 @@ async function callBack(type:boolean) {
|
|
|
&>button:last-child {
|
|
&>button:last-child {
|
|
|
margin-left: 15px;
|
|
margin-left: 15px;
|
|
|
}
|
|
}
|
|
|
- :deep(.n-button){
|
|
|
|
|
- --n-text-color-hover:none;
|
|
|
|
|
- --n-border-focus:1px solid #0000;
|
|
|
|
|
- --n-border-hover:1px solid #0000;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ :deep(.n-button) {
|
|
|
|
|
+ --n-text-color-hover: none;
|
|
|
|
|
+ --n-border-focus: 1px solid #0000;
|
|
|
|
|
+ --n-border-hover: 1px solid #0000;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|