mirror of https://github.com/coder/code-server.git
parent
80d50057fc
commit
14c96d78ef
|
@ -17,11 +17,7 @@ import { isStandalone } from 'vs/base/browser/browser';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
import product from 'vs/platform/product/common/product';
|
import product from 'vs/platform/product/common/product';
|
||||||
<<<<<<< HEAD
|
|
||||||
import { encodePath } from 'vs/server/node/util';
|
import { encodePath } from 'vs/server/node/util';
|
||||||
=======
|
|
||||||
import { parseLogLevel } from 'vs/platform/log/common/log';
|
|
||||||
>>>>>>> e4a830e9b7ca039c7c70697786d29f5b6679d775
|
|
||||||
|
|
||||||
function doCreateUri(path: string, queryValues: Map<string, string>): URI {
|
function doCreateUri(path: string, queryValues: Map<string, string>): URI {
|
||||||
let query: string | undefined = undefined;
|
let query: string | undefined = undefined;
|
||||||
|
@ -442,50 +438,7 @@ class WindowIndicator implements IWindowIndicator {
|
||||||
// Find workspace to open and payload
|
// Find workspace to open and payload
|
||||||
let foundWorkspace = false;
|
let foundWorkspace = false;
|
||||||
let workspace: IWorkspace;
|
let workspace: IWorkspace;
|
||||||
<<<<<<< HEAD
|
|
||||||
let payload = config.workspaceProvider?.payload || Object.create(null);
|
let payload = config.workspaceProvider?.payload || Object.create(null);
|
||||||
=======
|
|
||||||
let payload = Object.create(null);
|
|
||||||
let logLevel: string | undefined = undefined;
|
|
||||||
|
|
||||||
const query = new URL(document.location.href).searchParams;
|
|
||||||
query.forEach((value, key) => {
|
|
||||||
switch (key) {
|
|
||||||
|
|
||||||
// Folder
|
|
||||||
case WorkspaceProvider.QUERY_PARAM_FOLDER:
|
|
||||||
workspace = { folderUri: URI.parse(value) };
|
|
||||||
foundWorkspace = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Workspace
|
|
||||||
case WorkspaceProvider.QUERY_PARAM_WORKSPACE:
|
|
||||||
workspace = { workspaceUri: URI.parse(value) };
|
|
||||||
foundWorkspace = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Empty
|
|
||||||
case WorkspaceProvider.QUERY_PARAM_EMPTY_WINDOW:
|
|
||||||
workspace = undefined;
|
|
||||||
foundWorkspace = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Payload
|
|
||||||
case WorkspaceProvider.QUERY_PARAM_PAYLOAD:
|
|
||||||
try {
|
|
||||||
payload = JSON.parse(value);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error); // possible invalid JSON
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Log level
|
|
||||||
case 'logLevel':
|
|
||||||
logLevel = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
>>>>>>> e4a830e9b7ca039c7c70697786d29f5b6679d775
|
|
||||||
|
|
||||||
// If no workspace is provided through the URL, check for config attribute from server
|
// If no workspace is provided through the URL, check for config attribute from server
|
||||||
if (!foundWorkspace) {
|
if (!foundWorkspace) {
|
||||||
|
@ -543,7 +496,6 @@ class WindowIndicator implements IWindowIndicator {
|
||||||
// Finally create workbench
|
// Finally create workbench
|
||||||
create(document.body, {
|
create(document.body, {
|
||||||
...config,
|
...config,
|
||||||
logLevel: logLevel ? parseLogLevel(logLevel) : undefined,
|
|
||||||
settingsSyncOptions,
|
settingsSyncOptions,
|
||||||
windowIndicator,
|
windowIndicator,
|
||||||
productQualityChangeHandler,
|
productQualityChangeHandler,
|
||||||
|
|
Loading…
Reference in New Issue