@@ -30,7 +30,7 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
3030    this . currentPanel  =  webviewPanel ; 
3131    webviewPanel . webview . options  =  { 
3232      enableScripts : true , 
33-       localResourceRoots : [ vscode . Uri . joinPath ( this . context . extensionUri ,  'out' ) ] 
33+       localResourceRoots : [ vscode . Uri . joinPath ( this . context . extensionUri ,  'out' ) ,   vscode . Uri . joinPath ( this . context . extensionUri ,   'media' ) ] 
3434    } ; 
3535    webviewPanel . webview . html  =  this . _getWebviewContent ( webviewPanel . webview ) ; 
3636    webviewPanel . onDidChangeViewState ( e  =>  { 
@@ -127,6 +127,8 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
127127  private  _getWebviewContent ( webview : vscode . Webview )  { 
128128    const  webviewUri  =  webview . asWebviewUri ( vscode . Uri . joinPath ( this . context . extensionUri ,  'out' ,  'webview.js' ) ) ; 
129129    const  nonce  =  getNonce ( ) ; 
130+     const  codiconsUri  =  webview . asWebviewUri ( vscode . Uri . joinPath ( this . context . extensionUri ,  'media' ,  'codicon.css' ) ) ; 
131+     const  codiconsFont  =  webview . asWebviewUri ( vscode . Uri . joinPath ( this . context . extensionUri ,  'media' ,  'codicon.ttf' ) ) ; 
130132
131133    return  /*html*/  ` 
132134              <!DOCTYPE html> 
@@ -136,12 +138,16 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
136138                  <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
137139                  <meta 
138140                    http-equiv="Content-Security-Policy" 
139-                     content="default-src 'none'; img-src ${ webview . cspSource }   https:; script-src ${ webview . cspSource }  ; style-src ${ webview . cspSource } ; script -src 'nonce- ${ nonce } ' ;" 
141+                     content="default-src 'none'; img-src ${ webview . cspSource }   https:; script-src 'nonce- ${ nonce } '; style-src  ${ webview . cspSource }  'nonce- ${ nonce } ' ; style-src-elem  ${ webview . cspSource }  'unsafe-inline'; font -src ${ webview . cspSource }  ;" 
140142                  /> 
143+                   <link href="${ codiconsUri }  " rel="stylesheet" nonce="${ nonce }  "> 
141144                </head> 
142145                <body> 
143146                  <vscode-data-grid id="resource-table" aria-label="Basic" generate-header="sticky" aria-label="Sticky Header"></vscode-data-grid> 
144-                   <vscode-button id="add-resource-button" style="position:fixed;bottom:0;left:0">Add New Resource</vscode-button> 
147+                   <vscode-button id="add-resource-button"> 
148+                     Add New Resource 
149+                     <span slot="start" class="codicon codicon-add"></span> 
150+                   </vscode-button> 
145151                  <script type="module" nonce="${ nonce }  " src="${ webviewUri }  "></script> 
146152                </body> 
147153              </html> 
0 commit comments