7b7bb68187bb42ead29a9a3b26a950205820c9ae
chmalee
  Wed Nov 20 15:54:48 2024 -0800
Make up to 25 rows show by default, make the table scroll down if it's more than 600 pixels, make the table collapse when there are less than 600 pixels height needed.

Remove the 'Action' title, remove the delete button from each row, make the checkboxes select files, on checkbox select populate an info section about how many files have been selected and give the option to view or delete them

Start of reworking the delete button to delete a list of files. The backend still needs to be smarter about creating the locations of files

Put some place holder text where the selected file information would appear so the page doesn't jump around

Start of work on back end for removing files. Changed the json returned for listing the files to list the full path to the file to make the requests to delete a file easier. Still need to decide on encoding vs decoding of the parent dirs during uploads

diff --git src/hg/inc/userdata.h src/hg/inc/userdata.h
index c6360d3..0f0edd2 100644
--- src/hg/inc/userdata.h
+++ src/hg/inc/userdata.h
@@ -38,59 +38,67 @@
 #define HUB_SPACE_DEFAULT_QUOTA HUB_SPACE_DEFAULT_QUOTA_BYTES 
 // for defining the quota in hg.conf
 #define HUB_SPACE_CONF_QUOTA_VAR "hubspace.quota"
 // path to hg.conf file that has a list of hubspace.quota.userName entries
 // for special per user quotas:
 #define HUB_SPACE_QUOTA_LIST_VAR "hubspace.quotaList"
 
 char *webDataDir(char *userName);
 /* Return a web accesible path to the userDataDir, this is different from the full path tusd uses */
 
 char *getDataDir(char *userName);
 /* Return the full path to the user specific data directory, can be configured via hg.conf
  * on hgwdev, this is /data/apache/userdata/userStore/hash/userName/
  * on the RR, this is /userdata/userStore/hash/userName/ */
 
-char *prefixUserFile(char *userName, char *fname);
-/* Allocate a new string that contains the full per-user path to fname, NULL otherwise */
+char *stripDataDir(char *fname, char *userName);
+/* Strips the getDataDir(userName) off of fname */
+
+char *prefixUserFile(char *userName, char *fname, char *parentDir);
+/* Allocate a new string that contains the full per-user path to fname, NULL otherwise.
+ * parentDir is optional and will go in between the per-user dir and the fname */
 
 char *writeHubText(char *path, char *userName, char *hubName, char *db);
 /* Create a hub.txt file, optionally creating the directory holding it. For convenience, return
  * the file name of the created hub, which can be freed. */
 
 void createNewTempHubForUpload(char *requestId, char *userName, char *db, char *trackFileName, char *trackType, char *parentDir);
 /* Creates a hub.txt for this upload with a random hub name. Returns the full path to the hub
  * for convenience. */
 
 void addHubSpaceRowForFile(struct hubSpace *row);
 /* We created a file for a user, now add an entry to the hubSpace table for it */
 
 void removeFileForUser(char *fname, char *userName);
 /* Remove a file for this user if it exists */
 
 void removeHubForUser(char *path, char *userName);
 /* Remove a hub directory for this user (and all files in the directory), if it exists */
 
 struct userHubs *listHubsForUser(char *userName);
 /* Lists the directories for a particular user */
 
 time_t getHubLatestTime(struct userHubs *hub);
 /* Return the latest access time of the files in a hub */
 
 struct userFiles *listFilesForUserHub(char *userName, char *hubName);
 /* Get all the files for a particular hub for a particular user */
 
+char *findParentDirs(char *parentDir, char *userName, char *fname);
+/* For a given file with parentDir, go up the tree and find the full path back to
+ * the rootmost parentDir */
+
 struct hubSpace *listFilesForUser(char *userName);
 /* Return the files the user has uploaded */
 
 char *defaultHubNameForUser(char *userName);
 /* Return a name to use as a default for a hub, starts with myFirstHub, then myFirstHub2, ... */
 
 long long getMaxUserQuota(char *userName);
 /* Return how much space is allocated for this user or the default */
 
 long long checkUserQuota(char *userName);
 /* Return the amount of space a user is currently using */
 
 char *storeUserFile(char *userName, char *fileName, void *data, size_t dataSize);
 /* Give a fileName and a data stream, write the data to:
  * userdata/userStore/hashedUserName/userName/fileName