Version flag; close #175; improve error logging
Fix #175 improve error logging build assetspull/185/head
parent
f9bfe32f7a
commit
24dbcb87ba
|
@ -131,6 +131,9 @@ export default {
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
window.removeEventListener('keydown', this.keyEvent)
|
window.removeEventListener('keydown', this.keyEvent)
|
||||||
},
|
},
|
||||||
|
destroyed () {
|
||||||
|
this.$store.commit('updateRequest', {})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations([ 'setLoading' ]),
|
...mapMutations([ 'setLoading' ]),
|
||||||
fetchData () {
|
fetchData () {
|
||||||
|
|
|
@ -32,6 +32,8 @@ var (
|
||||||
allowCommands bool
|
allowCommands bool
|
||||||
allowEdit bool
|
allowEdit bool
|
||||||
allowNew bool
|
allowNew bool
|
||||||
|
showVer bool
|
||||||
|
version = "master"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -46,6 +48,7 @@ func init() {
|
||||||
flag.BoolVar(&allowEdit, "allow-edit", true, "Default allow edit option for new users")
|
flag.BoolVar(&allowEdit, "allow-edit", true, "Default allow edit option for new users")
|
||||||
flag.BoolVar(&allowNew, "allow-new", true, "Default allow new option for new users")
|
flag.BoolVar(&allowNew, "allow-new", true, "Default allow new option for new users")
|
||||||
flag.StringVar(&plugin, "plugin", "", "Plugin you want to enable")
|
flag.StringVar(&plugin, "plugin", "", "Plugin you want to enable")
|
||||||
|
flag.BoolVarP(&showVer, "version", "v", false, "Show version")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupViper() {
|
func setupViper() {
|
||||||
|
@ -79,6 +82,11 @@ func main() {
|
||||||
setupViper()
|
setupViper()
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if showVer {
|
||||||
|
fmt.Println("filemanager version", version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
// Add a configuration file if set.
|
// Add a configuration file if set.
|
||||||
if config != "" {
|
if config != "" {
|
||||||
ext := filepath.Ext(config)
|
ext := filepath.Ext(config)
|
||||||
|
|
|
@ -440,8 +440,9 @@ func (m *FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
w.Write([]byte(err.Error()))
|
w.Write([]byte(err.Error()))
|
||||||
} else {
|
} else {
|
||||||
log.Print(code)
|
txt := http.StatusText(code)
|
||||||
w.Write([]byte(http.StatusText(code)))
|
log.Printf("%v: %v %v\n", r.URL.Path, code, txt)
|
||||||
|
w.Write([]byte(txt))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
582
rice-box.go
582
rice-box.go
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue