Skip to content

Commit 8ba9428

Browse files
authored
feat(ui): migrate frontend from Bootstrap to shadcn + new features (#690)
- Removes Bootstrap dependency - Updates theming/colours - Adds inclusive/exclusive tag filtering #452 - Adds list defaults support to service create/edit (e.g. notify/webhook) - services start with the defaults, and when all are removed, it resets to default - Adds border/bg to service being moved - Remove duplicate of service state in use-reducer and just use the React Query state
1 parent d59a155 commit 8ba9428

513 files changed

Lines changed: 34655 additions & 22967 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
format:
2+
separate-diff: true
3+
sections:
4+
- standard # Standard library imports
5+
- default # External packages
6+
- prefix=github.com/your_project_name # Local project imports

.prettierrc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"tabWidth": 2,
3-
"useTabs": true,
4-
"singleQuote": true,
5-
"trailingComma": "all",
6-
"semi": true
7-
}
2+
"tabWidth": 2,
3+
"useTabs": true,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"semi": true,
7+
"plugins": ["prettier-plugin-tailwindcss"]
8+
}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ web: web-install web-build
4444
build: web common-build
4545

4646
.PHONY: build-all
47-
build-all: web-build compress-web build-darwin build-freebsd build-linux build-openbsd build-windows
47+
build-all: web-build compress-web build-darwin build-freebsd build-linux build-openbsd build-windows

cmd/argus/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/*
1616
Argus monitors GitHub and/or other URLs for version changes.
17-
On a version change, send notification(s) and/or webhook(s).
17+
On a version change, send notifications and/or webhooks.
1818
*/
1919
package main
2020

@@ -39,16 +39,16 @@ var (
3939
testServiceFlag = flag.String("test.service", "", "Put the name of the Service to test the version query.")
4040
)
4141

42-
// main loads the config and then calls service.Track to monitor
42+
// main loads the config and then calls `service.Track` to monitor
4343
// each Service of the config for version changes and acts on
4444
// them as defined. It also sets up the Web UI and SaveHandler.
4545
func main() {
4646
flag.Parse()
47-
flagset := make(map[string]bool)
48-
flag.Visit(func(f *flag.Flag) { flagset[f.Name] = true })
47+
flags := make(map[string]bool)
48+
flag.Visit(func(f *flag.Flag) { flags[f.Name] = true })
4949

5050
var config cfg.Config
51-
config.Load(*configFile, &flagset)
51+
config.Load(*configFile, &flags)
5252

5353
// config.check
5454
config.Print(configCheckFlag)

command/announce.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func (c *Controller) Find(command string) (int, error) {
5353
if c == nil {
5454
return 0, errors.New("controller is nil")
5555
}
56-
serviceinfo := c.ServiceStatus.GetServiceInfo()
56+
svcInfo := c.ServiceStatus.GetServiceInfo()
5757

58-
// Loop through all the Command(s).
58+
// Loop through all the Commands.
5959
for key, cmd := range *c.Command {
60-
formatted := cmd.ApplyTemplate(serviceinfo)
60+
formatted := cmd.ApplyTemplate(svcInfo)
6161
// If this key is the command.
6262
if formatted.String() == command {
6363
return key, nil

command/announce_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestController_AnnounceCommand(t *testing.T) {
6868
&status.Status{
6969
ServiceInfo: serviceinfo.ServiceInfo{
7070
ID: "some_service_id"}},
71-
&Slice{
71+
&Commands{
7272
{"ls", "-lah", "/root"},
7373
{"ls", "-lah"},
7474
{"ls", "-lah", "a"}},
@@ -151,7 +151,7 @@ func TestController_Find(t *testing.T) {
151151
t.Parallel()
152152

153153
controller := &Controller{
154-
Command: &Slice{
154+
Command: &Commands{
155155
Command{"ls", "-lah"},
156156
Command{"ls", "-lah", "a"},
157157
Command{"ls", "-lah", "b"},

command/command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ func (c *Controller) Exec(logFrom logutil.LogFrom) error {
3434
return nil
3535
}
3636

37-
serviceInfo := c.ServiceStatus.GetServiceInfo()
37+
svcInfo := c.ServiceStatus.GetServiceInfo()
3838
errChan := make(chan error)
3939
for index := range *c.Command {
4040
go func(controller *Controller, index int) {
41-
errChan <- controller.ExecIndex(logFrom, index, serviceInfo)
41+
errChan <- controller.ExecIndex(logFrom, index, svcInfo)
4242
}(c, index)
4343

4444
// Space out Command starts.

command/command_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestController_ExecIndex(t *testing.T) {
126126
svcStatus.ServiceInfo.ID = "service_id"
127127
controller.Init(
128128
svcStatus,
129-
&Slice{
129+
&Commands{
130130
{"date", "+%m-%d-%Y"},
131131
{"false"}},
132132
nil,
@@ -191,7 +191,7 @@ func TestController_Exec(t *testing.T) {
191191
// GIVEN a Controller.
192192
tests := map[string]struct {
193193
nilController bool
194-
commands *Slice
194+
commands *Commands
195195
err error
196196
stdoutRegex string
197197
noAnnounce bool
@@ -205,12 +205,12 @@ func TestController_Exec(t *testing.T) {
205205
noAnnounce: true},
206206
"single Command": {
207207
stdoutRegex: `[0-9]{2}-[0-9]{2}-[0-9]{4}\s+$`,
208-
commands: &Slice{
208+
commands: &Commands{
209209
{"date", "+%m-%d-%Y"}}},
210210
"multiple Commands": {
211211
err: fmt.Errorf("exit status 1"),
212212
stdoutRegex: `[0-9]{2}-[0-9]{2}-[0-9]{4}\s+.*'false'\s.*exit status 1\s+$`,
213-
commands: &Slice{
213+
commands: &Commands{
214214
{"date", "+%m-%d-%Y"},
215215
{"false"}}},
216216
}

command/help_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func testController(announce *chan []byte) (control *Controller) {
5151
svcStatus.ServiceInfo.ID = "service_id"
5252
control.Init(
5353
svcStatus,
54-
&Slice{{}, {}},
54+
&Commands{{}, {}},
5555
nil,
5656
test.StringPtr("14m"),
5757
)

command/init.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import (
2929
// Init the Command Controller.
3030
func (c *Controller) Init(
3131
serviceStatus *status.Status,
32-
command *Slice,
33-
shoutrrrNotifiers *shoutrrr.Slice,
32+
command *Commands,
33+
shoutrrrNotifiers *shoutrrr.Shoutrrrs,
3434
parentInterval *string,
3535
) {
3636
if c == nil || len(*command) == 0 {
@@ -109,8 +109,8 @@ func (c *Command) FormattedString() string {
109109
return fmt.Sprintf("[ \"%s\" ]", strings.Join(*c, "\", \""))
110110
}
111111

112-
// IsRunnable will return whether the current time at `index` is before nextRunnable.
113-
// If out of range, it will return false.
112+
// IsRunnable returns whether the current time at `index` is before nextRunnable.
113+
// If out of range, it returns false.
114114
func (c *Controller) IsRunnable(index int) bool {
115115
c.mutex.RLock()
116116
defer c.mutex.RUnlock()
@@ -124,7 +124,7 @@ func (c *Controller) IsRunnable(index int) bool {
124124
}
125125

126126
// NextRunnable returns the nextRunnable of the Command at `index`.
127-
// If out of range, it will return a zero time.
127+
// If out of range, it returns a zero time.
128128
func (c *Controller) NextRunnable(index int) time.Time {
129129
c.mutex.RLock()
130130
defer c.mutex.RUnlock()

0 commit comments

Comments
 (0)