refactor(web): create /tfm directory for TFM pages
This commit is contained in:
parent
8c2fba25f0
commit
9bfb9f89fe
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>File Manager | Tanabata</title>
|
||||
<title>Files | Tanabata File Manager</title>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/images/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/images/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/images/apple-icon-72x72.png">
|
||||
@ -28,7 +28,7 @@
|
||||
<script src="/js/tdbms.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Tanabata File Manager</h1>
|
||||
<h1>TFM Files</h1>
|
||||
<main>
|
||||
<div class="contents-wrapper">
|
||||
</div>
|
||||
39
web/public/tfm/index.html
Normal file
39
web/public/tfm/index.html
Normal file
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Tanabata File Manager</title>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/images/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/images/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/images/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/images/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/images/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/images/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/images/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/images/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/images/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/images/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
|
||||
<link rel="manifest" href="/tanabata.webmanifest">
|
||||
<meta name="msapplication-TileColor" content="#5c913b">
|
||||
<meta name="msapplication-TileImage" content="/images/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#5c913b">
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/general.css">
|
||||
<script src="/js/jquery-3.6.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to Tanabata File Manager!</h1>
|
||||
<main>
|
||||
<h2>Files or tags?</h2>
|
||||
<div class="contents-wrapper">
|
||||
<a href="/tfm/files" class="btn btn-primary">Files</a>
|
||||
<a href="/tfm/tags" class="btn btn-primary">Tags</a>
|
||||
<a href="/" class="btn btn-outline-secondary">Home</a>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@ -175,7 +175,10 @@ func main() {
|
||||
}
|
||||
public_fs := http.FileServer(http.Dir("/srv/www/tanabata"))
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" && path.Ext(r.URL.Path) == "" {
|
||||
if r.URL.Path == "/tfm" {
|
||||
r.URL.Path += "/"
|
||||
}
|
||||
if r.URL.Path[len(r.URL.Path)-1] != '/' && path.Ext(r.URL.Path) == "" {
|
||||
r.URL.Path += ".html"
|
||||
}
|
||||
public_fs.ServeHTTP(w, r)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user