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

@@ -1,3 +1,14 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/acctMgmt Account management store for CRUD
* operations on user accounts (admin functionality).
*/
import { defineStore } from 'pinia';
import apiClient from '@/api/client.js';
import apiError from '@/module/apiError';

View File

@@ -1,9 +1,22 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/allMapData Process map data store for fetching,
* filtering, and managing Discover Map page state including
* filter rules, data layers, and process map data.
*/
import { defineStore } from "pinia";
import moment from "moment";
import apiClient from "@/api/client.js";
import apiError from '@/module/apiError.js';
import { Decimal } from 'decimal.js';
/** Pinia store for Discover Map page data and filter management. */
export const useAllMapDataStore = defineStore('allMapDataStore', {
state: () => ({
baseLogId: null,

View File

@@ -1,7 +1,19 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/compare Performance comparison dashboard store
* for fetching and managing comparison data between two files.
*/
import { defineStore } from "pinia";
import apiClient from "@/api/client.js";
import apiError from '@/module/apiError.js';
/** Pinia store for the Compare Dashboard page data. */
export const useCompareStore = defineStore('compareStore', {
state: () => ({
allCompareDashboardData: null,

View File

@@ -1,3 +1,14 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/conformance Conformance checking store for managing
* rule definitions, conformance check results, and report data.
*/
import { defineStore } from "pinia";
import moment from "moment";
import { Decimal } from 'decimal.js';
@@ -5,6 +16,7 @@ import abbreviateNumber from '@/module/abbreviateNumber.js';
import apiClient from "@/api/client.js";
import apiError from '@/module/apiError.js';
/** Pinia store for conformance checking and rule management. */
export const useConformanceStore = defineStore('conformanceStore', {
state: () => ({
conformanceLogId: null, // log 檔

View File

@@ -1,12 +1,22 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/conformanceInput Temporary storage for user input
* during conformance rule configuration. Unlike stores/conformance
* which handles API integration, this store focuses on caching
* user selections before submission.
*/
import { defineStore } from "pinia";
import moment from 'moment';
/**
* stores/conformanceInput.js 與 stores/conformance.js 的差別在於
* 本store側重在暫存使用者的輸入
* 而後者則側重在 API 的串接之所需
* Pinia store for caching user input during conformance rule editing.
*/
export const useConformanceInputStore = defineStore('conformanceInputStore', {
state: () => ({
inputDataToSave: {

View File

@@ -1,10 +1,19 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/cytoscapeStore Cytoscape node position persistence
* store for saving and restoring graph node positions to/from
* localStorage.
*/
import { defineStore } from 'pinia';
import { SAVE_KEY_NAME } from '@/constants/constants.js';
// nodePositions[graphId][direction][id]
// nodePositions[graphId][position]
interface Position {
x: number;

View File

@@ -1,3 +1,14 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/files File management store for listing, uploading,
* renaming, downloading, and deleting log/filter/rule files.
*/
import { defineStore } from "pinia";
import apiClient from "@/api/client.js";
import moment from 'moment';
@@ -6,6 +17,7 @@ import Swal from 'sweetalert2';
import { uploadFailedFirst, uploadFailedSecond, uploadloader, uploadSuccess, deleteSuccess } from '@/module/alertModal.js';
import { useLoadingStore } from '@/stores/loading';
/** Pinia store for file CRUD operations and upload workflow. */
export const useFilesStore = defineStore('filesStore', {
state: () => ({
allEventFiles: [

View File

@@ -1,10 +1,24 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/** @module stores/loading Global loading spinner state management. */
import { defineStore } from "pinia";
/** Pinia store for managing the global loading spinner visibility. */
export const useLoadingStore = defineStore('loadingStore', {
state: () => ({
/** Whether the loading spinner is currently visible. */
isLoading: true,
}),
actions: {
/**
* Sets the loading spinner visibility.
* @param {boolean} isLoadingBoolean - Whether to show the spinner.
*/
setIsLoading(isLoadingBoolean) {
this.isLoading = isLoadingBoolean;
}

View File

@@ -1,9 +1,21 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/login Authentication store for login, logout,
* token management, and user data.
*/
import { defineStore } from "pinia";
import axios from 'axios';
import apiClient from '@/api/client.js';
import apiError from '@/module/apiError.js';
import { deleteCookie, setCookie, setCookieWithoutExpiration, getCookie } from "../utils/cookieUtil";
/** Pinia store for authentication and user session management. */
export const useLoginStore = defineStore('loginStore', {
// data, methods, computed
// state, actions, getters

View File

@@ -1,3 +1,13 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/main Pinia store instance with persisted state plugin.
*/
import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

View File

@@ -1,3 +1,14 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/mapCompareStore Map comparison store for managing
* side-by-side process map comparison with insights data.
*/
import { defineStore } from 'pinia';
import { useAllMapDataStore } from '@/stores/allMapData';
import { INSIGHTS_FIELDS_AND_LABELS } from '@/constants/constants';

View File

@@ -1,3 +1,14 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/mapPathStore Cytoscape map interaction store for
* node/edge click highlighting with path insights visualization.
*/
import { defineStore } from 'pinia';
import { useAllMapDataStore } from '@/stores/allMapData';
import { INSIGHTS_FIELDS_AND_LABELS } from '@/constants/constants';

View File

@@ -1,18 +1,34 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/** @module stores/modal Account management modal state. */
import { defineStore } from 'pinia';
import { MODAL_ACCT_INFO, } from '@/constants/constants.js';
/** Pinia store for controlling account management modal visibility. */
export const useModalStore = defineStore('modalStore', {
state: () => ({
/** Whether a modal is currently open. */
isModalOpen: false,
/** The current modal type constant (e.g. MODAL_ACCT_INFO). */
whichModal: MODAL_ACCT_INFO,
}),
actions: {
/**
* Opens a modal of the specified type.
* @param {string} whichModal - The modal type constant.
*/
openModal(whichModal) {
this.isModalOpen = true;
this.whichModal = whichModal;
},
/** Closes the currently open modal. */
async closeModal(){
this.isModalOpen = false;
},
},
});
});

View File

@@ -1,12 +1,28 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/pageAdmin Navigation state management for tracking
* active, previous, and pending page states across route transitions
* and SweetAlert2 modal interactions.
*/
import { defineStore } from "pinia";
import { mapPageNameToCapitalUnifiedName } from "../utils/pageUtils";
/** @constant {boolean} Enable console logging for page admin debugging. */
const printPageAdminLog = false;
// There are at least two ways to trigger a page navigation:
// clicking the navigation button and refreshing the page.
// Therefore, we need to handle page transitions caused by both of these methods.
// 至少有兩種方式引起畫面的導向: 點選導覽按鈕與重新整理網頁
// 因此至少要處理這兩種方式所引起的畫面切換
/**
* Pinia store for managing navigation page state transitions.
*
* Handles two navigation triggers: clicking navigation buttons and
* page refreshes. Manages pending states for SweetAlert2 modal
* confirmation flows.
*/
export const usePageAdminStore = defineStore('pageAdminStore', {
state: () => ({
activePage: 'MAP',
@@ -20,6 +36,10 @@ export const usePageAdminStore = defineStore('pageAdminStore', {
getters: {
},
actions: {
/**
* Sets the active page based on the last matched route record.
* @param {Array} routeMatched - The route.matched array.
*/
setActivePageComputedByRoute(routeMatched){
if (routeMatched.length && routeMatched[routeMatched.length - 1]
&& routeMatched[routeMatched.length - 1].name) {
@@ -98,6 +118,10 @@ export const usePageAdminStore = defineStore('pageAdminStore', {
printPageAdminLog && console.log('clearShouldKeepPreviousPageBoolean()');
this.shouldKeepPreviousPage = false;
},
/**
* Stores the name of the currently opened map file.
* @param {string} fileName - The file name.
*/
setCurrentMapFile(fileName){
this.currentMapFile = fileName;
},

View File

@@ -1,7 +1,19 @@
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/performance Performance analysis store for fetching
* and managing frequency/duration chart data.
*/
import { defineStore } from "pinia";
import apiClient from "@/api/client.js";
import apiError from '@/module/apiError.js';
/** Pinia store for the Discover Performance page data. */
export const usePerformanceStore = defineStore('performanceStore', {
state: () => ({
allPerformanceData: null,