Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] fast and easy admin panel #3

Open
ghost opened this issue May 29, 2020 · 2 comments
Open

[Feature] fast and easy admin panel #3

ghost opened this issue May 29, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented May 29, 2020

Hi again,

Hope you are all well again :-) !

I wanted to suggest to create a backend with qor/admin to tor-spider:

for eg, to create an admin UI, you just have to write.

package main

import (
  "fmt"
  "net/http"
  "github.com/jinzhu/gorm"
  _ "github.com/mattn/go-sqlite3"
  "github.com/qor/admin"
)

// Create a GORM-backend model
type User struct {
  gorm.Model
  Name string
}

// Create another GORM-backend model
type Product struct {
  gorm.Model
  Name        string
  Description string
}

func main() {
  DB, _ := gorm.Open("sqlite3", "demo.db")
  DB.AutoMigrate(&User{}, &Product{})

  // Initialize
  Admin := admin.New(&admin.AdminConfig{DB: DB})

  // Allow to use Admin to manage User, Product
  Admin.AddResource(&User{})
  Admin.AddResource(&Product{})

  // initalize an HTTP request multiplexer
  mux := http.NewServeMux()

  // Mount admin interface to mux
  Admin.MountTo("/admin", mux)

  fmt.Println("Listening on: 9000")
  http.ListenAndServe(":9000", mux)
}

If you want I can do it and make a PR.

What do you think ?

Cheers,
X

@ghost ghost changed the title fast and easy admin panel [Feature] fast and easy admin panel May 29, 2020
@samirettali
Copy link
Owner

That would be great.
In fact, I wanted to implement a panel with these functionalities:

  • Send urls to collectors
  • Monitor collectors by looking what url they started from, how many they found and some similar statistics
  • Query the results
  • Check services health

@ghost
Copy link
Author

ghost commented Jun 1, 2020

For querying the result, I have this suggestion:

And to write it in Vue.js so It gonna be easy to add more features to backend.

Refs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant