feat: add more docker api
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@dayu/vscode",
 | 
			
		||||
    "displayName": "vscode",
 | 
			
		||||
    "description": "",
 | 
			
		||||
    "description": "Dayu VsCode Plugin",
 | 
			
		||||
    "publisher": "MiaoWoo",
 | 
			
		||||
    "version": "0.0.1",
 | 
			
		||||
    "engines": {
 | 
			
		||||
@@ -56,6 +56,7 @@
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    "scripts": {
 | 
			
		||||
        "package": "vsce package",
 | 
			
		||||
        "vscode:prepublish": "yarn run compile",
 | 
			
		||||
        "compile": "tsc -p ./",
 | 
			
		||||
        "watch": "tsc -watch -p ./",
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@ import { OpenFaasProvider, DockerProvider } from './provider'
 | 
			
		||||
// this method is called when your extension is activated
 | 
			
		||||
// your extension is activated the very first time the command is executed
 | 
			
		||||
export function activate(context: vscode.ExtensionContext) {
 | 
			
		||||
    console.log('init...')
 | 
			
		||||
    new DockerProvider(context);
 | 
			
		||||
    new OpenFaasProvider(context);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ export class DockerProvider extends BaseProvider<vscode.TreeItem> {
 | 
			
		||||
        context.subscriptions.push(
 | 
			
		||||
            vscode.commands.registerCommand('dayu.container.logs', (item: vscode.TreeItem) => {
 | 
			
		||||
                let value: ItemContextValue = JSON.parse(item.contextValue);
 | 
			
		||||
                let url = `https://faas.n.yumc.pw?action=container&data=${value.data.id}`;
 | 
			
		||||
                let url = `https://dayu-api.miaowoo.cc?action=container&data=${value.data.id}`;
 | 
			
		||||
                return vscode.commands.executeCommand("mini-browser.openUrl", url);
 | 
			
		||||
            }),
 | 
			
		||||
            vscode.window.registerTreeDataProvider('docker-explorer', this)
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ export class OpenFaasProvider extends BaseProvider<vscode.TreeItem> {
 | 
			
		||||
        switch (value.type) {
 | 
			
		||||
            case Type.ROOT:
 | 
			
		||||
                let funcs = await faas.getFunctions();
 | 
			
		||||
                return funcs.map(f => {
 | 
			
		||||
                return funcs.map((f: any) => {
 | 
			
		||||
                    return this.createTreeItem({
 | 
			
		||||
                        label: f.name,
 | 
			
		||||
                        tooltip: JSON.stringify(f, undefined, 2)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user