Skip to content

Commit

Permalink
JS link, bootstrap upd
Browse files Browse the repository at this point in the history
  • Loading branch information
aceberg committed Jan 5, 2024
1 parent d21f659 commit eee3c1d
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 476 deletions.
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module github.com/aceberg/WatchYourLAN

go 1.21.2
go 1.21.4

require (
github.com/containrrr/shoutrrr v0.8.0
github.com/google/uuid v1.4.0
github.com/google/uuid v1.5.0
github.com/jmoiron/sqlx v1.3.5
github.com/spf13/viper v1.17.0
golang.org/x/crypto v0.14.0
modernc.org/sqlite v1.27.0
github.com/spf13/viper v1.18.2
golang.org/x/crypto v0.17.0
modernc.org/sqlite v1.28.0
)

require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/magiconair/properties v1.8.7 // indirect
Expand All @@ -23,19 +23,19 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
482 changes: 26 additions & 456 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/web/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func configHandler(w http.ResponseWriter, r *http.Request) {
version := string(file)
guiData.Version = version[8:]

guiData.Themes = []string{"cerulean", "cosmo", "cyborg", "darkly", "flatly", "journal", "litera", "lumen", "lux", "materia", "minty", "morph", "pulse", "quartz", "sandstone", "simplex", "sketchy", "slate", "solar", "spacelab", "superhero", "united", "vapor", "yeti", "zephyr"}
guiData.Themes = []string{"cerulean", "cosmo", "cyborg", "darkly", "emerald", "flatly", "grass", "journal", "litera", "lumen", "lux", "materia", "minty", "morph", "pulse", "quartz", "sand", "sandstone", "simplex", "sketchy", "slate", "solar", "spacelab", "superhero", "united", "vapor", "yeti", "zephyr"}

execTemplate(w, "config", guiData)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/web/templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<body>
<div class="container-lg mt-5">
<div class="row">
<div class="col-md-6">
<div class="col-md-6 table-responsive">
<table class="table">
<form action="/save_config/" method="post">
<tr>
Expand Down
2 changes: 0 additions & 2 deletions internal/web/templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{ define "footer"}}
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
</html>
{{ end }}
6 changes: 4 additions & 2 deletions internal/web/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<link href="data:image/x-icon;base64,{{ .Config.Icon }}" rel="icon" type="image/x-icon" />
{{ if eq .Config.NodePath "" }}
<!-- Bootstrap and theme -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/aceberg/aceberg-bootswatch-fork@v5/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<!-- Font for icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
{{ else }}
<link rel="stylesheet" href="{{ .Config.NodePath }}/node_modules/bootstrap-icons/font/bootstrap-icons.css">
<link href="{{ .Config.NodePath }}/node_modules/bootswatch/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
<script src="{{ .Config.NodePath }}/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
{{ end }}
</head>
<body>
Expand Down
6 changes: 3 additions & 3 deletions internal/web/templates/host.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<body>
<div class="container-lg mt-5">
<div class="row">
<div class="col table-responsive">
<div class="col-md table-responsive">
<table class="table">
{{ range .Hosts }}
<tr>
Expand Down Expand Up @@ -61,7 +61,7 @@
{{ end }}
</table>
</div>
<div class="col">
<div class="col-md table-responsive">
<table class="table">
<tr>
<td class="align-middle">Domain name</td>
Expand Down Expand Up @@ -98,7 +98,7 @@
{{ end }}
</div>
</div>
<div class="row">
<div class="row table-responsive">
<table class="table table-striped">
<tr>
<th>Name</th>
Expand Down

0 comments on commit eee3c1d

Please sign in to comment.