mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-10-30 15:45:05 +01:00 
			
		
		
		
	update frontend; add Walltime to meta.json struct
This commit is contained in:
		
							
								
								
									
										2
									
								
								frontend
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								frontend
									
									
									
									
									
								
							 Submodule frontend updated: 63c44bf55b...d8b1232bcb
									
								
							
							
								
								
									
										14
									
								
								routes.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								routes.go
									
									
									
									
									
								
							| @@ -5,6 +5,7 @@ import ( | |||||||
| 	"net/url" | 	"net/url" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
|  | 	"time" | ||||||
|  |  | ||||||
| 	"github.com/ClusterCockpit/cc-backend/auth" | 	"github.com/ClusterCockpit/cc-backend/auth" | ||||||
| 	"github.com/ClusterCockpit/cc-backend/config" | 	"github.com/ClusterCockpit/cc-backend/config" | ||||||
| @@ -72,6 +73,19 @@ func buildFilterPresets(query url.Values) map[string]interface{} { | |||||||
| 			filterPresets["arrayJobId"] = num | 			filterPresets["arrayJobId"] = num | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | 	if query.Get("startTime") != "" { | ||||||
|  | 		parts := strings.Split(query.Get("startTime"), "-") | ||||||
|  | 		if len(parts) == 2 { | ||||||
|  | 			a, e1 := strconv.ParseInt(parts[0], 10, 64) | ||||||
|  | 			b, e2 := strconv.ParseInt(parts[1], 10, 64) | ||||||
|  | 			if e1 == nil && e2 == nil { | ||||||
|  | 				filterPresets["startTime"] = map[string]string{ | ||||||
|  | 					"from": time.Unix(a, 0).Format(time.RFC3339), | ||||||
|  | 					"to":   time.Unix(b, 0).Format(time.RFC3339), | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return filterPresets | 	return filterPresets | ||||||
| } | } | ||||||
|   | |||||||
| @@ -53,6 +53,7 @@ type Job struct { | |||||||
| type JobMeta struct { | type JobMeta struct { | ||||||
| 	ID *int64 `json:"id,omitempty"` // never used in the job-archive, only available via REST-API | 	ID *int64 `json:"id,omitempty"` // never used in the job-archive, only available via REST-API | ||||||
| 	BaseJob | 	BaseJob | ||||||
|  | 	Walltime   int64                    `json:"walltime"` // TODO: Missing in DB | ||||||
| 	StartTime  int64                    `json:"startTime" db:"start_time"` | 	StartTime  int64                    `json:"startTime" db:"start_time"` | ||||||
| 	Statistics map[string]JobStatistics `json:"statistics,omitempty"` | 	Statistics map[string]JobStatistics `json:"statistics,omitempty"` | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user