Przeglądaj źródła

fixed docker mount problem

Help-14 3 lat temu
rodzic
commit
bdae13d993
4 zmienionych plików z 81 dodań i 9 usunięć
  1. 1 2
      .gitignore
  2. 12 0
      src/common/config.yaml
  3. 67 0
      src/common/data.yaml
  4. 1 7
      src/main.go

+ 1 - 2
.gitignore

@@ -104,5 +104,4 @@ dist
 .tern-port
 
 src/temp
-src/build
-src/common/*.yaml
+src/build

+ 12 - 0
src/common/config.yaml

@@ -0,0 +1,12 @@
+website:
+  theme: "flame"
+  title: "Magma Dashboard"
+  description: ""
+  language: "en"
+  localization: "en-US"
+  useMetric: true
+openweathermap:
+  apiKey:
+  lon:
+  lat:
+addons:

+ 67 - 0
src/common/data.yaml

@@ -0,0 +1,67 @@
+data:
+  - title: Applications
+    columns:
+      - title: Servers
+        bookmarks:
+          - name: OpenWRT
+            icon: fa-solid fa-wifi
+            url: https://openwrt.org
+          - name: Proxmox
+            icon: fa-solid fa-rectangle-xmark
+            url: https://www.proxmox.com/en/
+          - name: Home Assistant
+            icon: fa-solid fa-house
+            url: https://www.home-assistant.io
+          - name: Docker
+            icon: fa-brands fa-docker
+            url: https://www.docker.com
+      - title: Nas
+        bookmarks:
+          - name: TrueNas
+            icon: fa-solid fa-server
+            url: https://www.truenas.com
+          - name: Kerberos
+            icon: fa-solid fa-video
+            url: https://kerberos.io
+          - name: jDownloader
+            icon: fa-solid fa-cloud-arrow-down
+            url: https://jdownloader.org
+      - title: Monitoring
+        bookmarks:
+          - name: Grafana
+            icon: fa-solid fa-server
+            url: https://grafana.com
+          - name: InfluxDb
+            icon: fa-solid fa-database
+            url: https://www.influxdata.com
+      - title: Tools
+        bookmarks:
+          - name: Bitwarden
+            icon: fa-solid fa-shield-halved
+            url: https://bitwarden.com
+  - title: Bookmarks
+    columns:
+      - title: Social Media
+        bookmarks:
+          - name: Facebook
+            icon: fa-brands fa-facebook
+            url: https://www.facebook.com
+          - name: Reddit
+            icon: fa-brands fa-reddit
+            url: https://www.reddit.com
+          - name: Youtube
+            icon: fa-brands fa-youtube
+            url: https://www.youtube.com
+      - title: Shopping
+        bookmarks:
+          - name: Shopee
+            icon: fa-solid fa-bag-shopping
+            url: https://shopee.vn
+          - name: Lazada
+            icon: fa-brands fa-amazon
+            url: https://www.amazon.com
+      - title: Tools
+        bookmarks:
+          - name: Maps
+            icon: fa-solid fa-map
+            url: https://www.google.com/maps

+ 1 - 7
src/main.go

@@ -22,7 +22,7 @@ var websiteData = struct {
 
 func main() {
 	pwd, _ = os.Getwd()
-	prepareSampleFiles()
+	modules.CopyDirectory("./common", "./data")
 	appConfig = modules.LoadConfig()
 
 	websiteData.Config = appConfig.Website
@@ -75,9 +75,3 @@ func serveTemplate(w http.ResponseWriter, r *http.Request) {
 	tmpl, _ := template.ParseFiles(lp)
 	tmpl.Execute(w, websiteData)
 }
-
-func prepareSampleFiles() {
-	commonPath := filepath.Join(pwd, "common")
-	dataPath := filepath.Join(pwd, "data")
-	modules.CopyDirectory(commonPath, dataPath)
-}