mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-24 23:04:40 +08:00
parent
8a7e61e9e5
commit
e1cf68becc
4 changed files with 15 additions and 2 deletions
|
@ -1091,6 +1091,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:
|
||||
|
|
|
@ -1043,6 +1043,7 @@ const message = {
|
|||
MINIO: 'MINIO',
|
||||
SFTP: 'SFTP',
|
||||
OneDrive: '微軟 OneDrive',
|
||||
codeWarning: '當前授權碼格式錯誤,請重新確認!',
|
||||
backupDir: '備份路徑',
|
||||
isCN: '國內版',
|
||||
code: '授權碼',
|
||||
|
|
|
@ -1044,6 +1044,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…
Reference in a new issue