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/hgHubConnect/trackHubWizard.c src/hg/hgHubConnect/trackHubWizard.c
index 1a025fc..c4dada1 100644
--- src/hg/hgHubConnect/trackHubWizard.c
+++ src/hg/hgHubConnect/trackHubWizard.c
@@ -132,55 +132,58 @@
 struct jsonWrite *jw = jsonWriteNew(); // the JSON to return for the client javascript
 jsonWriteObjectStart(jw, NULL);
 if (userName)
     {
     // the url for this user:
     jsonWriteString(jw, "userUrl", webDataDir(userName));
     jsonWriteListStart(jw, "fileList");
     struct hubSpace *file, *fileList = listFilesForUser(userName);
     for (file = fileList; file != NULL; file = file->next)
         {
         jsonWriteObjectStart(jw, NULL);
         cgiDecodeFull(file->fileName, file->fileName, strlen(file->fileName));
         jsonWriteString(jw, "fileName", file->fileName);
         jsonWriteNumber(jw, "fileSize", file->fileSize);
         jsonWriteString(jw, "fileType", file->fileType);
-        jsonWriteString(jw, "hub", file->fileName);
+        jsonWriteString(jw, "parentDir", file->parentDir);
         jsonWriteString(jw, "genome", file->db);
         jsonWriteString(jw, "lastModified", file->lastModified);
         jsonWriteString(jw, "uploadTime", file->creationTime);
         jsonWriteObjectEnd(jw);
         }
     jsonWriteListEnd(jw);
     /*
     jsonWriteListStart(jw, "hubList");
     struct userHubs *hub, *hubList = listHubsForUser(userName);
     for (hub = hubList; hub != NULL; hub = hub->next)
         {
         jsonWriteObjectStart(jw, NULL);
         cgiDecodeFull(hub->hubName, hub->hubName, strlen(hub->hubName));
         jsonWriteString(jw, "hubName", hub->hubName);
         jsonWriteString(jw, "genome", hub->genome);
         jsonWriteNumber(jw, "lastModified", getHubLatestTime(hub));
         jsonWriteObjectEnd(jw);
         }
     jsonWriteListEnd(jw);
     */
     }
 jsonWriteObjectEnd(jw);
 jsInlineF("var isLoggedIn = %s\n", getUserName() ? "true" : "false");
 jsInlineF("var userFiles = %s;\n", dyStringCannibalize(&jw->dy));
+// if the user is not logged, the 0 for the quota is ignored
+jsInlineF("var userQuota = %llu\n", getUserName() ? checkUserQuota(getUserName()) : 0);
+jsInlineF("var maxQuota = %llu\n", getUserName() ? getMaxUserQuota(getUserName()) : HUB_SPACE_DEFAULT_QUOTA);
 jsonWriteFree(&jw);
 }
 
 void doTrackHubWizard(char *database)
 /* Offer an upload form so users can upload all their hub files */
 {
 jsIncludeFile("utils.js", NULL);
 jsIncludeFile("ajax.js", NULL);
 jsIncludeFile("lodash.3.10.0.compat.min.js", NULL);
 jsIncludeFile("cart.js", NULL);
 jsIncludeFile("tus.js", NULL);
 // this file must be included as a module for now as it needs to import:
 //puts("<script src=\"../js/hgMyData.js\" type=\"module\"></script>");
 puts("<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">\n");
 puts("<link rel=\"stylesheet\" type=\"text/css\" "