|
@@ -7,6 +7,7 @@ import (
|
|
|
"strings"
|
|
|
|
|
|
"imuslab.com/arozos/mod/filesystem/arozfs"
|
|
|
+ "imuslab.com/arozos/mod/filesystem/hidden"
|
|
|
)
|
|
|
|
|
|
func getPageHeader(pathname string) string {
|
|
@@ -62,13 +63,14 @@ func getPageHeader(pathname string) string {
|
|
|
func getItemHTML(displayText string, link string, isDir bool, modTime string, size string) string {
|
|
|
icon := "📄"
|
|
|
downloadBtn := ""
|
|
|
- hidden := ""
|
|
|
+ hiddenStyle := ""
|
|
|
if isDir {
|
|
|
icon = "📁"
|
|
|
- if strings.HasPrefix(displayText, ".") {
|
|
|
+ isHidden, _ := hidden.IsHidden(link, true)
|
|
|
+ if isHidden {
|
|
|
//Hidden folder
|
|
|
icon = "📁"
|
|
|
- hidden = "filter: alpha(opacity=50); opacity: 0.5; zoom: 1;"
|
|
|
+ hiddenStyle = "filter: alpha(opacity=50); opacity: 0.5; zoom: 1;"
|
|
|
}
|
|
|
|
|
|
size = "-"
|
|
@@ -85,9 +87,16 @@ func getItemHTML(displayText string, link string, isDir bool, modTime string, si
|
|
|
}
|
|
|
//fmt.Println(fileMime, filepath.Ext(displayText))
|
|
|
|
|
|
+ //Check if hidden file
|
|
|
+ isHidden, _ := hidden.IsHidden(link, true)
|
|
|
+ if isHidden {
|
|
|
+ //Hidden folder
|
|
|
+ hiddenStyle = "filter: alpha(opacity=50); opacity: 0.5; zoom: 1;"
|
|
|
+ }
|
|
|
+
|
|
|
downloadBtn = `<a href="` + link + `" download>Download</a>`
|
|
|
}
|
|
|
- return `<tr style="` + hidden + `">
|
|
|
+ return `<tr style="` + hiddenStyle + `">
|
|
|
<td class="fx">` + icon + `</td>
|
|
|
<td><a href="` + link + `">` + displayText + `</a></td>
|
|
|
<td>` + modTime + `</td>
|