You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							38 lines
						
					
					
						
							884 B
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							38 lines
						
					
					
						
							884 B
						
					
					
				
								package weed_server
							 | 
						|
								
							 | 
						|
								import (
							 | 
						|
									"net/http"
							 | 
						|
									"path/filepath"
							 | 
						|
									"time"
							 | 
						|
								
							 | 
						|
									"github.com/chrislusf/seaweedfs/go/stats"
							 | 
						|
									"github.com/chrislusf/seaweedfs/go/util"
							 | 
						|
									ui "github.com/chrislusf/seaweedfs/go/weed/weed_server/volume_server_ui"
							 | 
						|
								)
							 | 
						|
								
							 | 
						|
								func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
							 | 
						|
									infos := make(map[string]interface{})
							 | 
						|
									infos["Up Time"] = time.Now().Sub(startTime).String()
							 | 
						|
									var ds []*stats.DiskStatus
							 | 
						|
									for _, loc := range vs.store.Locations {
							 | 
						|
										if dir, e := filepath.Abs(loc.Directory); e == nil {
							 | 
						|
											ds = append(ds, stats.NewDiskStatus(dir))
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
									args := struct {
							 | 
						|
										Version      string
							 | 
						|
										Master       string
							 | 
						|
										Volumes      interface{}
							 | 
						|
										DiskStatuses interface{}
							 | 
						|
										Stats        interface{}
							 | 
						|
										Counters     *stats.ServerStats
							 | 
						|
									}{
							 | 
						|
										util.VERSION,
							 | 
						|
										vs.masterNode,
							 | 
						|
										vs.store.Status(),
							 | 
						|
										ds,
							 | 
						|
										infos,
							 | 
						|
										serverStats,
							 | 
						|
									}
							 | 
						|
									ui.StatusTpl.Execute(w, args)
							 | 
						|
								}
							 |