Explorar el Código

add docs links to event incidents

Alexander Belanger hace 3 años
padre
commit
5741faf2c9

+ 2 - 0
api/types/incident.go

@@ -42,6 +42,8 @@ type IncidentMeta struct {
 	InvolvedObjectName      string             `json:"involved_object_name" form:"required"`
 	InvolvedObjectNamespace string             `json:"involved_object_namespace" form:"required"`
 	ShouldViewLogs          bool               `json:"should_view_logs"`
+	Revision                string             `json:"revision"`
+	PorterDocLink           string             `json:"porter_doc_link"`
 }
 
 type PaginationRequest struct {

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

@@ -266,6 +266,12 @@ const EventList: React.FC<Props> = ({ filters, setLogData }) => {
               <Capitalize>{expandedEvent.severity}</Capitalize>
             </InfoTab>
           </InfoRow>
+          {expandedEvent?.porter_doc_link && (
+            <DocsLink target="_blank" href={expandedEvent?.porter_doc_link}>
+              View troubleshooting steps{" "}
+              <i className="material-icons">open_in_new</i>{" "}
+            </DocsLink>
+          )}
           {renderExpandedEventMessage()}
         </Modal>
       )}
@@ -339,7 +345,7 @@ const InfoRow = styled.div`
   display: flex;
   align-items: center;
   justify-content: flex-start;
-  margin-bottom: 25px;
+  margin-bottom: 12px;
 `;
 
 const Text = styled.div`
@@ -485,3 +491,17 @@ const FlexRow = styled.div`
   flex-wrap: wrap;
   margin-top: 20px;
 `;
+
+const DocsLink = styled.a`
+  display: inline-block;
+  color: #8590ff;
+  border-bottom: 1px solid #8590ff;
+  cursor: pointer;
+  user-select: none;
+  padding: 3px 0;
+  margin-bottom: 18px;
+
+  > i {
+    font-size: 12px;
+  }
+`;