Translate all Chinese comments and strings to English
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,13 +147,13 @@ export const useFilesStore = defineStore('filesStore', {
|
||||
},
|
||||
};
|
||||
|
||||
uploadloader(); // 進度條
|
||||
uploadloader(); // Show loading progress bar
|
||||
try {
|
||||
const response = await apiClient.post(api, fromData, config);
|
||||
|
||||
this.uploadId = response.data.id;
|
||||
this.$router.push({name: 'Upload'});
|
||||
Swal.close(); // 關閉進度條
|
||||
Swal.close(); // Close the loading progress bar
|
||||
} catch(error) {
|
||||
if(error.response?.status === 422) {
|
||||
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
|
||||
@@ -162,7 +162,7 @@ export const useFilesStore = defineStore('filesStore', {
|
||||
|
||||
uploadFailedFirst(detail[0].type, detail[0].msg, detail[0].loc[2]);
|
||||
} else {
|
||||
Swal.close(); // 關閉進度條
|
||||
Swal.close(); // Close the loading progress bar
|
||||
apiError(error, 'Failed to upload the files.');
|
||||
}
|
||||
}
|
||||
@@ -189,13 +189,13 @@ export const useFilesStore = defineStore('filesStore', {
|
||||
const uploadId = this.uploadId;
|
||||
const api = `/api/logs/csv-uploads/${uploadId}`;
|
||||
|
||||
uploadloader(); // 進度條
|
||||
uploadloader(); // Show loading progress bar
|
||||
try {
|
||||
const response = await apiClient.post(api, data);
|
||||
|
||||
this.uploadLogId = response.data.id;
|
||||
Swal.close(); // 關閉進度條
|
||||
await this.rename(); // 改檔名
|
||||
Swal.close(); // Close the loading progress bar
|
||||
await this.rename(); // Rename the file
|
||||
await uploadSuccess();
|
||||
this.$router.push({name: 'Files'});
|
||||
} catch(error) {
|
||||
@@ -204,7 +204,7 @@ export const useFilesStore = defineStore('filesStore', {
|
||||
|
||||
uploadFailedSecond(detail);
|
||||
} else {
|
||||
Swal.close(); // 關閉進度條
|
||||
Swal.close(); // Close the loading progress bar
|
||||
apiError(error, 'Failed to upload the log files.');
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ export const useFilesStore = defineStore('filesStore', {
|
||||
* @param {string} name - The file name.
|
||||
*/
|
||||
async rename(type, id, fileName) {
|
||||
// 先判斷有沒有 uploadLogId,有就設定 id 和 type;再判斷檔案型別。
|
||||
// If uploadLogId exists, set id and type accordingly; then check the file type.
|
||||
if(this.uploadId && this.uploadFileName) {
|
||||
type = 'log';
|
||||
id = this.uploadLogId;
|
||||
|
||||
Reference in New Issue
Block a user