Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
cc18175c
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
cc18175c
编写于
11月 25, 2020
作者:
A
Anmol Sethi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cli: Add --disable-update-check flag
Closes #2361
上级
27f0f195
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
7 deletion
+18
-7
ci/dev/vscode.patch
ci/dev/vscode.patch
+10
-7
src/node/cli.ts
src/node/cli.ts
+7
-0
src/node/routes/vscode.ts
src/node/routes/vscode.ts
+1
-0
未找到文件。
ci/dev/vscode.patch
浏览文件 @
cc18175c
...
...
@@ -813,7 +813,7 @@ new file mode 100644
index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152ed407146
--- /dev/null
+++ b/src/vs/server/browser/client.ts
@@ -0,0 +1,2
39
@@
@@ -0,0 +1,2
41
@@
+import { Emitter } from 'vs/base/common/event';
+import { URI } from 'vs/base/common/uri';
+import { localize } from 'vs/nls';
...
...
@@ -967,7 +967,7 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
+
+ const logService = (services.get(ILogService) as ILogService);
+ const storageService = (services.get(IStorageService) as IStorageService);
+ const updateCheckEndpoint = path.join(options.base, "/update/check")
+ const updateCheckEndpoint = path.join(options.base, "/update/check")
;
+ const getUpdate = async (): Promise<void> => {
+ logService.debug('Checking for update...');
+
...
...
@@ -987,8 +987,8 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
+
+ const lastNoti = storageService.getNumber('csLastUpdateNotification', StorageScope.GLOBAL);
+ if (lastNoti) {
+ // Only remind them again after
two days
.
+ const timeout = 1000*60*24*
2
;
+ // Only remind them again after
1 week
.
+ const timeout = 1000*60*24*
7
;
+ const threshold = lastNoti + timeout;
+ if (Date.now() < threshold) {
+ return;
...
...
@@ -1011,7 +1011,9 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
+ });
+ };
+
+ updateLoop();
+ if (!options.disableUpdateCheck) {
+ updateLoop();
+ }
+
+ // This will be used to set the background color while VS Code loads.
+ const theme = storageService.get('colorThemeData', StorageScope.GLOBAL);
...
...
@@ -1448,14 +1450,15 @@ new file mode 100644
index 0000000000000000000000000000000000000000..0a4a91e5e36bda7f888feedda348aaff5fe32d27
--- /dev/null
+++ b/src/vs/server/ipc.d.ts
@@ -0,0 +1,13
2
@@
@@ -0,0 +1,13
3
@@
+/**
+ * External interfaces for integration into code-server over IPC. No vs imports
+ * should be made in this file.
+ */
+export interface Options {
+ disableTelemetry: boolean
+ base: string
+ disableTelemetry: boolean
+ disableUpdateCheck: boolean
+}
+
+export interface InitMessage {
...
...
src/node/cli.ts
浏览文件 @
cc18175c
...
...
@@ -33,6 +33,7 @@ export interface Args extends VsArgs {
"
cert-host
"
?:
string
"
cert-key
"
?:
string
"
disable-telemetry
"
?:
boolean
"
disable-update-check
"
?:
boolean
help
?:
boolean
host
?:
string
json
?:
boolean
...
...
@@ -114,6 +115,12 @@ const options: Options<Required<Args>> = {
},
"
cert-key
"
:
{
type
:
"
string
"
,
path
:
true
,
description
:
"
Path to certificate key when using non-generated cert.
"
},
"
disable-telemetry
"
:
{
type
:
"
boolean
"
,
description
:
"
Disable telemetry.
"
},
"
disable-update-check
"
:
{
type
:
"
boolean
"
,
description
:
"
Disable update check. Without this flag, code-server checks every 6 hours against the latest github release and
\n
"
+
"
then notifies you once every week that a new release is available.
"
,
},
help
:
{
type
:
"
boolean
"
,
short
:
"
h
"
,
description
:
"
Show this output.
"
},
json
:
{
type
:
"
boolean
"
},
open
:
{
type
:
"
boolean
"
,
description
:
"
Open in browser on startup. Does not work remotely.
"
},
...
...
src/node/routes/vscode.ts
浏览文件 @
cc18175c
...
...
@@ -42,6 +42,7 @@ router.get("/", async (req, res) => {
commit
!==
"
development
"
?
content
.
replace
(
/<!-- PROD_ONLY/g
,
""
).
replace
(
/END_PROD_ONLY -->/g
,
""
)
:
content
,
{
disableTelemetry
:
!!
req
.
args
[
"
disable-telemetry
"
],
disableUpdateCheck
:
!!
req
.
args
[
"
disable-update-check
"
],
},
)
.
replace
(
`"{{REMOTE_USER_DATA_URI}}"`
,
`'
${
JSON
.
stringify
(
options
.
remoteUserDataUri
)}
'`
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录