Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serve/advanced: Remove UI #8

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,6 @@
{
"command": "tailscale.openAdminConsole",
"group": "overflow"
},
{
"command": "tailscale.advancedServeView",
"group": "overflow",
"when": "tailscale.viewType == 'simple' && tailscale.env == 'development'"
},
{
"command": "tailscale.simpleServeView",
"group": "overflow",
"when": "tailscale.viewType == 'advanced'"
}
]
},
Expand Down Expand Up @@ -164,11 +154,6 @@
"category": "tsdev",
"title": "Reload Serve Panel"
},
{
"command": "tailscale.advancedServeView",
"title": "Advanced View",
"category": "tsdev"
},
{
"command": "tailscale.simpleServeView",
"title": "Simple View",
Expand Down
14 changes: 0 additions & 14 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ export async function activate(context: vscode.ExtensionContext) {
})
);

context.subscriptions.push(
vscode.commands.registerCommand('tailscale.advancedServeView', () => {
Logger.info('called tailscale.advancedServeView', 'command');
servePanelProvider.showAdvancedView();
})
);

context.subscriptions.push(
vscode.commands.registerCommand('tailscale.simpleServeView', () => {
Logger.info('called tailscale.simpleServeView', 'command');
servePanelProvider.showSimpleView();
})
);

context.subscriptions.push(
vscode.commands.registerCommand('tailscale.openFunnelPanel', () => {
vscode.commands.executeCommand('tailscale-serve-view.focus');
Expand Down
18 changes: 0 additions & 18 deletions src/serve-panel-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ export class ServePanelProvider implements vscode.WebviewViewProvider {
});
}

public async showAdvancedView() {
this.postMessage({
type: 'showAdvancedView',
});
}

public async showSimpleView() {
this.postMessage({
type: 'showSimpleView',
});
}

resolveWebviewView(webviewView: vscode.WebviewView) {
this._view = webviewView;
webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
Expand Down Expand Up @@ -72,12 +60,6 @@ export class ServePanelProvider implements vscode.WebviewViewProvider {
break;
}

case 'setViewType': {
Logger.info('Called setViewType', 'serve-panel');
vscode.commands.executeCommand('setContext', 'tailscale.viewType', m.params.type);
break;
}

case 'setFunnel': {
Logger.info('Called setFunnel', 'serve-panel');
try {
Expand Down
25 changes: 1 addition & 24 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ interface SetFunnel {
};
}

interface SetViewType {
type: 'setViewType';
params: {
type: 'simple' | 'advanced';
};
}

interface WriteToClipboard {
type: 'writeToClipboard';
params: {
Expand All @@ -124,7 +117,6 @@ export type Message =
| AddServe
| ResetServe
| SetFunnel
| SetViewType
| WriteToClipboard
| OpenLink;

Expand Down Expand Up @@ -153,22 +145,7 @@ interface WebpackStillOk {
type: 'webpackStillOk';
}

interface ShowAdvancedView {
type: 'showAdvancedView';
}

interface ShowSimpleView {
type: 'showSimpleView';
}

export type WebviewData =
| UpdateState
| RefreshState
| ShowAdvancedView
| ShowSimpleView
| WebpackOk
| WebpackInvalid
| WebpackStillOk;
export type WebviewData = UpdateState | RefreshState | WebpackOk | WebpackInvalid | WebpackStillOk;
export type WebviewEvent = Event & { data: WebviewData };

export interface NewPortNotification {
Expand Down
Loading