diff --git a/internal/controller/auth/github.go b/internal/controller/auth/github.go index 72e7ffddbc14079ae905aca5c21d02a59108ea38..fb07fd80e93d3671d74271ffcad686580e926ba4 100644 --- a/internal/controller/auth/github.go +++ b/internal/controller/auth/github.go @@ -146,3 +146,8 @@ func getLoginDevice(ctx *gin.Context) { ctx.Header("Content-Type", "text/html; charset=utf-8") ctx.HTML(http.StatusOK, "code.html", gin.H{}) } + +func getHelpPage(ctx *gin.Context) { + ctx.Header("Content-Type", "text/html; charset=utf-8") + ctx.HTML(http.StatusOK, "help.html", gin.H{}) +} diff --git a/internal/controller/auth/router_register.go b/internal/controller/auth/router_register.go index a29f66a52f9d83ef1fb10165da4f896aa3436c0e..63683a4b0eb197cc8dd235c5f86477de6fe19326 100644 --- a/internal/controller/auth/router_register.go +++ b/internal/controller/auth/router_register.go @@ -7,6 +7,7 @@ import ( ) func GinApi(g *gin.RouterGroup) { + g.GET("/help", getHelpPage) // 启动设备代码登录流程 g.POST("/login/device/code", postLoginDeviceCode) g.POST("/login/device", postLoginDevice) diff --git a/static/public/code.html b/static/public/code.html index 494cab8147739e591fabf968d8fc7d0d732676a6..2ded040307149d63952f648a5c832725c80ddb23 100644 --- a/static/public/code.html +++ b/static/public/code.html @@ -3,193 +3,224 @@ - 登录 Github Copilot 插件 + 登录 Github Copilot -
-

登录 Github Copilot 插件

-
- - - - -
- - - + diff --git a/static/public/help.html b/static/public/help.html new file mode 100644 index 0000000000000000000000000000000000000000..2663cbc337b27f95f0b7ceecaa893cc8b4f7274b --- /dev/null +++ b/static/public/help.html @@ -0,0 +1,251 @@ + + + + + + Copilot 配置指南 + + + +

Copilot 配置指南

+ +

VSCode

+
安装插件: GitHub Copilot
+
修改 VSCode 的 settings.json 文件, 添加以下配置:
+
+
{
+    "github.copilot.advanced": {
+        "authProvider": "github-enterprise",
+        "debug.overrideCAPIUrl": "https://api.loading...",
+        "debug.overrideProxyUrl": "https://copilot-proxy.loading...",
+        "debug.chatOverrideProxyUrl": "https://api.loading.../chat/completions",
+        "debug.overrideFastRewriteEngine": "v1/engines/copilot-centralus-h100",
+        "debug.overrideFastRewriteUrl": "https://api.loading..."
+    },
+    "github-enterprise.uri": "https://loading..."
+}
+ +
+
+ 这里默认使用的是https的服务地址,如果您没设置好https,可以改成http +
+

Jetbrains IDE系列

+
找到设置 > 语言与框架 > GitHub Copilot > Authentication + Provider
+
填写的值为: loading...
+
首次打开 IDE 应该会提示是否信任证书的弹窗, 点击同意即可, 如果已经配置了系统级别的信任证书可以忽略. +
+ +

Visual Studio 2022

+
更新到最新版本(内置 Copilot 版本)至少是 17.10.x 以上
+
首先开启 Github Enterprise 账户支持:工具-环境-账户-勾选"包含 Github Enterprise 服务器账户"
+
然后点击添加 Github 账户,切换到 Github Enterprise 选项卡,输入 https://loading... 即可。 +
+ +
+ 如果是默认自签证书的域名, 那么本次操作之前务必操作下 信任根证书 然后重启浏览器和IDE, 具体方法网上搜索下
+
+ +
+ Chat服务在代码选中后右键选择解释代码会报错, 解决方法是点击一下"在聊天窗口中继续"即可. +
+ + + + \ No newline at end of file diff --git a/static/public/login.html b/static/public/login.html index 046b4d9a77d0d39b5ced77fa60d9a588e719433c..e5db7696e74e4f4879525001448265f785de41e1 100644 --- a/static/public/login.html +++ b/static/public/login.html @@ -5,230 +5,256 @@ 获取 GitHub GHU -
-

获取 GitHub GHU

-
-
-
-
+ - -
- - + await getGhuToken() + } + + +