Skip to content

Commit

Permalink
Merge pull request #48 from baurine/refine
Browse files Browse the repository at this point in the history
slight refinements
  • Loading branch information
baurine authored Apr 5, 2021
2 parents 0d34115 + bff4a12 commit 4cd2e09
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 182 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to the "ticode" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [Unreleased]
### 0.3.1

- Initial release
- Some slight refinements

### 0.3.0

- Support manage virtual machines by vagrant
- Support deploy a cluster

### 0.2.3

- Auto install TiUP if it doesn't install - [#28](https://github.com/dragonly/ticode/pull/28)
- Fix view log in Linux - [#30](https://github.com/dragonly/ticode/pull/30)

### 0.0.1

Initial release
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,3 @@ Video: https://www.bilibili.com/video/BV12A411H74T/

- [x] Install TiUP
- [ ] Upgrade TiUP

## Release Notes

### 0.2.3

- Auto install TiUP if it doesn't install - [#28](https://github.com/dragonly/ticode/pull/28)
- Fix view log in Linux - [#30](https://github.com/dragonly/ticode/pull/30)

### 0.0.1

Initial release
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"description": "make developing TiDB a breeze",
"icon": "media/logo.png",
"version": "0.3.0",
"version": "0.3.1",
"engines": {
"vscode": "^1.52.0"
},
Expand Down Expand Up @@ -82,10 +82,6 @@
"dark": "media/refresh.svg"
}
},
{
"command": "ticode.cluster.list",
"title": "List clusters"
},
{
"command": "ticode.cluster.display",
"title": "Display cluster"
Expand Down Expand Up @@ -204,7 +200,7 @@
},
{
"command": "ticode.topo.diffModification",
"title": "Diff Modificatioin"
"title": "Diff Modification"
},
{
"command": "ticode.topo.vagrantUp",
Expand Down Expand Up @@ -272,6 +268,12 @@
}
]
},
"viewsWelcome": [
{
"view": "ticode-tiup-cluster",
"contents": "No cluster deployed, use \"VM & Topo Manager\" to deploy a cluster"
}
],
"menus": {
"explorer/context": [
{
Expand Down Expand Up @@ -332,10 +334,6 @@
"when": "view == ticode-tiup-playground && viewItem == playground-cluster",
"group": "0@1"
},
{
"command": "ticode.cluster.list",
"when": "view == ticode-tiup-cluster && viewItem == clusters"
},
{
"command": "ticode.cluster.display",
"when": "view == ticode-tiup-cluster && viewItem == cluster-name",
Expand Down
60 changes: 0 additions & 60 deletions scaffold-template/pd/pd.patch

This file was deleted.

42 changes: 0 additions & 42 deletions scaffold-template/tidb/tidb.patch

This file was deleted.

39 changes: 0 additions & 39 deletions scaffold-template/tikv/tikv.patch

This file was deleted.

11 changes: 1 addition & 10 deletions src/cluster/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ export class ClusterProvider implements vscode.TreeDataProvider<Item> {
async getChildren(element?: Item): Promise<Item[]> {
const items: Item[] = []
if (element === undefined) {
const item = new Item(
'clusters',
vscode.TreeItemCollapsibleState.Expanded
)
item.contextValue = 'clusters'
items.push(item)
return Promise.resolve(items)
}

if (element.contextValue === 'clusters') {
const clusters = await ClusterCommand.listClusters()
clusters.forEach((cluster) => {
const item = new Item(
Expand All @@ -52,6 +42,7 @@ export class ClusterProvider implements vscode.TreeDataProvider<Item> {
item.contextValue = 'cluster-name'
items.push(item)
})
return Promise.resolve(items)
}
if (element.contextValue === 'cluster-name') {
const cluster = element.extra as Cluster
Expand Down
8 changes: 0 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ export async function activate(context: vscode.ExtensionContext) {
// navigation action
registerCommand('ticode.cluster.refresh', () => clusterProvider.refresh()),
// context menu
registerCommand('ticode.cluster.list', listClusters),
// context menu
registerCommand('ticode.cluster.display', (treeItem) =>
displayClusters(treeItem.label)
),
Expand Down Expand Up @@ -384,12 +382,6 @@ async function stopPlayground() {
}

// TiUP Cluster
async function listClusters() {
const uri = vscode.Uri.parse('ticode:list')
const doc = await vscode.workspace.openTextDocument(uri) // calls back into the provider
await vscode.window.showTextDocument(doc, { preview: false })
}

async function displayClusters(clusterName?: string) {
if (clusterName === undefined) {
vscode.window.showErrorMessage('cluster name is unknown')
Expand Down

0 comments on commit 4cd2e09

Please sign in to comment.