Skip to content

Commit 6da7140

Browse files
committed
Clean up icons.
1 parent ccb599b commit 6da7140

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/vs/server/services/environmentService.ts

+10-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { getLogLevel } from 'vs/platform/log/common/log';
1818
import { IProductService } from 'vs/platform/product/common/productService';
1919
import { toWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
2020
import { IWebWorkspace, IWorkbenchConfigurationSerialized } from 'vs/platform/workspaces/common/workbench';
21-
import { AssetPaths, SERVICE_WORKER_FILE_NAME } from 'vs/server/services/net/common/http';
21+
import { AssetPaths, ICON_SIZES, SERVICE_WORKER_FILE_NAME } from 'vs/server/services/net/common/http';
2222
import { getCachedNlsConfiguration, getLocaleFromConfig } from 'vs/workbench/services/extensions/node/nls';
2323
import { RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService';
2424
import { ParsedRequest } from './net/abstractIncomingRequestService';
@@ -88,6 +88,7 @@ export class EnvironmentServerService extends NativeEnvironmentService implement
8888
const productConfiguration: Writeable<IProductConfiguration> = {
8989
...productService,
9090

91+
// Service Worker
9192
serviceWorker: {
9293
scope: req.pathPrefix,
9394
url: this.createRequestUrl(req, SERVICE_WORKER_FILE_NAME).toString(),
@@ -97,22 +98,17 @@ export class EnvironmentServerService extends NativeEnvironmentService implement
9798
logoutEndpointUrl: logoutEndpointUrl.toString(),
9899
webEndpointUrl: this.createRequestUrl(req, AssetPaths.StaticBase).toString(),
99100
webEndpointUrlTemplate: this.createRequestUrl(req, AssetPaths.StaticBase).toString(),
100-
icons: [
101-
{
102-
src: this.createRequestUrl(req, '/static/resources/web/pwa-icon-192.png').toString(),
103-
type: 'image/png',
104-
sizes: '192x192',
105-
},
106-
{
107-
src: this.createRequestUrl(req, '/static/resources/web/pwa-icon-512.png').toString(),
108-
type: 'image/png',
109-
sizes: '512x512',
110-
},
111-
],
112101

113102
// Proxy
114103
/** The URL constructor should be decoded here to retain the port template variable. */
115104
proxyEndpointUrlTemplate: decodeURI(this.createRequestUrl(req, AssetPaths.ProxyUri).toString()),
105+
106+
// Metadata
107+
icons: ICON_SIZES.map((size => ({
108+
src: this.createRequestUrl(req, `/static/resources/web/pwa-icon-${size}.png`).toString(),
109+
type: 'image/png',
110+
sizes: `${size}x${size}`,
111+
})))
116112
};
117113

118114
if (!this.configuration.disableUpdateCheck) {
@@ -284,3 +280,4 @@ export class EnvironmentServerService extends NativeEnvironmentService implement
284280
];
285281
}
286282
}
283+

src/vs/server/services/net/common/http.ts

+2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ export interface ClientTheme {
144144
foregroundColor: string;
145145
}
146146

147+
export const ICON_SIZES = [192, 512];
148+
147149
/**
148150
* Returns the relative path prefix for a given URL path.
149151
* @remark This is especially useful when creating URLs which have to remain

0 commit comments

Comments
 (0)