Skip to content

Commit

Permalink
[release-branch/v0.4] serve/advanced: Remove UI (#8) (#17)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to
`release-branch/v0.4`:
- [serve/advanced: Remove UI
(#8)](#8)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
  • Loading branch information
tylersmalley committed Jun 7, 2023
1 parent 783629a commit 0ad8c26
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 459 deletions.
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 @@ -94,13 +94,6 @@ interface SetFunnel {
};
}

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

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

Expand Down Expand Up @@ -150,22 +142,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

0 comments on commit 0ad8c26

Please sign in to comment.