mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
Revert "console: allow to put filters into folders"
This reverts commit 1238dfc552. No need
for folders. Description may contain a `/` if we want.
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
type SavedFilter struct {
|
||||
ID uint `json:"id"`
|
||||
User string `gorm:"index" json:"user"`
|
||||
Folder string `json:"folder"`
|
||||
Shared bool `json:"shared"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ func TestSavedFilter(t *testing.T) {
|
||||
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
||||
ID: 17,
|
||||
User: "marty",
|
||||
Shared: false,
|
||||
Description: "marty's filter",
|
||||
Content: "SrcAS = 12322",
|
||||
}); err != nil {
|
||||
@@ -23,7 +24,7 @@ func TestSavedFilter(t *testing.T) {
|
||||
}
|
||||
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
||||
User: "judith",
|
||||
Folder: "something",
|
||||
Shared: true,
|
||||
Description: "judith's filter",
|
||||
Content: "InIfBoundary = external",
|
||||
}); err != nil {
|
||||
@@ -31,7 +32,7 @@ func TestSavedFilter(t *testing.T) {
|
||||
}
|
||||
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
||||
User: "marty",
|
||||
Folder: "else",
|
||||
Shared: true,
|
||||
Description: "marty's second filter",
|
||||
Content: "InIfBoundary = internal",
|
||||
}); err != nil {
|
||||
@@ -47,12 +48,13 @@ func TestSavedFilter(t *testing.T) {
|
||||
{
|
||||
ID: 1,
|
||||
User: "marty",
|
||||
Shared: false,
|
||||
Description: "marty's filter",
|
||||
Content: "SrcAS = 12322",
|
||||
}, {
|
||||
ID: 3,
|
||||
User: "marty",
|
||||
Folder: "else",
|
||||
Shared: true,
|
||||
Description: "marty's second filter",
|
||||
Content: "InIfBoundary = internal",
|
||||
},
|
||||
@@ -69,7 +71,7 @@ func TestSavedFilter(t *testing.T) {
|
||||
{
|
||||
ID: 3,
|
||||
User: "marty",
|
||||
Folder: "else",
|
||||
Shared: true,
|
||||
Description: "marty's second filter",
|
||||
Content: "InIfBoundary = internal",
|
||||
},
|
||||
|
||||
@@ -197,7 +197,6 @@ UNION DISTINCT
|
||||
StatusCode: 204,
|
||||
JSONInput: gin.H{
|
||||
"description": "test 1",
|
||||
"folder": "here",
|
||||
"content": "InIfBoundary = external",
|
||||
},
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
@@ -207,8 +206,8 @@ UNION DISTINCT
|
||||
JSONOutput: gin.H{"filters": []gin.H{
|
||||
{
|
||||
"id": 1,
|
||||
"shared": false,
|
||||
"user": "__default",
|
||||
"folder": "here",
|
||||
"description": "test 1",
|
||||
"content": "InIfBoundary = external",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user