|
94 | 94 | <el-form-item :label="$t('setting.compressPassword')"> |
95 | 95 | <el-input v-model="secret" :placeholder="$t('setting.backupRecoverMessage')" /> |
96 | 96 | </el-form-item> |
| 97 | + <el-form-item |
| 98 | + v-if="type !== 'app' && type !== 'website'" |
| 99 | + :label="$t('cronjob.timeout')" |
| 100 | + prop="timeoutItem" |
| 101 | + > |
| 102 | + <el-input type="number" class="selectClass" v-model.number="timeoutItem"> |
| 103 | + <template #append> |
| 104 | + <el-select v-model="timeoutUnit" style="width: 80px"> |
| 105 | + <el-option :label="$t('commons.units.second')" value="s" /> |
| 106 | + <el-option :label="$t('commons.units.minute')" value="m" /> |
| 107 | + <el-option :label="$t('commons.units.hour')" value="h" /> |
| 108 | + </el-select> |
| 109 | + </template> |
| 110 | + </el-input> |
| 111 | + <span class="input-help">{{ $t('database.recoverTimeoutHelper') }}</span> |
| 112 | + </el-form-item> |
97 | 113 | </el-form> |
98 | 114 | <template #footer> |
99 | 115 | <span class="dialog-footer"> |
|
115 | 131 |
|
116 | 132 | <script lang="ts" setup> |
117 | 133 | import { reactive, ref } from 'vue'; |
118 | | -import { computeSize, newUUID } from '@/utils/util'; |
| 134 | +import { computeSize, newUUID, transferTimeToSecond } from '@/utils/util'; |
119 | 135 | import i18n from '@/lang'; |
120 | 136 | import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus'; |
121 | 137 | import { File } from '@/api/interface/file'; |
@@ -152,6 +168,8 @@ const name = ref(); |
152 | 168 | const detailName = ref(); |
153 | 169 | const remark = ref(); |
154 | 170 | const secret = ref(); |
| 171 | +const timeoutItem = ref(30); |
| 172 | +const timeoutUnit = ref('m'); |
155 | 173 | const taskLogRef = ref(); |
156 | 174 |
|
157 | 175 | const recoverDialog = ref(); |
@@ -261,6 +279,7 @@ const onHandleRecover = async () => { |
261 | 279 | file: baseDir.value + currentRow.value.name, |
262 | 280 | secret: secret.value, |
263 | 281 | taskID: newUUID(), |
| 282 | + timeout: timeoutItem.value === -1 ? -1 : transferTimeToSecond(timeoutItem.value + timeoutUnit.value), |
264 | 283 | }; |
265 | 284 | loading.value = true; |
266 | 285 | await handleRecoverByUpload(params) |
|
0 commit comments