Add JSDoc documentation and file headers to all source files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 18:55:36 +08:00
parent 3b7b6ae859
commit 7fec6cb63f
199 changed files with 2764 additions and 503 deletions

View File

@@ -221,6 +221,16 @@
</div>
</template>
<script setup>
// The Lucia project.
// Copyright 2024-2026 DSP, inc. All rights reserved.
// Authors:
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module views/Files/Files File management page with data
* table listing uploaded files, discover/compare navigation,
* and file operations (rename, delete).
*/
import { ref, computed, watch, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { storeToRefs } from 'pinia';
@@ -313,7 +323,7 @@
});
/**
* 時間排序,如果沒有 accessed_at 就不加入 data
* Sorts by time; entries without accessed_at are excluded.
*/
const recentlyUsedFiles = computed(() => {
let recentlyUsed = Array.from(store.allFiles);
@@ -375,8 +385,8 @@
}
/**
* 選擇該 files 進入 Discover/Compare/Design 頁面
* @param {object} file file 的詳細資料
* Selects a file and navigates to the Discover/Compare/Design page.
* @param {object} file - The file details.
*/
function enterDiscover(file){
let type;
@@ -416,7 +426,7 @@
/**
* Right Click DOM Event
* @param {event} event 該 file 的詳細資料
* @param {Event} event - The mouse event.
* @param {string} file file's name
*/
function onRightClick(event, file) {
@@ -428,7 +438,7 @@
/**
* Right Click Table DOM Event
* @param {event} event 該 file 的詳細資料
* @param {Event} event - The right-click event with row data.
*/
function onRightClickTable(event) {
selectedType.value = event.data.type;
@@ -438,9 +448,9 @@
}
/**
* Right Click Gride Card DOM Event
* @param {event} event 該 file 的詳細資料
* @param {number} index file index
* Right Click Grid Card DOM Event
* @param {object} file - The file object.
* @param {number} index - The file index.
*/
function onGridCardClick(file, index) {
selectedType.value = file.type;
@@ -451,9 +461,9 @@
/**
* File's Rename
* @param {string} type 該檔案的 type
* @param {number} id 該檔案的 id
* @param {string} source hover icon 該檔案的 icon
* @param {string} type - The file type.
* @param {number} id - The file ID.
* @param {string} source - The hover icon source.
* @param {string} fileName file's name
*/
function rename(type, id, source, fileName) {
@@ -467,9 +477,10 @@
/**
* Delete file
* @param {string} type 該檔案的 type
* @param {number} id 該檔案的 id
* @param {string} source hover icon 該檔案的 icon
* @param {string} type - The file type.
* @param {number} id - The file ID.
* @param {string} name - The file name.
* @param {string} source - The hover icon source.
*/
async function deleteFile(type, id, name, source) {
let srt = '';
@@ -504,7 +515,7 @@
}
/**
* 顯示被 Admin 或被其他帳號刪除的檔案
* Shows files deleted by admin or by other accounts.
*/
function showReallyDelete(){
let srt = '';
@@ -529,9 +540,10 @@
/**
* Download file as CSV
* @param {string} type 該檔案的 type
* @param {number} id 該檔案的 id
* @param {string} source hover icon 該檔案的 icon
* @param {string} type - The file type.
* @param {number} id - The file ID.
* @param {string} source - The hover icon source.
* @param {string} name - The file name.
*/
function download(type, id, source, name) {
if(type && id && source === 'list-hover' && name) {
@@ -573,7 +585,7 @@
}
/**
* Grid 模板時的篩選器
* Filter/sort handler for the grid view template.
* @param {event} event choose columnType item
*/
function getGridSortData(event) {