mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
parent
a2bfa5acaa
commit
0ed5ae71c5
@ -1065,6 +1065,7 @@ const message = {
|
||||
SFTP: 'SFTP',
|
||||
OneDrive: 'Microsoft OneDrive',
|
||||
backupDir: 'Backup dir',
|
||||
codeWarning: 'The current authorization code format is incorrect, please confirm again!',
|
||||
isCN: 'Domestic version',
|
||||
code: 'Auth code',
|
||||
codeHelper:
|
||||
|
@ -1020,6 +1020,7 @@ const message = {
|
||||
MINIO: 'MINIO',
|
||||
SFTP: 'SFTP',
|
||||
OneDrive: '微軟 OneDrive',
|
||||
codeWarning: '當前授權碼格式錯誤,請重新確認!',
|
||||
backupDir: '備份路徑',
|
||||
isCN: '國內版',
|
||||
code: '授權碼',
|
||||
|
@ -1020,6 +1020,7 @@ const message = {
|
||||
MINIO: 'MINIO',
|
||||
SFTP: 'SFTP',
|
||||
OneDrive: '微软 OneDrive',
|
||||
codeWarning: '当前授权码格式错误,请重新确认!',
|
||||
backupDir: '备份路径',
|
||||
isCN: '国内版',
|
||||
code: '授权码',
|
||||
|
@ -52,7 +52,7 @@
|
||||
v-if="dialogData.rowData!.type === 'OneDrive'"
|
||||
:label="$t('setting.code')"
|
||||
prop="varsJson.code"
|
||||
:rules="Rules.requiredInput"
|
||||
:rules="rules.driveCode"
|
||||
>
|
||||
<el-input clearable v-model.trim="dialogData.rowData!.varsJson['code']">
|
||||
<template #append>
|
||||
@ -247,7 +247,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import i18n from '@/lang';
|
||||
@ -265,6 +265,16 @@ const buckets = ref();
|
||||
const errBuckets = ref();
|
||||
|
||||
const endpoints = ref('http');
|
||||
const rules = reactive({
|
||||
driveCode: [{ validator: checkDriveCode, required: true, trigger: 'blur' }],
|
||||
});
|
||||
function checkDriveCode(rule: any, value: any, callback: any) {
|
||||
const reg = /^[A-Za-z0-9_.-]{32,60}$/;
|
||||
if (!reg.test(value)) {
|
||||
return callback(new Error(i18n.global.t('setting.codeWarning')));
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
const emit = defineEmits<{ (e: 'search'): void }>();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user