Giter Site home page Giter Site logo

Comments (3)

capitalwell avatar capitalwell commented on June 17, 2024

遇到同样的问题,顶一下

from auto.js-vscode-extension.

Lateryzh avatar Lateryzh commented on June 17, 2024

表示地址也连不上。。。。

from auto.js-vscode-extension.

UGYnpU2nuB8QCFqDrsWZgmxMBp43WQ avatar UGYnpU2nuB8QCFqDrsWZgmxMBp43WQ commented on June 17, 2024

需要修改文件 -----.vscode\extensions\aaroncheng.auto-js-vsce-fixed-1.109.0\out\extension.js
类Extension(98行-135行)中的内容

class Extension {
    constructor() {
        this.documentViewPanel = undefined;
        this.qrCodeViewPanel = undefined;
        this.documentCache = new Map();
    }

    showServerAddress() {
        let servers = server.getIPs().join(":" + server.getPort() + " or ") + ":" + server.getPort();
        vscode.window.showInformationMessage(`Auto.js Autox.js \r\n server running on ${servers}`);
    }

    showQrCode() {
        let ips = server.getIPs();
        if (ips.length == 1) {
            this.showQrcodeWebview(ips[0]);
        } else {
            vscode.window.showQuickPick(ips).then(ip => {
                this.showQrcodeWebview(ip);
            });
        }
    }

    showQrcodeWebview(ip) {
        let url = `ws://${ip}:${server.getPort()}`;
        if (!this.qrCodeViewPanel) {
            this.qrCodeViewPanel = vscode.window.createWebviewPanel('Qr code', "Qr code", vscode.ViewColumn.Beside, {
                enableScripts: true,
            });

            this.qrCodeViewPanel.onDidDispose(() => {
                this.qrCodeViewPanel = undefined;
            }, undefined, exports._context.subscriptions);
        }
        this.qrCodeViewPanel.webview.html = this.getQrCodeHtml(this.qrCodeViewPanel.webview, url);
    }

    getQrCodeHtml(webview, text) {
        const icon = this.getVscodeResourceUrl(webview, "logo.png");
        const qrcodejs = this.getVscodeResourceUrl(webview, "assets/qrcode.js");
        return `<!DOCTYPE html>
    getVscodeResourceUrl(webview, relativePath) {
        const onDiskPath = vscode.Uri.file(path.join(exports._context.extensionPath, relativePath));
        return webview.asWebviewUri(onDiskPath);
    }

from auto.js-vscode-extension.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.