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 {
|
type SavedFilter struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
User string `gorm:"index" json:"user"`
|
User string `gorm:"index" json:"user"`
|
||||||
Folder string `json:"folder"`
|
Shared bool `json:"shared"`
|
||||||
Description string `json:"description" binding:"required"`
|
Description string `json:"description" binding:"required"`
|
||||||
Content string `json:"content" binding:"required"`
|
Content string `json:"content" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestSavedFilter(t *testing.T) {
|
|||||||
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
||||||
ID: 17,
|
ID: 17,
|
||||||
User: "marty",
|
User: "marty",
|
||||||
|
Shared: false,
|
||||||
Description: "marty's filter",
|
Description: "marty's filter",
|
||||||
Content: "SrcAS = 12322",
|
Content: "SrcAS = 12322",
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
@@ -23,7 +24,7 @@ func TestSavedFilter(t *testing.T) {
|
|||||||
}
|
}
|
||||||
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
||||||
User: "judith",
|
User: "judith",
|
||||||
Folder: "something",
|
Shared: true,
|
||||||
Description: "judith's filter",
|
Description: "judith's filter",
|
||||||
Content: "InIfBoundary = external",
|
Content: "InIfBoundary = external",
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
@@ -31,7 +32,7 @@ func TestSavedFilter(t *testing.T) {
|
|||||||
}
|
}
|
||||||
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
if err := c.CreateSavedFilter(context.Background(), SavedFilter{
|
||||||
User: "marty",
|
User: "marty",
|
||||||
Folder: "else",
|
Shared: true,
|
||||||
Description: "marty's second filter",
|
Description: "marty's second filter",
|
||||||
Content: "InIfBoundary = internal",
|
Content: "InIfBoundary = internal",
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
@@ -47,12 +48,13 @@ func TestSavedFilter(t *testing.T) {
|
|||||||
{
|
{
|
||||||
ID: 1,
|
ID: 1,
|
||||||
User: "marty",
|
User: "marty",
|
||||||
|
Shared: false,
|
||||||
Description: "marty's filter",
|
Description: "marty's filter",
|
||||||
Content: "SrcAS = 12322",
|
Content: "SrcAS = 12322",
|
||||||
}, {
|
}, {
|
||||||
ID: 3,
|
ID: 3,
|
||||||
User: "marty",
|
User: "marty",
|
||||||
Folder: "else",
|
Shared: true,
|
||||||
Description: "marty's second filter",
|
Description: "marty's second filter",
|
||||||
Content: "InIfBoundary = internal",
|
Content: "InIfBoundary = internal",
|
||||||
},
|
},
|
||||||
@@ -69,7 +71,7 @@ func TestSavedFilter(t *testing.T) {
|
|||||||
{
|
{
|
||||||
ID: 3,
|
ID: 3,
|
||||||
User: "marty",
|
User: "marty",
|
||||||
Folder: "else",
|
Shared: true,
|
||||||
Description: "marty's second filter",
|
Description: "marty's second filter",
|
||||||
Content: "InIfBoundary = internal",
|
Content: "InIfBoundary = internal",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ UNION DISTINCT
|
|||||||
StatusCode: 204,
|
StatusCode: 204,
|
||||||
JSONInput: gin.H{
|
JSONInput: gin.H{
|
||||||
"description": "test 1",
|
"description": "test 1",
|
||||||
"folder": "here",
|
|
||||||
"content": "InIfBoundary = external",
|
"content": "InIfBoundary = external",
|
||||||
},
|
},
|
||||||
ContentType: "application/json; charset=utf-8",
|
ContentType: "application/json; charset=utf-8",
|
||||||
@@ -207,8 +206,8 @@ UNION DISTINCT
|
|||||||
JSONOutput: gin.H{"filters": []gin.H{
|
JSONOutput: gin.H{"filters": []gin.H{
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
"shared": false,
|
||||||
"user": "__default",
|
"user": "__default",
|
||||||
"folder": "here",
|
|
||||||
"description": "test 1",
|
"description": "test 1",
|
||||||
"content": "InIfBoundary = external",
|
"content": "InIfBoundary = external",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user