conwnet / github1s

One second to read GitHub code with VS Code.
https://github1s.com
MIT License
22.84k stars 867 forks source link

提几个小建议(Make a few suggestions) #155

Open xiaofan9 opened 3 years ago

xiaofan9 commented 3 years ago
  1. 希望在线打开的代码能够切换分支;
  2. 希望能够直接在页面中能够搜索出对应的github项目,然后打开;
  3. 希望能够直接编辑这些代码(切换成其它文件时,修改的文件还能保持不变),还能够保存修改的文件(也能导出到本地),意外关闭浏览器还能够恢复相关代码,等等;
  4. 希望能够直接在线运行,在3的基础上,能够实时预览效果;
  5. 希望第一次进入github1s的时候,如果当前浏览器不存在OAuth Token,能够有提示/指引

English :

  1. Hope that the code opened online can switch branches;
  2. We hope to search the corresponding GitHub project in the page directly, and then open it;
  3. You want to be able to edit these codes directly (when you switch to other files, the modified files can remain unchanged), save the modified files (you can also export them to local), close the browser accidentally, and recover the relevant codes, etc;
  4. Hope to be able to run online directly and preview the effect in real time on the basis of 3;
  5. When entering github1s for the first time, if there is no OAuth token in the current browser, there will be prompt / guidance
conwnet commented 3 years ago

谢谢~!

  1. 希望在线打开的代码能够切换分支;

这个目前支持了,只是目前只能通过 Shift + Command + P 的方式,选择 GitHub1s: Switch to Another Branch/Tag 的形式切换,后面在支持 SCM 能力的时候会提供可视化按钮操作~

  1. 希望能够直接在页面中能够搜索出对应的github项目,然后打开;

有计划做这个,考虑后面做一个首页,提供 Trending Repos 列表、用户代码仓库列表及搜索仓库能力~

  1. 希望能够直接编辑这些代码(切换成其它文件时,修改的文件还能保持不变),还能够保存修改的文件(也能导出到本地),意外关闭浏览器还能够恢复相关代码,等等;

这个也可以做,优先级稍低些。导出代码能力现在也有,在文件树里面右键点想要导出文件夹,然后选择 Download... 即可

  1. 希望能够直接在线运行,在3的基础上,能够实时预览效果;

这个不容易,GitHub1s 目前是纯静态的应用,这个可能需要服务端支持

  1. 希望第一次进入github1s的时候,如果当前浏览器不存在OAuth Token,能够有提示/指引

现在打开 GitHub1s 如果直接报 Rate Limit Exceed 错误的话,会打开 Welcome 页面,上面描述着 OAuth Token 相关,后面会做的更清晰方便些~

xiaofan9 commented 3 years ago

蛮想参与开发的,但是不知道目前的计划,不知从何下手 @conwnet

conwnet commented 3 years ago

蛮想参与开发的,但是不知道目前的计划,不知从何下手 @conwnet

计划这个我今天整理一个文档大家一起 review 和补充吧

xiaofan9 commented 3 years ago
  1. 希望能够直接在线运行,在3的基础上,能够实时预览效果;

这个不容易,GitHub1s 目前是纯静态的应用,这个可能需要服务端支持

这个可以参考,CodeSandbox 这个就是完全运行在浏览器上面的

xcv58 commented 3 years ago

CodeSandbox does provide a way to import GitHub project and run it directly https://codesandbox.io/docs/importing#import-from-github

I suggest we integrate with CodeSandbox. Like add a button or command to open the githubbox link.

xiaofan9 commented 3 years ago

CodeSandbox确实提供了一种导入GitHub项目并直接运行它的方法https://codesandbox.io/docs/importing#import-from-github

我建议我们与CodeSandbox集成。像添加按钮或命令一样打开githubbox链接。

good idea

Sinosaurus commented 3 years ago

@conwnet

Rate Limit Exceed

访问同一个仓库,经常出现这个报错,时灵时不灵的

imageslr commented 3 years ago

@conwnet

Rate Limit Exceed

访问同一个仓库,经常出现这个报错,时灵时不灵的

配置 OAuth token 了吗?

wd2010 commented 1 year ago

蛮想参与开发的,但是不知道目前的计划,不知从何下手 @conwnet

计划这个我今天整理一个文档大家一起 review 和补充吧

大佬,我想在本地运行gitlab 平台,但代码里面的变量太多,没有设置对,一直处于github平台,请问可以怎么弄让我可以调试gitlab平台?或者说gitlab1s.com这个代码是运行哪个命令生成的?

conwnet commented 1 year ago

大佬,我想在本地运行gitlab 平台,但代码里面的变量太多,没有设置对,一直处于github平台,请问可以怎么弄让我可以调试gitlab平台?或者说gitlab1s.com这个代码是运行哪个命令生成的?

@wd2010 一个很简单方法就是,在 hosts 指定 127.0.0.1 gitlab1s.com

具体的判断逻辑在这里: https://github.com/conwnet/github1s/blob/a91c7f3fdcf7ee66afe9f6596da5c53c3d1180b8/resources/initialize.js#L54-L71

wd2010 commented 1 year ago

大佬,我想在本地运行gitlab 平台,但代码里面的变量太多,没有设置对,一直处于github平台,请问可以怎么弄让我可以调试gitlab平台?或者说gitlab1s.com这个代码是运行哪个命令生成的?

@wd2010 一个很简单方法就是,在 hosts 指定 127.0.0.1 gitlab1s.com

具体的判断逻辑在这里:

https://github.com/conwnet/github1s/blob/a91c7f3fdcf7ee66afe9f6596da5c53c3d1180b8/resources/initialize.js#L54-L71

非常感谢大佬,还有一个问题,本地跑gitlab1s时,如果gitlab的仓库是私有的,发现没有授权的地方,请问这一块代码可以怎么弄?最近公司内网的gitlab想接github1s,但我们的仓库都是私有的,麻烦大佬再指导一下,感激不尽

conwnet commented 1 year ago

@wd2010 目前 gitlab 平台用的是 SourceGraph API,没有用 GitLab 的官方 API,所以不支持私有仓库。

如果你需要自己适配的话,相关的逻辑在这里:

https://github.com/conwnet/github1s/blob/a91c7f3fdcf7ee66afe9f6596da5c53c3d1180b8/extensions/github1s/src/adapters/index.ts

更详细的信息,我后面专门写一个文档吧~