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

Merge pull request #652 from porter-dev/0.3.0-job-fe-upgrades

log newjob
jusrhee 5 лет назад
Родитель
Сommit
bbd8a2ffd2

+ 4 - 7
dashboard/src/components/values-form/InputRow.tsx

@@ -72,19 +72,16 @@ const InputWrapper = styled.div`
   align-items: center;
 `;
 
-const Input = styled.input<{ disabled: boolean, width: string }>`
+const Input = styled.input<{ disabled: boolean; width: string }>`
   outline: none;
   border: none;
   font-size: 13px;
   background: #ffffff11;
   border: 1px solid #ffffff55;
-  cursor: ${props =>
-    props.disabled ? "not-allowed" : ""};
+  cursor: ${(props) => (props.disabled ? "not-allowed" : "")};
   border-radius: 3px;
-  width: ${props =>
-    props.width ? props.width : "270px"};
-  color: ${props =>
-    props.disabled ? "#ffffff44" : "white"};
+  width: ${(props) => (props.width ? props.width : "270px")};
+  color: ${(props) => (props.disabled ? "#ffffff44" : "white")};
   padding: 5px 10px;
   height: 35px;
 `;

+ 3 - 1
dashboard/src/components/values-form/ValuesForm.tsx

@@ -54,7 +54,9 @@ export default class ValuesForm extends Component<PropsType, StateType> {
 
       // If no name is assigned use values.yaml variable as identifier
       let key = item.name || item.variable;
-      let isDisabled = item.settings?.disableAfterLaunch && !this.props.externalValues?.isLaunch;
+      let isDisabled =
+        item.settings?.disableAfterLaunch &&
+        !this.props.externalValues?.isLaunch;
       isDisabled = isDisabled || this.props.disabled;
 
       switch (item.type) {

+ 2 - 2
dashboard/src/main/home/Home.tsx

@@ -221,8 +221,8 @@ class Home extends Component<PropsType, StateType> {
 
     // Initialize Highlight
     if (
-      window.location.href.includes("dashboard.getporter.dev")
-      && !user.email.includes("@getporter.dev")
+      window.location.href.includes("dashboard.getporter.dev") &&
+      !user.email.includes("@getporter.dev")
     ) {
       H.init("y2d13lgr");
       H.identify(user.email, { id: user.id });

+ 14 - 11
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -82,13 +82,16 @@ export default class ExpandedJobChart extends Component<PropsType, StateType> {
       .then((res) => {
         let image = res.data?.config?.image?.repository;
         if (image === "porterdev/hello-porter-job") {
-          this.setState({ 
-            currentChart: res.data, 
-            loading: false,
-            imageIsPlaceholder: true,
-          }, () => {
-            this.updateTabs();
-          });
+          this.setState(
+            {
+              currentChart: res.data,
+              loading: false,
+              imageIsPlaceholder: true,
+            },
+            () => {
+              this.updateTabs();
+            }
+          );
         } else {
           this.setState({ currentChart: res.data, loading: false }, () => {
             this.updateTabs();
@@ -263,10 +266,11 @@ export default class ExpandedJobChart extends Component<PropsType, StateType> {
                 <Header>
                   <Spinner src={loading} /> This job is currently being deployed
                 </Header>
-                Navigate to the "Actions" tab of your GitHub repo to view live build logs.
+                Navigate to the "Actions" tab of your GitHub repo to view live
+                build logs.
               </TextWrap>
             </Placeholder>
-          )
+          );
         }
         return (
           <TabWrapper>
@@ -463,8 +467,7 @@ export default class ExpandedJobChart extends Component<PropsType, StateType> {
 
 ExpandedJobChart.contextType = Context;
 
-const TextWrap = styled.div`
-`;
+const TextWrap = styled.div``;
 
 const Header = styled.div`
   font-weight: 500;

+ 9 - 9
dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/JobResource.tsx

@@ -130,7 +130,7 @@ export default class JobResource extends Component<PropsType, StateType> {
       envArray.forEach((env: any, i: number) => {
         envObject[env.name] = env.value;
       });
-    
+
     // Handle no config to show
     if (!commandString && _.isEmpty(envObject)) {
       return;
@@ -155,13 +155,13 @@ export default class JobResource extends Component<PropsType, StateType> {
             Hide Job Config
           </ExpandConfigBar>
           <ConfigSection>
-            {
-              commandString ? (
-                <>Command: <Command>{commandString}</Command></>
-              ) : (
-                <DarkMatter size="-18px" />
-              )
-            }
+            {commandString ? (
+              <>
+                Command: <Command>{commandString}</Command>
+              </>
+            ) : (
+              <DarkMatter size="-18px" />
+            )}
             {!_.isEmpty(envObject) && (
               <>
                 <KeyValueArray
@@ -273,7 +273,7 @@ JobResource.contextType = Context;
 
 const DarkMatter = styled.div<{ size?: string }>`
   width: 100%;
-  margin-bottom: ${props => props.size || "-13px"};
+  margin-bottom: ${(props) => props.size || "-13px"};
 `;
 
 const Command = styled.span`