1+ {% extends "base.html" %}
2+ {% load static %}
3+ {% load utils %}
4+
5+ {% block title %}Run Log{% endblock %}
6+
7+ {% block extrahead %}
8+ < style >
9+ pre {
10+ background-color : # 282a36 ;
11+ color : # f8f8f2 ;
12+ padding : 1rem ;
13+ border-radius : 4px ;
14+ overflow-x : auto;
15+ max-height : 500px ;
16+ }
17+
18+ .column {
19+ word-break : break-word;
20+ }
21+ </ style >
22+
23+ < style >
24+ pre {
25+ background-color : # 282a36 ;
26+ color : # f8f8f2 ;
27+ padding : 1.5rem 1rem 1rem 1rem ;
28+ border-radius : 4px ;
29+ overflow-x : auto;
30+ max-height : 500px ;
31+ position : relative;
32+ }
33+
34+ .copy-btn {
35+ position : absolute;
36+ top : 1.0rem ;
37+ right : 1.5rem ;
38+ z-index : 1 ;
39+ opacity : 0.5 ;
40+ transition : opacity 0.2s ease;
41+ }
42+ </ style >
43+
44+ {% endblock %}
45+
46+ {% block content %}
47+ < section class ="section ">
48+ < div class ="container ">
49+ < h1 class ="title "> {{ pipeline_name }} Run Log</ h1 >
50+ < hr >
51+
52+ < div class ="box p-4 ">
53+ < div class ="columns is-multiline is-vcentered is-mobile is-gapless ">
54+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
55+ < p class ="is-size-7 has-text-weight-semibold "> Pipeline ID</ p >
56+ < p class ="has-text-grey is-size-7 pr-3 "> {{ run.pipeline.pipeline_id }}</ p >
57+ </ div >
58+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
59+ < p class ="is-size-7 has-text-weight-semibold "> Status</ p >
60+ < p class ="has-text-grey is-size-7 ">
61+ {% if run.status == "running" %}
62+ < i class ="fa fa-spinner fa-spin has-text-info mr-1 "> </ i > Running
63+ {% elif run.status == "success" %}
64+ < i class ="fa fa-check-circle has-text-success mr-1 "> </ i > Success
65+ {% elif run.status == "failure" %}
66+ < i class ="fa fa-times-circle has-text-danger mr-1 "> </ i > Failure
67+ {% elif run.status == "scheduled" %}
68+ < i class ="fa fa-clock-o has-text-success mr-1 "> </ i > Scheduled
69+ {% else %}
70+ < i class ="fa fa-question-circle has-text-warning mr-1 "> </ i > Unknown
71+ {% endif %}
72+ </ p >
73+ </ div >
74+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
75+ < p class ="is-size-7 has-text-weight-semibold "> Execution Time</ p >
76+ < p class ="has-text-grey is-size-7 "> {{ run.execution_time }}</ p >
77+ </ div >
78+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
79+ < p class ="is-size-7 has-text-weight-semibold "> Exit Code</ p >
80+ < p class ="has-text-grey is-size-7 "> {{ run.run_exitcode }}</ p >
81+ </ div >
82+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
83+ < p class ="is-size-7 has-text-weight-semibold "> Start</ p >
84+ < p class ="has-text-grey is-size-7 "> {{ run.run_start_date }}</ p >
85+ </ div >
86+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
87+ < p class ="is-size-7 has-text-weight-semibold "> End</ p >
88+ < p class ="has-text-grey is-size-7 "> {{ run.run_end_date }}</ p >
89+ </ div >
90+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
91+ < p class ="is-size-7 has-text-weight-semibold "> Created</ p >
92+ < p class ="has-text-grey is-size-7 "> {{ run.created_date }}</ p >
93+ </ div >
94+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
95+ < p class ="is-size-7 has-text-weight-semibold "> Version</ p >
96+ < p class ="has-text-grey is-size-7 "> {{ run.vulnerablecode_version }}</ p >
97+ </ div >
98+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
99+ < p class ="is-size-7 has-text-weight-semibold "> Commit</ p >
100+ < p class ="has-text-grey is-size-7 ">
101+ {% if run.vulnerablecode_commit %}
102+ < a href ="https://github.com/aboutcode-org/vulnerablecode/tree/{{ run.vulnerablecode_commit }} "
103+ target ="_blank ">
104+ {{ run.vulnerablecode_commit }}
105+ < i class ="fa fa-external-link fa_link_custom "> </ i >
106+ </ a >
107+ {% endif %}
108+
109+ </ p >
110+ </ div >
111+ < div class ="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
112+ < p class ="is-size-7 has-text-weight-semibold "> Job ID</ p >
113+ < p class ="has-text-grey is-size-7 "> {{ run.run_id }}</ p >
114+ </ div >
115+ </ div >
116+ </ div >
117+
118+
119+ {% if run.run_output|strip %}
120+ < div class ="box ">
121+ < h2 class ="subtitle mb-2 "> Run Error</ h2 >
122+ < div class ="log-wrapper " style ="position: relative; ">
123+ < button class ="button is-medium is-light copy-btn " id ="copy-error "
124+ onclick ="copyCode('log-error', 'copy-error') ">
125+ < span class ="icon is-medium ">
126+ < i class ="fa fa-copy "> </ i >
127+ </ span >
128+ </ button >
129+ < pre > < code id ="log-error " class ="language-toml "> {{ run.run_output }}</ code > </ pre >
130+ </ div >
131+ </ div >
132+ {% endif %}
133+
134+ {% if run.log|strip %}
135+ < div class ="box ">
136+ < h2 class ="subtitle mb-2 "> Log Output</ h2 >
137+ < div class ="log-wrapper " style ="position: relative; ">
138+ < button class ="button is-medium is-light copy-btn " id ="copy-code "
139+ onclick ="copyCode('log-code', 'copy-code') ">
140+ < span class ="icon is-medium ">
141+ < i class ="fa fa-copy "> </ i >
142+ </ span >
143+ </ button >
144+ < pre > < code id ="log-code " class ="language-toml "> {{ run.log }}</ code > </ pre >
145+ </ div >
146+ </ div >
147+ {% endif %}
148+
149+
150+ < a href ="{% url 'runs-list' pipeline_id=run.pipeline.pipeline_id %} " class ="button is-link mt-4 "> ← Back to All
151+ Runs</ a >
152+ </ div >
153+ </ section >
154+ {% endblock %}
155+
156+
157+ {% block scripts %}
158+ < link rel ="stylesheet " href ="{% static 'css/highlight-10.6.0.css' %} " crossorigin ="anonymous ">
159+ < script src ="{% static 'js/highlight-10.6.0.min.js' %} " crossorigin ="anonymous "> </ script >
160+ < script > hljs . highlightAll ( ) ; </ script >
161+
162+ < script >
163+ function copyCode ( target , button ) {
164+ const code = document . getElementById ( target ) . innerText ;
165+ navigator . clipboard . writeText ( code )
166+ . then ( ( ) => {
167+ const btn = document . getElementById ( button ) ;
168+ btn . classList . add ( "is-success" ) ;
169+ btn . innerHTML = '<span class="icon is-small"><i class="fa fa-check"></i></span>' ;
170+ setTimeout ( ( ) => {
171+ btn . classList . remove ( "is-success" ) ;
172+ btn . innerHTML = '<span class="icon is-small"><i class="fa fa-copy"></i></span>' ;
173+ } , 1500 ) ;
174+ } )
175+ . catch ( err => alert ( "Copy failed: " + err ) ) ;
176+ }
177+ </ script >
178+ {% endblock %}
0 commit comments