mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 10:06:26 +00:00
Small tweaks
This commit is contained in:
@ -85,21 +85,6 @@ func getQueryVarInt(r *http.Request, varName string, required bool, defaultValue
|
||||
return varInt, nil
|
||||
}
|
||||
|
||||
/*
|
||||
func getQueryVarBool(r *http.Request, varName string, required bool, defaultValue bool) (bool, error) {
|
||||
queryValues := r.URL.Query()
|
||||
varValue := queryValues.Get(varName)
|
||||
|
||||
if varValue == "" && required {
|
||||
return false, eris.Errorf("%v was not supplied in the request", varName)
|
||||
} else if varValue == "" {
|
||||
return defaultValue, nil
|
||||
}
|
||||
|
||||
return varValue == "true" || varValue == "1" || varValue == "on", nil
|
||||
}
|
||||
*/
|
||||
|
||||
func getURLParamInt(r *http.Request, varName string) (uint, error) {
|
||||
var defaultValue uint = 0
|
||||
|
||||
|
@ -2,11 +2,12 @@ package entity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"npm/internal/logger"
|
||||
"npm/internal/util"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"npm/internal/logger"
|
||||
"npm/internal/util"
|
||||
|
||||
"github.com/rotisserie/eris"
|
||||
)
|
||||
|
||||
|
@ -15,7 +15,7 @@ type Sort struct {
|
||||
Direction string `json:"direction"`
|
||||
}
|
||||
|
||||
// TableName overrides the table name used by gorm
|
||||
// GetSort ...
|
||||
func (p *PageInfo) GetSort(def Sort) []Sort {
|
||||
if p.Sort == nil {
|
||||
return []Sort{def}
|
||||
|
@ -3,10 +3,11 @@ package util
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"npm/internal/logger"
|
||||
"regexp"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"npm/internal/logger"
|
||||
)
|
||||
|
||||
// CleanupWhitespace will trim up and remove extra lines and stuff
|
||||
|
Reference in New Issue
Block a user