mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-16 20:42:40 +08:00
style: Adjust the style of the ssh configuration page (#8560)
This commit is contained in:
parent
7534b680a7
commit
36e0aece06
4 changed files with 92 additions and 86 deletions
|
|
@ -164,6 +164,7 @@
|
||||||
<CodemirrorPro
|
<CodemirrorPro
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
:heightDiff="loadHeight()"
|
:heightDiff="loadHeight()"
|
||||||
|
:minHeight="350"
|
||||||
v-model="dockerConf"
|
v-model="dockerConf"
|
||||||
mode="json"
|
mode="json"
|
||||||
placeholder="# The Docker configuration file does not exist or is empty (/etc/docker/daemon.json)"
|
placeholder="# The Docker configuration file does not exist or is empty (/etc/docker/daemon.json)"
|
||||||
|
|
|
||||||
|
|
@ -39,90 +39,89 @@
|
||||||
|
|
||||||
<LayoutContent>
|
<LayoutContent>
|
||||||
<template #main>
|
<template #main>
|
||||||
<MainDiv :heightDiff="320">
|
<el-radio-group v-model="confShowType" @change="changeMode">
|
||||||
<el-radio-group v-model="confShowType" @change="changeMode">
|
<el-radio-button value="base">{{ $t('database.baseConf') }}</el-radio-button>
|
||||||
<el-radio-button value="base">{{ $t('database.baseConf') }}</el-radio-button>
|
<el-radio-button value="all">{{ $t('database.allConf') }}</el-radio-button>
|
||||||
<el-radio-button value="all">{{ $t('database.allConf') }}</el-radio-button>
|
</el-radio-group>
|
||||||
</el-radio-group>
|
<el-row class="mt-10" v-if="confShowType === 'base'">
|
||||||
<el-row class="mt-10" v-if="confShowType === 'base'">
|
<el-col :xs="24" :sm="20" :md="20" :lg="10" :xl="10">
|
||||||
<el-col :xs="24" :sm="20" :md="20" :lg="10" :xl="10">
|
<el-form :model="form" label-position="right" ref="formRef" label-width="100px">
|
||||||
<el-form :model="form" label-position="right" ref="formRef" label-width="100px">
|
<el-form-item :label="$t('commons.table.port')" prop="port">
|
||||||
<el-form-item :label="$t('commons.table.port')" prop="port">
|
<el-input disabled v-model.number="form.port">
|
||||||
<el-input disabled v-model.number="form.port">
|
<template #append>
|
||||||
<template #append>
|
<el-button @click="onChangePort" icon="Setting">
|
||||||
<el-button @click="onChangePort" icon="Setting">
|
{{ $t('commons.button.set') }}
|
||||||
{{ $t('commons.button.set') }}
|
</el-button>
|
||||||
</el-button>
|
</template>
|
||||||
</template>
|
</el-input>
|
||||||
</el-input>
|
<span class="input-help">{{ $t('ssh.portHelper') }}</span>
|
||||||
<span class="input-help">{{ $t('ssh.portHelper') }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('ssh.listenAddress')" prop="listenAddress">
|
||||||
<el-form-item :label="$t('ssh.listenAddress')" prop="listenAddress">
|
<el-input disabled v-model="form.listenAddressItem">
|
||||||
<el-input disabled v-model="form.listenAddressItem">
|
<template #append>
|
||||||
<template #append>
|
<el-button @click="onChangeAddress" icon="Setting">
|
||||||
<el-button @click="onChangeAddress" icon="Setting">
|
{{ $t('commons.button.set') }}
|
||||||
{{ $t('commons.button.set') }}
|
</el-button>
|
||||||
</el-button>
|
</template>
|
||||||
</template>
|
</el-input>
|
||||||
</el-input>
|
<span class="input-help">{{ $t('ssh.addressHelper') }}</span>
|
||||||
<span class="input-help">{{ $t('ssh.addressHelper') }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('ssh.permitRootLogin')" prop="permitRootLoginItem">
|
||||||
<el-form-item :label="$t('ssh.permitRootLogin')" prop="permitRootLoginItem">
|
<el-input disabled v-model="form.permitRootLoginItem">
|
||||||
<el-input disabled v-model="form.permitRootLoginItem">
|
<template #append>
|
||||||
<template #append>
|
<el-button @click="onChangeRoot" icon="Setting">
|
||||||
<el-button @click="onChangeRoot" icon="Setting">
|
{{ $t('commons.button.set') }}
|
||||||
{{ $t('commons.button.set') }}
|
</el-button>
|
||||||
</el-button>
|
</template>
|
||||||
</template>
|
</el-input>
|
||||||
</el-input>
|
<span class="input-help">{{ $t('ssh.rootSettingHelper') }}</span>
|
||||||
<span class="input-help">{{ $t('ssh.rootSettingHelper') }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('ssh.passwordAuthentication')" prop="passwordAuthentication">
|
||||||
<el-form-item :label="$t('ssh.passwordAuthentication')" prop="passwordAuthentication">
|
<el-switch
|
||||||
<el-switch
|
active-value="yes"
|
||||||
active-value="yes"
|
inactive-value="no"
|
||||||
inactive-value="no"
|
@change="onSave(formRef, 'PasswordAuthentication', form.passwordAuthentication)"
|
||||||
@change="onSave(formRef, 'PasswordAuthentication', form.passwordAuthentication)"
|
v-model="form.passwordAuthentication"
|
||||||
v-model="form.passwordAuthentication"
|
></el-switch>
|
||||||
></el-switch>
|
<span class="input-help">{{ $t('ssh.pwdAuthHelper') }}</span>
|
||||||
<span class="input-help">{{ $t('ssh.pwdAuthHelper') }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('ssh.pubkeyAuthentication')" prop="pubkeyAuthentication">
|
||||||
<el-form-item :label="$t('ssh.pubkeyAuthentication')" prop="pubkeyAuthentication">
|
<el-switch
|
||||||
<el-switch
|
active-value="yes"
|
||||||
active-value="yes"
|
inactive-value="no"
|
||||||
inactive-value="no"
|
@change="onSave(formRef, 'PubkeyAuthentication', form.pubkeyAuthentication)"
|
||||||
@change="onSave(formRef, 'PubkeyAuthentication', form.pubkeyAuthentication)"
|
v-model="form.pubkeyAuthentication"
|
||||||
v-model="form.pubkeyAuthentication"
|
></el-switch>
|
||||||
></el-switch>
|
<span class="input-help">{{ $t('ssh.keyAuthHelper') }}</span>
|
||||||
<span class="input-help">{{ $t('ssh.keyAuthHelper') }}</span>
|
<el-button link @click="onOpenDrawer" type="primary">
|
||||||
<el-button link @click="onOpenDrawer" type="primary">
|
{{ $t('ssh.pubkey') }}
|
||||||
{{ $t('ssh.pubkey') }}
|
</el-button>
|
||||||
</el-button>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('ssh.useDNS')" prop="useDNS">
|
||||||
<el-form-item :label="$t('ssh.useDNS')" prop="useDNS">
|
<el-switch
|
||||||
<el-switch
|
active-value="yes"
|
||||||
active-value="yes"
|
inactive-value="no"
|
||||||
inactive-value="no"
|
@change="onSave(formRef, 'UseDNS', form.useDNS)"
|
||||||
@change="onSave(formRef, 'UseDNS', form.useDNS)"
|
v-model="form.useDNS"
|
||||||
v-model="form.useDNS"
|
></el-switch>
|
||||||
></el-switch>
|
<span class="input-help">{{ $t('ssh.dnsHelper') }}</span>
|
||||||
<span class="input-help">{{ $t('ssh.dnsHelper') }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
</el-form>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<div v-if="confShowType === 'all'">
|
<div v-if="confShowType === 'all'">
|
||||||
<CodemirrorPro
|
<CodemirrorPro
|
||||||
:heightDiff="400"
|
:heightDiff="450"
|
||||||
class="mt-5"
|
:minHeight="350"
|
||||||
v-model="sshConf"
|
class="mt-5"
|
||||||
placeholder="# The SSH configuration file does not exist or is empty (/etc/ssh/sshd_config)"
|
v-model="sshConf"
|
||||||
></CodemirrorPro>
|
placeholder="# The SSH configuration file does not exist or is empty (/etc/ssh/sshd_config)"
|
||||||
<el-button :disabled="loading" type="primary" @click="onSaveFile" style="margin-top: 5px">
|
></CodemirrorPro>
|
||||||
{{ $t('commons.button.save') }}
|
<el-button :disabled="loading" type="primary" @click="onSaveFile" class="mt-2.5">
|
||||||
</el-button>
|
{{ $t('commons.button.save') }}
|
||||||
</div>
|
</el-button>
|
||||||
</MainDiv>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
|
|
||||||
|
|
@ -140,7 +139,6 @@ import PubKey from '@/views/host/ssh/ssh/pubkey/index.vue';
|
||||||
import Root from '@/views/host/ssh/ssh/root/index.vue';
|
import Root from '@/views/host/ssh/ssh/root/index.vue';
|
||||||
import Port from '@/views/host/ssh/ssh/port/index.vue';
|
import Port from '@/views/host/ssh/ssh/port/index.vue';
|
||||||
import Address from '@/views/host/ssh/ssh/address/index.vue';
|
import Address from '@/views/host/ssh/ssh/address/index.vue';
|
||||||
import MainDiv from '@/components/main-div/index.vue';
|
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { getSSHConf, getSSHInfo, operateSSH, updateSSH, updateSSHByfile } from '@/api/modules/host';
|
import { getSSHConf, getSSHInfo, operateSSH, updateSSH, updateSSHByfile } from '@/api/modules/host';
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-text type="primary" class="cursor-pointer" @click="onInspect(row)">
|
<el-text type="primary" class="cursor-pointer" @click="onInspect(row)">
|
||||||
{{ row.name }}
|
{{ row.name === 'localhost' ? $t('terminal.local') : row.name }}
|
||||||
</el-text>
|
</el-text>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -160,6 +160,11 @@ const search = async () => {
|
||||||
bac.varsJson = JSON.parse(bac.vars);
|
bac.varsJson = JSON.parse(bac.vars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
data.value.sort((a, b) => {
|
||||||
|
if (a.name === 'localhost') return -1;
|
||||||
|
if (b.name === 'localhost') return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
paginationConfig.total = res.data.total;
|
paginationConfig.total = res.data.total;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
<DrawerPro v-model="drawerVisible" :header="title + $t('setting.backupAccount')" @close="handleClose" size="large">
|
<DrawerPro v-model="drawerVisible" :header="title + $t('setting.backupAccount')" @close="handleClose" size="large">
|
||||||
<el-form @submit.prevent ref="formRef" v-loading="loading" label-position="top" :model="dialogData.rowData">
|
<el-form @submit.prevent ref="formRef" v-loading="loading" label-position="top" :model="dialogData.rowData">
|
||||||
<el-form-item :label="$t('commons.table.name')" prop="name" :rules="Rules.requiredInput">
|
<el-form-item :label="$t('commons.table.name')" prop="name" :rules="Rules.requiredInput">
|
||||||
<el-tag v-if="dialogData.title === 'edit'">{{ dialogData.rowData!.name }}</el-tag>
|
<el-tag v-if="dialogData.title === 'edit'">
|
||||||
|
{{ dialogData.rowData!.name === 'localhost' ? $t('terminal.local') : dialogData.rowData!.name }}
|
||||||
|
</el-tag>
|
||||||
<el-input v-else v-model="dialogData.rowData!.name" />
|
<el-input v-else v-model="dialogData.rowData!.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue