11package io .snyk .eclipse .plugin .html ;
22
3+ import java .io .IOException ;
4+ import java .io .InputStream ;
5+ import java .nio .charset .StandardCharsets ;
6+
37import org .eclipse .core .runtime .Platform ;
48import org .osgi .framework .Bundle ;
59
@@ -149,30 +153,18 @@ public String getInitHtml() {
149153 return replaceCssVariables (html );
150154 }
151155
152- // TODO update this when we got new design from Andy
153156 public String getSummaryInitHtml () {
154-
155- var html = """
156- <!DOCTYPE html>
157- <html lang="en">
158- <body>
159- <div class="container">
160- <h3 class="summary-header">SUMMARY</h3>
161- <div class="snx-header">
162- <div class="summary-row">
163- <span class="icon">⚠️</span>
164- <span class="text">312 issues found in your project</span>
165- </div>
166- <div class="summary-row">
167- <span class="icon">⚡</span>
168- <span class="text">183 issues are fixable</span>
169- </div>
170-
171- </div>
172- </body>
173- </html>
174- """ .formatted (head );
175- return replaceCssVariables (html );
157+ String htmlContent = "" ;
158+ try {
159+ InputStream inputStream = getClass ().getResourceAsStream ("/ui/html/ScanSummaryInit.html" );
160+ if (inputStream != null ) {
161+ htmlContent = new String (inputStream .readAllBytes (), StandardCharsets .UTF_8 );
162+ inputStream .close ();
163+ }
164+ } catch (IOException e ) {
165+ e .printStackTrace ();
166+ }
167+ return replaceCssVariables (htmlContent );
176168 }
177169
178170 public String ideScript () {
@@ -195,6 +187,6 @@ public String ideScript() {
195187 }
196188
197189 public String getFormattedSummaryHtml (String summary ) {
198- return replaceCssVariables (summary , ideScript ());
190+ return replaceCssVariablesAndScript (summary , ideScript ());
199191 }
200192}
0 commit comments