mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-07-01 18:13:03 +08:00
Remove fast project display names option
This commit is contained in:
@@ -71,14 +71,10 @@ router.get(
|
|||||||
const skipSynchronization =
|
const skipSynchronization =
|
||||||
readQueryStringValue(req.query.skipSynchronization).trim() === '1' ||
|
readQueryStringValue(req.query.skipSynchronization).trim() === '1' ||
|
||||||
readQueryStringValue(req.query.skipSync).trim() === '1';
|
readQueryStringValue(req.query.skipSync).trim() === '1';
|
||||||
const fastDisplayNames =
|
|
||||||
readQueryStringValue(req.query.fastDisplayNames).trim() === '1' ||
|
|
||||||
readQueryStringValue(req.query.fastNames).trim() === '1';
|
|
||||||
const sessionsLimit = readOptionalNumericQueryValue(req.query.sessionsLimit) ?? undefined;
|
const sessionsLimit = readOptionalNumericQueryValue(req.query.sessionsLimit) ?? undefined;
|
||||||
const sessionsOffset = readOptionalNumericQueryValue(req.query.sessionsOffset) ?? undefined;
|
const sessionsOffset = readOptionalNumericQueryValue(req.query.sessionsOffset) ?? undefined;
|
||||||
const projects = await getProjectsWithSessions({
|
const projects = await getProjectsWithSessions({
|
||||||
skipSynchronization,
|
skipSynchronization,
|
||||||
fastDisplayNames,
|
|
||||||
sessionsLimit,
|
sessionsLimit,
|
||||||
sessionsOffset,
|
sessionsOffset,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ type ProgressUpdate = {
|
|||||||
|
|
||||||
type GetProjectsWithSessionsOptions = {
|
type GetProjectsWithSessionsOptions = {
|
||||||
skipSynchronization?: boolean;
|
skipSynchronization?: boolean;
|
||||||
fastDisplayNames?: boolean;
|
|
||||||
sessionsLimit?: number;
|
sessionsLimit?: number;
|
||||||
sessionsOffset?: number;
|
sessionsOffset?: number;
|
||||||
};
|
};
|
||||||
@@ -117,15 +116,6 @@ export async function generateDisplayName(projectName: string, actualProjectDir:
|
|||||||
return projectPath;
|
return projectPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateFastDisplayName(projectPath: string): string {
|
|
||||||
if (projectPath.startsWith('/')) {
|
|
||||||
const parts = projectPath.split('/').filter(Boolean);
|
|
||||||
return parts[parts.length - 1] || projectPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
return projectPath.replace(/-/g, '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizeSessionPagination(options: SessionPaginationOptions = {}): { limit: number; offset: number } {
|
function normalizeSessionPagination(options: SessionPaginationOptions = {}): { limit: number; offset: number } {
|
||||||
const rawLimit = Number.isFinite(options.limit) ? Math.floor(Number(options.limit)) : DEFAULT_PROJECT_SESSIONS_PAGE_SIZE;
|
const rawLimit = Number.isFinite(options.limit) ? Math.floor(Number(options.limit)) : DEFAULT_PROJECT_SESSIONS_PAGE_SIZE;
|
||||||
const rawOffset = Number.isFinite(options.offset) ? Math.floor(Number(options.offset)) : 0;
|
const rawOffset = Number.isFinite(options.offset) ? Math.floor(Number(options.offset)) : 0;
|
||||||
@@ -249,9 +239,7 @@ export async function getProjectsWithSessions(
|
|||||||
const displayName =
|
const displayName =
|
||||||
row.custom_project_name && row.custom_project_name.trim().length > 0
|
row.custom_project_name && row.custom_project_name.trim().length > 0
|
||||||
? row.custom_project_name
|
? row.custom_project_name
|
||||||
: options.fastDisplayNames
|
: await generateDisplayName(path.basename(projectPath) || projectPath, projectPath);
|
||||||
? generateFastDisplayName(projectPath)
|
|
||||||
: await generateDisplayName(path.basename(projectPath) || projectPath, projectPath);
|
|
||||||
|
|
||||||
const sessionsPage = readProjectSessionsPageByPath(projectPath, {
|
const sessionsPage = readProjectSessionsPageByPath(projectPath, {
|
||||||
limit: options.sessionsLimit,
|
limit: options.sessionsLimit,
|
||||||
|
|||||||
Reference in New Issue
Block a user