aee603836cd555a755a72d82028e9193cebc4bf7 chmalee Mon Nov 18 17:22:43 2024 -0800 Format dates the same as js when returning files to client, rename hub to parent dir on client when an upload is successful, add the quota used out of the max quota to the table display diff --git src/hg/lib/userdata.c src/hg/lib/userdata.c index 4092c0f..5c68fc5 100644 --- src/hg/lib/userdata.c +++ src/hg/lib/userdata.c @@ -319,31 +319,31 @@ char hubPath[PATH_LEN]; safef(hubPath, sizeof(hubPath), "%s%s", path, fi->name); struct userFiles *hubFileList = listFilesForUserHub(userName, hub->hubName); hub->lastModified = getFileListLatestTime(hubFileList); hub->fileList = hubFileList; slAddHead(&userHubs, hub); } } return userHubs; } struct hubSpace *listFilesForUser(char *userName) /* Return the files the user has uploaded */ { struct sqlConnection *conn = hConnectCentral(); -struct dyString *query = sqlDyStringCreate("select * from hubSpace where userName='%s' order by creationTime, fileName", userName); +struct dyString *query = sqlDyStringCreate("select userName, fileName, fileSize, fileType, creationTime, DATE_FORMAT(lastModified, '%%c/%%d/%%Y, %%l:%%i:%%s %%p') as lastModified, db, location, md5sum, parentDir from hubSpace where userName='%s' order by creationTime, fileName", userName); struct hubSpace *fileList = hubSpaceLoadByQuery(conn, dyStringCannibalize(&query)); return fileList; } long long getMaxUserQuota(char *userName) /* Return how much space is allocated for this user or the default */ { return HUB_SPACE_DEFAULT_QUOTA; } long long checkUserQuota(char *userName) /* Return the amount of space a user is currently using */ { long long quota = 0; struct hubSpace *hubSpace, *hubSpaceList = listFilesForUser(userName);