Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for RenderHTML (0.22 sec)

  1. pkg/ctrlz/home.go

    	_ = router.NewRoute().PathPrefix("/").Methods("GET").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		if req.URL.Path == "/" {
    			// home page
    			fw.RenderHTML(w, homeTmpl, getHomeInfo())
    		} else if req.URL.Path == "/homej" || req.URL.Path == "/homej/" {
    			fw.RenderJSON(w, http.StatusOK, getHomeInfo())
    		} else if a, err := assets.FS.ReadFile("static" + req.URL.Path); err == nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  2. pkg/ctrlz/fw/utils.go

    	w.WriteHeader(statusCode)
    	w.Header().Set("Content-Type", "text/plain; charset=utf-8")
    	_, _ = fmt.Fprintf(w, "%v", err)
    }
    
    // RenderHTML executes the given template, sending the output to the supplied response writer
    func RenderHTML(w http.ResponseWriter, t *template.Template, data any) {
    	b := &bytes.Buffer{}
    
    	if err := t.Execute(b, data); err != nil {
    		RenderError(w, http.StatusInternalServerError, err)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  3. pkg/ctrlz/topics/collection.go

    		context.Collection = collection
    		context.Key = key
    		context.Value = v
    	} else {
    		context.Error = err.Error()
    	}
    	fw.RenderHTML(w, c.itemTmpl, context)
    }
    
    func (c *collectionTopic) handleError(w http.ResponseWriter, _ *http.Request, errorText string) {
    	fw.RenderHTML(w, c.mainTmpl, mainContext{Error: errorText})
    }
    
    func (c *collectionTopic) listCollection(name string) ([]string, error) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  4. pkg/ctrlz/topics/args.go

    	tmpl := assets.ParseTemplate(context.Layout(), "templates/args.html")
    
    	_ = context.HTMLRouter().StrictSlash(true).NewRoute().Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderHTML(w, tmpl, os.Args)
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  5. pkg/ctrlz/topics/version.go

    	tmpl := assets.ParseTemplate(context.Layout(), "templates/version.html")
    
    	_ = context.HTMLRouter().StrictSlash(true).NewRoute().Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderHTML(w, tmpl, &version.Info)
    	})
    
    	_ = context.JSONRouter().StrictSlash(true).NewRoute().Methods("GET").Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderJSON(w, http.StatusOK, &version.Info)
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  6. pkg/ctrlz/topics/signals.go

    	tmpl := assets.ParseTemplate(context.Layout(), "templates/signals.html")
    
    	_ = context.HTMLRouter().StrictSlash(true).NewRoute().Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderHTML(w, tmpl, nil)
    	})
    
    	_ = context.JSONRouter().StrictSlash(true).NewRoute().Methods("PUT", "POST").Path("/SIGUSR1").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		err := syscall.Kill(os.Getpid(), syscall.SIGUSR1)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 07 17:12:24 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  7. pkg/ctrlz/topics/env.go

    	tmpl := assets.ParseTemplate(context.Layout(), "templates/env.html")
    
    	_ = context.HTMLRouter().StrictSlash(true).NewRoute().Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderHTML(w, tmpl, getVars())
    	})
    
    	_ = context.JSONRouter().StrictSlash(true).NewRoute().Methods("GET").Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderJSON(w, http.StatusOK, getVars())
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  8. pkg/ctrlz/topics/mem.go

    	_ = context.HTMLRouter().StrictSlash(true).NewRoute().Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		ms := &runtime.MemStats{}
    		runtime.ReadMemStats(ms)
    		fw.RenderHTML(w, tmpl, ms)
    	})
    
    	_ = context.JSONRouter().StrictSlash(true).NewRoute().Methods("GET").Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		ms := &runtime.MemStats{}
    		runtime.ReadMemStats(ms)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. pkg/ctrlz/topics/proc.go

    	tmpl := assets.ParseTemplate(context.Layout(), "templates/proc.html")
    
    	_ = context.HTMLRouter().StrictSlash(true).NewRoute().Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderHTML(w, tmpl, getProcInfo())
    	})
    
    	_ = context.JSONRouter().StrictSlash(true).NewRoute().Methods("GET").Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		fw.RenderJSON(w, http.StatusOK, getProcInfo())
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  10. src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go

    	if err != nil {
    		http.Error(w, err.Error(), http.StatusBadRequest)
    		ui.options.UI.PrintErr(err)
    		return nil, nil
    	}
    	return rpt, catcher.errors
    }
    
    // renderHTML generates html using the named template based on the contents of data.
    func renderHTML(dst io.Writer, tmpl string, rpt *report.Report, errList, legend []string, data webArgs) error {
    	file := getFromLegend(legend, "File: ", "unknown")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 19:48:28 UTC 2024
    - 14K bytes
    - Viewed (0)
Back to top