Переглянути джерело

Fixed storage bug and path traverse focus in File Manager

Toby Chui 2 роки тому
батько
коміт
5a05f1e68f

+ 1 - 1
main.flags.go

@@ -29,7 +29,7 @@ var subserviceBasePort = 12810            //Next subservice port
 
 // =========== SYSTEM BUILD INFORMATION ==============
 var build_version = "development"                      //System build flag, this can be either {development / production / stable}
-var internal_version = "0.2.013"                       //Internal build version, [fork_id].[major_release_no].[minor_release_no]
+var internal_version = "0.2.015"                       //Internal build version, [fork_id].[major_release_no].[minor_release_no]
 var deviceUUID string                                  //The device uuid of this host
 var deviceVendor = "IMUSLAB.INC"                       //Vendor of the system
 var deviceVendorURL = "http://imuslab.com"             //Vendor contact information

+ 18 - 27
web/SystemAO/file_system/file_explorer.html

@@ -802,31 +802,6 @@
                         highlightCurrentRoot();
                     }
                 });
-
-                //Initial Host device drives
-                /*
-                $.ajax({
-                    url: "../../system/file_system/listDrives",
-                    success: function(data){
-                        $("#deviceList").html("");
-                        for (var i =0; i < data.length; i++){
-                            var drivePath = data[i].Drivepath;
-                            var usagePercentage = ((data[i].DriveTotalSpace - data[i].DriveFreeSpace) / data[i].DriveTotalSpace) * 100;
-                            var className = "primary";
-                            if (usagePercentage > 90){
-                                className = "negative";
-                            }
-                            $("#deviceList").append(`<div class="dir item" filepath="${drivePath}" ><i class="disk outline rightmargin icon"></i> ${drivePath} 
-                                <div style="width:100px;height:15px !important; position:absolute;right:3px;top:6px;"">
-                                    <div class="ui ${className} tiny progress">
-                                        <div class="bar" style="width: ${usagePercentage}%"></div>
-                                    </div>
-                                </div>
-                                </div>`);
-                        }
-                    }
-                });
-                */
             }
 
             function highlightCurrentRoot(){
@@ -1078,6 +1053,18 @@
                 });
             }
 
+            function listDirectoryAndHighlight(path, filenameToHighlight = ""){
+                listDirectory(path, function(){
+                    if (filenameToHighlight != ""){
+                        //Timeout to give the DOM time to render
+                        setTimeout(function(){
+                            focusFileObject(filenameToHighlight);
+                        }, 100);
+                        
+                    }
+                })
+            }
+
             //Render filelist --> Convert a file list object into the visable form of file list
             function renderDirectory(filelist, callback=undefined){
                 var data = filelist;
@@ -1959,6 +1946,7 @@
             }
 
             //Move the page focus to the given fileobject
+            //alias: Highlight file object / filename
             function focusFileObject(targetFileName){
                 $(".fileObject").each(function(){
                     if ($(this).attr("filename") == targetFileName){
@@ -2801,7 +2789,6 @@
                 }
                 input.click();
             }
-            
 
             function updatePathDisplay(path){
                 var pathInfo = path.split("/");
@@ -2819,7 +2806,11 @@
                 for(var i = 1; i < pathInfo.length; i++){
                     let thisname = pathInfo[i];
                     thisPath += thisname + "/";
-                    domPathChunks.push(`<div class="section selectable" onclick="event.stopImmediatePropagation(); listDirectory('${thisPath}');">${shortenLongFoldername(thisname, 20)}</div>`);
+                    let pathHighlight = "";
+                    if (i < pathInfo.length - 1){
+                        pathHighlight = pathInfo[i + 1];
+                    }
+                    domPathChunks.push(`<div class="section selectable" onclick="event.stopImmediatePropagation(); listDirectoryAndHighlight('${thisPath}', '${pathHighlight}');">${shortenLongFoldername(thisname, 20)}</div>`);
                 }
 
                 let fullpath = domPathChunks.join(`<div class="divider">/</div>`);

+ 2 - 2
web/SystemAO/storage/fshedit.html

@@ -273,8 +273,8 @@
             if (newPath.startsWith("http://") || newPath.startsWith("https://")){
                 //WebDAV
                 $("#fstype").dropdown("set selected", "webdav");
-                newPath = newPath.replace("http://", "");
-                newPath = newPath.replace("https://", "");
+                //newPath = newPath.replace("http://", "");
+                //newPath = newPath.replace("https://", "");
                 $(object).val(newPath);
             }else if (newPath.startsWith("ftp://")){
                 //FTP

+ 1 - 1
web/desktop.system

@@ -795,7 +795,7 @@
         }
 
         #quickAccessPanel .progress .bar{
-            background-color: var(--text_color_secondary) !important;
+            background-color: var(--theme_color) !important;
         }
 
         #quickAccessPanel .button{