Skip to content

Conversation

@adderly
Copy link

@adderly adderly commented Mar 17, 2023

In cases where you would like to include uadmin as handler in another web framework.

For me it was iris-go:


package main

import (
	"time"

	"github.com/kataras/iris/v12"
	"github.com/uadmin/uadmin"
)

type Todo struct {
	uadmin.Model
	Name        string
	Description string `uadmin:"html"`
	TargetDate  time.Time
	Progress    int `uadmin:"progress_bar"`
}

func main() {     
  app := iris.New()
  uadmin.Register(Todo{})
  //--> Returns a muxer with the registered handlers
  rootUrl, _, mux := uadmin.StartServerWithMux()

  //---> creates a handler for iris from net/http
  handler := iris.FromStd(mux)

  //---> uses bind the handler parse previously
  app.Any(rootUrl, handler)
  app.Any(rootUrl+"/{p:path}", handler)
  
  app.Listen(":8888")
}

adderly and others added 30 commits March 16, 2023 23:34
Updating master branch to  upstream
* WIP: add better errors & improve data fetching
* WIP: reworking d_api for the DApiModelkeyVal
* Added handler for api auth, to validate if the request is allowed
* Added validation to handle of the user email can be repeated
* Added error handler on crop image
* Added default model to global
* Added new folder with the view files
* Added password validation
* Added translation multilingual code UNTESTED
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

Successfully merging this pull request may close these issues.

1 participant