File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,12 +100,7 @@ def _make_ci_html(
100100 return ""
101101 slug = project_url [len ("https://github.com/" ) :]
102102 wf = _ensure_yaml_ext (workflow if isinstance (workflow , str ) else default_workflow )
103- return (
104- f'<td class="ci" data-slug="{ slug } ">'
105- f'<a href="https://github.com/{ slug } /actions">'
106- f'<img src="https://github.com/{ slug } /actions/workflows/{ wf } /badge.svg">'
107- f"</a></td>"
108- )
103+ return f'<td class="ci" data-slug="{ slug } " data-wf="{ wf } "></td>'
109104
110105
111106def _scm_project_url (ctx , group_id : str , artifact_id : str , version : str ) -> str :
Original file line number Diff line number Diff line change @@ -69,18 +69,23 @@ td.smelt.has-log:hover { filter: brightness(1.3); }
6969(function (){
7070 fetch (' badges.json' ).then (function (r ){return r .json ();}).then (function (d ){
7171 var repos= d .repos || {};
72- document .querySelectorAll (' td.ci[data-slug]' ).forEach (function (td ){
73- var entry= repos[td .dataset .slug ];
74- if (! entry)return ;
75- var title= typeof entry=== ' string' ? entry: entry .title ;
76- var workflow= typeof entry=== ' string' ? null : entry .workflow ;
77- if (! title)return ;
78- td .setAttribute (' sorttable_customkey' ,
72+ var tds= Array .from (document .querySelectorAll (' td.ci[data-slug]' ));
73+ tds .forEach (function (td ,i ){
74+ var slug= td .dataset .slug ;
75+ var entry= repos[slug];
76+ var title= entry? (typeof entry=== ' string' ? entry: entry .title ): null ;
77+ var wf= entry? (typeof entry=== ' string' ? null : entry .workflow ): null ;
78+ if (! wf)wf= td .dataset .wf ;
79+ if (title)td .setAttribute (' sorttable_customkey' ,
7980 title .indexOf (' passing' )>= 0 ? ' 1' : title .indexOf (' failing' )>= 0 ? ' 2' : ' 3' );
80- if (workflow){
81- var img= td .querySelector (' img' );
82- if (img)img .src = ' https://github.com/' + td .dataset .slug + ' /actions/workflows/' + workflow+ ' /badge.svg' ;
83- }
81+ setTimeout (function (){
82+ var a= document .createElement (' a' );
83+ a .href = ' https://github.com/' + slug+ ' /actions' ;
84+ var img= document .createElement (' img' );
85+ img .src = ' https://github.com/' + slug+ ' /actions/workflows/' + wf+ ' /badge.svg' ;
86+ a .appendChild (img);
87+ td .appendChild (a);
88+ },i* 40 );
8489 });
8590 }).catch (function (){});
8691})();
You can’t perform that action at this time.
0 commit comments