]> OzVa Git service - ozva-cloud/commitdiff
feat: remove parent path
authorsigoden <sigoden@gmail.com>
Thu, 26 May 2022 11:54:29 +0000 (19:54 +0800)
committersigoden <sigoden@gmail.com>
Thu, 26 May 2022 11:54:29 +0000 (19:54 +0800)
src/index.html
src/server.rs

index d77b8a0680ac328d1dee5edbe1dd2cb5d5309865..f095e2cae37f0fd2d0476b39f4d3ca5132aee6ff 100644 (file)
     }
 
     function addPath(file, index) {
-      const actionTd = file.name === ".." || readonly ? "" : `
+      const actionTd = readonly ? "" : `
       <td class="cell-actions">
         <div onclick="deletePath(${index})" class="delete-btn" id="deleteBtn${index}" title="Delete ${file.name}">
           <svg width="18" height="18" viewBox="0 0 40 40"><path d="M28,40H11.8c-3.3,0-5.9-2.7-5.9-5.9V16c0-0.6,0.4-1,1-1s1,0.4,1,1v18.1c0,2.2,1.8,3.9,3.9,3.9H28c2.2,0,3.9-1.8,3.9-3.9V16   c0-0.6,0.4-1,1-1s1,0.4,1,1v18.1C33.9,37.3,31.2,40,28,40z"/></g><g><path d="M33.3,4.9h-7.6C25.2,2.1,22.8,0,19.9,0s-5.3,2.1-5.8,4.9H6.5c-2.3,0-4.1,1.8-4.1,4.1S4.2,13,6.5,13h26.9   c2.3,0,4.1-1.8,4.1-4.1S35.6,4.9,33.3,4.9z M19.9,2c1.8,0,3.3,1.2,3.7,2.9h-7.5C16.6,3.2,18.1,2,19.9,2z M33.3,11H6.5   c-1.1,0-2.1-0.9-2.1-2.1c0-1.1,0.9-2.1,2.1-2.1h26.9c1.1,0,2.1,0.9,2.1,2.1C35.4,10.1,34.5,11,33.3,11z"/></g><g><path d="M12.9,35.1c-0.6,0-1-0.4-1-1V17.4c0-0.6,0.4-1,1-1s1,0.4,1,1v16.7C13.9,34.6,13.4,35.1,12.9,35.1z"/></g><g><path d="M26.9,35.1c-0.6,0-1-0.4-1-1V17.4c0-0.6,0.4-1,1-1s1,0.4,1,1v16.7C27.9,34.6,27.4,35.1,26.9,35.1z"/></g><g><path d="M19.9,35.1c-0.6,0-1-0.4-1-1V17.4c0-0.6,0.4-1,1-1s1,0.4,1,1v16.7C20.9,34.6,20.4,35.1,19.9,35.1z"/></svg>
index 45ac63ad9530fb8368fd181f7c54d19f6451f2ba..ff201471691e08fd3bd9dbf71b739b8c5b49d4df 100644 (file)
@@ -143,18 +143,6 @@ impl InnerService {
         let base_path = &self.args.path;
         let mut rd = fs::read_dir(path).await?;
         let mut paths: Vec<PathItem> = vec![];
-        if self.args.path != path {
-            paths.push(PathItem {
-                path_type: PathType::Dir,
-                name: "..".to_owned(),
-                path: format!(
-                    "/{}",
-                    normalize_path(path.parent().unwrap().strip_prefix(base_path).unwrap())
-                ),
-                mtime: None,
-                size: None,
-            })
-        }
         while let Some(entry) = rd.next_entry().await? {
             let entry_path = entry.path();
             let rel_path = entry_path.strip_prefix(base_path).unwrap();