Просмотр исходного кода

jobs prevent autoscroll + unique job id for opened logs

jusrhee 5 лет назад
Родитель
Сommit
656f42150e

+ 14 - 1
dashboard/src/components/values-form/FormWrapper.tsx

@@ -330,7 +330,20 @@ export default class FormWrapper extends Component<PropsType, StateType> {
       return false;
       return false;
     }
     }
 
 
-    // Check if current tab is among non-form tab options{
+    let tabs = this.props.formData?.tabs;
+    if (tabs) {
+      let matchedTab = null as any;
+      tabs.forEach((tab: any, i: number) => {
+        if (tab?.name === this.state.currentTab) {
+          matchedTab = tab;
+        }
+      });
+      if (matchedTab) {
+        return true;
+      }
+    }
+
+    // Check if current tab is among non-form tab options
     let nonFormTabValues = this.props.tabOptions?.map((tab: any, i: number) => {
     let nonFormTabValues = this.props.tabOptions?.map((tab: any, i: number) => {
       return tab.value;
       return tab.value;
     });
     });

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/env-groups/ExpandedEnvGroup.tsx

@@ -514,6 +514,7 @@ const StyledExpandedChart = styled.div`
   position: absolute;
   position: absolute;
   top: 25px;
   top: 25px;
   left: 25px;
   left: 25px;
+  overflow: hidden;
   border-radius: 10px;
   border-radius: 10px;
   background: #26272f;
   background: #26272f;
   box-shadow: 0 5px 12px 4px #00000033;
   box-shadow: 0 5px 12px 4px #00000033;

+ 2 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -400,11 +400,12 @@ export default class ExpandedJobChart extends Component<PropsType, StateType> {
           <BodyWrapper>
           <BodyWrapper>
             <FormWrapper
             <FormWrapper
               formData={this.state.formData}
               formData={this.state.formData}
-              isReadOnly={true}
               tabOptions={this.state.tabOptions}
               tabOptions={this.state.tabOptions}
               isInModal={true}
               isInModal={true}
               renderTabContents={this.renderTabContents}
               renderTabContents={this.renderTabContents}
               tabOptionsOnly={true}
               tabOptionsOnly={true}
+              onSubmit={this.handleSaveValues}
+              saveValuesStatus={this.state.saveValuesStatus}
             />
             />
           </BodyWrapper>
           </BodyWrapper>
         </StyledExpandedChart>
         </StyledExpandedChart>

+ 1 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/JobList.tsx

@@ -24,7 +24,7 @@ export default class JobList extends Component<PropsType, StateType> {
       return (
       return (
         <>
         <>
           {this.props.jobs.map((job: any, i: number) => {
           {this.props.jobs.map((job: any, i: number) => {
-            return <JobResource key={i} job={job} />;
+            return <JobResource key={job?.metadata?.name} job={job} />;
           })}
           })}
         </>
         </>
       );
       );

+ 4 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/Logs.tsx

@@ -29,10 +29,14 @@ export default class Logs extends Component<PropsType, StateType> {
     if (smooth) {
     if (smooth) {
       this.parentRef.current.lastElementChild.scrollIntoView({
       this.parentRef.current.lastElementChild.scrollIntoView({
         behavior: "smooth",
         behavior: "smooth",
+        block: "nearest",
+        inline: "start",
       });
       });
     } else {
     } else {
       this.parentRef.current.lastElementChild.scrollIntoView({
       this.parentRef.current.lastElementChild.scrollIntoView({
         behavior: "auto",
         behavior: "auto",
+        block: "nearest",
+        inline: "start",
       });
       });
     }
     }
   };
   };