95e2c3a93202ee912624bb730724313faae7c886
chmalee
  Wed Dec 4 16:41:31 2024 -0800
Use the DataTables select API instead of implementing my own checkboxes

Working child/parent rows. Just need to add checkboxes to the children and indent them a smidge

Fix log in for api key in pre-finish hook. Make the pre-finish hook determine if we came from hubtools or not and don't create hub.txts if we did. Fix writing of parentRows. Make client not use .child() but instead show or hide based on a load time constraint, which is not quite working all the way yet

Make select/deselect work with child files. Remove some dead code

Make deletes work by moving any requested directories to the end of the delete list and then deleting the directories so rmdir doesn't fail

Fix new table rows not animating on add

Make newly updloaded files show up in table include their parent dir and hub.txt, and indent them appropriately

Hash filenames to file objects in the client so we don't add duplicate rows to the table when multiple files are uploaded at once. Update the selected file div after deleting files. Make clicks on hub.txt files load the hub. Turn the file clicked on to pack. Remove some old copy from the template page

Revert early experimental commit when trying to allow bigDataUrl uploads directly through hgCustom

Fix up some comments to be more correct

Remove old CGI experiment

diff --git src/hg/inc/userdata.h src/hg/inc/userdata.h
index 0f0edd2..3c2226c 100644
--- src/hg/inc/userdata.h
+++ src/hg/inc/userdata.h
@@ -45,41 +45,49 @@
 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 *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);
+char *hubNameFromPath(char *path);
+/* Return the last directory component of path. Assume that a '.' char in the last component
+ * means that component is a filename and go back further */
+
+char *writeHubText(char *path, char *userName, 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 createNewTempHubForUpload(char *requestId, struct hubSpace *rowForFile, char *userDataDir, char *parentDir);
+/* Creates a hub.txt for this upload, and updates the hubSpace table for the
+ * hub.txt and any parentDirs we need to create. */
 
 void addHubSpaceRowForFile(struct hubSpace *row);
 /* We created a file for a user, now add an entry to the hubSpace table for it */
 
+void makeParentDirRows(char *userName, time_t lastModified, char *db, char *parentDirStr, char *userDataDir);
+/* For each '/' separated component of parentDirStr, create a row in hubSpace. Return the 
+ * final subdirectory component of parentDirStr */
+
 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 */