fix: improve formatting and readability in XPackLimitDrawer.vue
parent
11b7672bf4
commit
5a8c7a0e00
|
|
@ -28,13 +28,13 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 身份验证 -->
|
<!-- 身份验证 -->
|
||||||
<el-form-item :label="$t('views.applicationOverview.appInfo.LimitDialog.authentication')">
|
<el-form-item :label="$t('views.applicationOverview.appInfo.LimitDialog.authentication')">
|
||||||
<el-switch size="small" v-model="form.authentication" @change="firstGeneration"></el-switch>
|
<el-switch size="small" v-model="form.authentication"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-if="form.authentication"
|
v-if="form.authentication"
|
||||||
v-model="form.authentication_value.type"
|
v-model="form.authentication_value.type"
|
||||||
class="card__radio"
|
class="card__radio"
|
||||||
@change="(val: string) => val === 'password'"
|
@change="firstGeneration"
|
||||||
>
|
>
|
||||||
<el-card
|
<el-card
|
||||||
shadow="never"
|
shadow="never"
|
||||||
|
|
@ -71,7 +71,9 @@
|
||||||
text
|
text
|
||||||
style="margin: 0 4px 0 0 !important"
|
style="margin: 0 4px 0 0 !important"
|
||||||
>
|
>
|
||||||
<el-icon><RefreshRight /></el-icon>
|
<el-icon>
|
||||||
|
<RefreshRight/>
|
||||||
|
</el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -226,6 +228,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateAuthenticationValue(length: number = 10) {
|
function generateAuthenticationValue(length: number = 10) {
|
||||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
||||||
const randomValues = new Uint8Array(length)
|
const randomValues = new Uint8Array(length)
|
||||||
|
|
@ -234,14 +237,14 @@ function generateAuthenticationValue(length: number = 10) {
|
||||||
.map((value) => chars[value % chars.length])
|
.map((value) => chars[value % chars.length])
|
||||||
.join('')
|
.join('')
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshAuthentication() {
|
function refreshAuthentication() {
|
||||||
form.value.authentication_value.password_value = generateAuthenticationValue()
|
form.value.authentication_value.password_value = generateAuthenticationValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
function firstGeneration() {
|
function firstGeneration() {
|
||||||
console.log('firstGeneration')
|
if (form.value.authentication && form.value.authentication_value.type === 'password' && !form.value.authentication_value.password_value) {
|
||||||
if (form.value.authentication && !form.value.authentication_value) {
|
form.value.authentication_value.password_value = generateAuthenticationValue()
|
||||||
form.value.authentication_value = generateAuthenticationValue()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue