Skip to content

Commit

Permalink
Improve upon serving
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel2392 committed May 4, 2024
1 parent 9aa6e3d commit 17d8fcd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
14 changes: 8 additions & 6 deletions quickgo/_templates/dir.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
<div class="box-content">
{{ template "parent_url" . }}
{{ if gt (len .ObjectList) 0 }}
{{ range $obj := .ObjectList }}
<div class="quickgo-dir-link-container">
<a class="quickgo-dir-link quickgo-dir" href="{{ ObjectURL $obj }}">{{$obj.GetName}}</a>
{{ if $obj.Size }}<span class="quickgo-datasize">{{ FileSize $obj.Size }}</span>{{end}}
</div>
{{ end }}
<div class="quickgo-content-container">
{{ range $obj := .ObjectList }}
<div class="quickgo-dir-link-container">
<a class="quickgo-dir-link quickgo-dir" href="{{ ObjectURL $obj }}">{{$obj.GetName}}</a>
{{ if $obj.Size }}<span class="quickgo-datasize">{{ FileSize $obj.Size }}</span>{{end}}
</div>
{{ end }}
</div>
{{ else }}
<div style="display: flex;align-items: center;justify-content: center;height:50%;">
<h1 style="color:#ff5555;">Directory is empty</h1>
Expand Down
2 changes: 1 addition & 1 deletion quickgo/_templates/file.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{{define "content"}}
<div class="box-content">
{{ template "parent_url" . }}
<pre class="quickgo-file-content">{{.Content}}</pre>
<div class="quickgo-content-container pre">{{.Content}}</div>
</div>
{{end}}
2 changes: 1 addition & 1 deletion quickgo/_templates/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{{define "content"}}
<div class="box-content">
<h2>Index: {{.Dir.GetName}}</h2>
<pre class="quickgo-file-content">{{.Content}}</pre>
<pre class="quickgo-content-container">{{.Content}}</pre>
</div>
{{end}}
27 changes: 23 additions & 4 deletions quickgo/_templates/static/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ body{
-webkit-tap-highlight-color: transparent;

}
*, *::before, *::after {
box-sizing: border-box;
}
/* width */
::-webkit-scrollbar {
width: 10px;
height: 95%;
height: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
Expand Down Expand Up @@ -126,10 +129,11 @@ body{
margin-top:10px;
background-color: #f5f5f5;
height:85vh !important;
overflow-y: auto;
/* border-radius: 0px 0px 5px 5px; */
border-radius: 10px;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.75);
border-radius: 10px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.box-content h1,
.box-content h2,
Expand Down Expand Up @@ -165,6 +169,21 @@ body{
font-size: 18px;
padding: 4px 20px;
}
.quickgo-content-container {
overflow: auto;
height: 100%;
width: 100%;
}
.pre {
overflow: auto;
white-space: pre;
font-family: monospace;
background-color: #f5f5f5;
color: #650707;
padding: 10px;
font-size: 14px;
line-height: 16px;
}
.quickgo-dir-link-container{
border-bottom: 1px solid #bbb;
background-color: #f5f5f5;
Expand Down
2 changes: 1 addition & 1 deletion quickgo/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func PrintLogo() {
Craft(CMD_Cyan, "$$ \033[31m__\033[36m$$\\ \033[31m\\__|\033[36m $$ | "+Craft(CMD_Cyan, " $$ __$$\\ \n")) +
Craft(CMD_Blue, "$$ \033[31m/\033[34m $$ |$$\\ $$\\ $$\\ $$$$$$$\\ $$ | $$\\ "+Craft(CMD_Cyan, " $$ / \\__| $$$$$$\\ ####\n")) +
Craft(CMD_Blue, "$$ \033[31m|\033[34m $$ |$$ | $$ |$$ |$$ \033[31m_____|\033[34m$$ | $$ \033[31m|\033[34m "+Craft(CMD_Cyan, " $$ |$$$$\\ $$ __$$\\\n")) +
Craft(CMD_Blue, "$$ \033[31m|\033[34m $$ |$$ | $$ |$$ |$$ \033[31m/\033[34m $$$$$$ \033[31m/\033[34m "+Craft(CMD_Cyan, " $$ |\\_$$ |$$ / $$ | ######\n")) + // Make the middle line bold.
Craft(CMD_Blue, "$$ \033[31m|\033[34m $$ |$$ | $$ |$$ |$$ \033[31m/\033[34m $$$$$$ \033[31m/\033[34m "+Craft(CMD_Cyan, " $$ |\\_$$ |$$ / $$ | ######\n")) +
Craft(CMD_Purple, "$$ $$\\$$ |$$ | $$ |$$ |$$ | $$ _$$< "+Craft(CMD_Cyan, " $$ | $$ |$$ | $$ |\n")) +
Craft(CMD_Purple, "\\$$$$$$ / \\$$$$$$ |$$ |\\$$$$$$$\\ $$ | \\$$\\ "+Craft(CMD_Cyan, " \\$$$$$$ |\\$$$$$$ | #####\n")) +
Craft(CMD_Red, " \\___"+CMD_Reset+Craft(CMD_Purple, "$$$")+Craft(CMD_Red, "\\ \\______/ \\__| \\_______|\\__| \\__| ")+Craft(CMD_Cyan, " \\______/ \\______/\n")) +
Expand Down

0 comments on commit 17d8fcd

Please sign in to comment.