Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 10d8dfa

Browse files
Nadin El-Yabroudijamesog
authored andcommitted
Set active button to only shows things not gone
1 parent c09a0cb commit 10d8dfa

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

scan.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ type indexData struct {
358358
Authenticated bool
359359
User User
360360
URI string
361-
AllResults bool
361+
ActiveOnly bool
362362
Submission submission
363363
scanData
364364
}
@@ -469,7 +469,7 @@ func index(w http.ResponseWriter, r *http.Request) {
469469
ip := q.Get("ip")
470470
firstSeen := q.Get("firstseen")
471471
lastSeen := q.Get("lastseen")
472-
_, allResults := q["all"]
472+
_, activeOnly := q["active"]
473473

474474
results, err := resultData(ip, firstSeen, lastSeen)
475475
if err != nil {
@@ -487,7 +487,7 @@ func index(w http.ResponseWriter, r *http.Request) {
487487
Authenticated: true,
488488
User: user,
489489
URI: r.URL.Path,
490-
AllResults: allResults,
490+
ActiveOnly: activeOnly,
491491
Submission: sub,
492492
scanData: results,
493493
}

views/_header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</div>
6363
</form>
6464
<a class="btn btn-primary navbar-btn" href="/job">New scan</a>
65-
<a class="btn btn-{{ if not .AllResults }}success{{ else }}default{{ end }} navbar-btn" href="/{{ if not .AllResults }}?all{{ end }}">Active only</a>
65+
<a class="btn btn-{{ if not .ActiveOnly}}success{{ else }}default{{ end }} navbar-btn" href="/{{ if not .ActiveOnly }}?active{{ end }}">Active only</a>
6666
{{ end }}
6767
{{- if ne .User.Email "" }}
6868
<ul class="nav navbar-nav navbar-right">

views/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
</tr>
1515
</thead>
1616
<tbody>
17+
{{- $ActiveOnly := .ActiveOnly }}
1718
{{- range .Results }}
1819
<tr>
20+
{{- if not (and $ActiveOnly .Gone) }}
1921
<td>
2022
{{- if .New }}<span class="label label-danger">New</span>{{ end -}}
2123
{{- if .Gone }}<span class="label label-success">Gone</span>{{ end -}}
@@ -26,6 +28,7 @@
2628
<td>{{ .Proto }}</td>
2729
<td>{{ .FirstSeen }}</td>
2830
<td>{{ .LastSeen }}</td>
31+
{{- end }}
2932
</tr>
3033
{{- else }}
3134
<div class="panel panel-warning center-block" style="width: 25%">

0 commit comments

Comments
 (0)