فهرست منبع

Merge branch 'feat/event-list-logs-improvement' of github.com-meehawk:porter-dev/porter into dev

Soham Parekh 3 سال پیش
والد
کامیت
2d9a4fc0a5
3فایلهای تغییر یافته به همراه7 افزوده شده و 7 حذف شده
  1. 2 2
      api/client/k8s.go
  2. 1 1
      cli/cmd/stack.go
  3. 4 4
      dashboard/src/main/home/cluster-dashboard/expanded-chart/events/EventList.tsx

+ 2 - 2
api/client/k8s.go

@@ -64,7 +64,7 @@ func (c *Client) GetKubeconfig(
 	resp := &types.GetTemporaryKubeconfigResponse{}
 
 	if localKubeconfigPath != "" {
-		color.New(color.FgBlue).Printf("using local kubeconfig: %s\n", localKubeconfigPath)
+		color.New(color.FgBlue).Fprintf(os.Stderr, "using local kubeconfig: %s\n", localKubeconfigPath)
 
 		if _, err := os.Stat(localKubeconfigPath); !os.IsNotExist(err) {
 			file, err := os.Open(localKubeconfigPath)
@@ -85,7 +85,7 @@ func (c *Client) GetKubeconfig(
 		}
 	}
 
-	color.New(color.FgBlue).Println("using remote kubeconfig")
+	color.New(color.FgBlue).Fprintln(os.Stderr, "using remote kubeconfig")
 
 	err := c.getRequest(
 		fmt.Sprintf(

+ 1 - 1
cli/cmd/stack.go

@@ -26,7 +26,7 @@ var stackEnvGroupCmd = &cobra.Command{
 	Aliases: []string{"eg", "envgroup", "env-groups", "envgroups"},
 	Short:   "Commands to add or remove an env group in a stack",
 	Run: func(cmd *cobra.Command, args []string) {
-		color.New(color.FgRed).Println("need to specify an operation to continue")
+		color.New(color.FgRed).Fprintln(os.Stderr, "need to specify an operation to continue")
 	},
 }
 

+ 4 - 4
dashboard/src/main/home/cluster-dashboard/expanded-chart/events/EventList.tsx

@@ -121,11 +121,11 @@ const EventList: React.FC<Props> = ({ filters, namespace, setLogData }) => {
               namespace,
               revision: events[0]?.revision,
               start_range: dayjs(events[0]?.last_seen)
-                .subtract(14, "day")
                 .toISOString(),
-              end_range: dayjs(events[0]?.last_seen).toISOString(),
+              end_range: dayjs(events[0]?.last_seen).add(14, 'day').toISOString(),
               limit: 100,
-              direction: Direction.backward,
+              direction: Direction.forward,
+              search_param: '',
             },
             {
               cluster_id: currentCluster.id,
@@ -135,7 +135,7 @@ const EventList: React.FC<Props> = ({ filters, namespace, setLogData }) => {
           .then((res) => {
             const logs = parseLogs(
               res.data.logs?.filter(Boolean).map((logLine: any) => logLine.line)
-            ).reverse();
+            );
             setLogs(logs);
           });