Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9078076

Browse files
authored
Upgrade Coder site package (#676)
Also fix an issue with the new types by removing an unused variable.
1 parent41184c2 commit9078076

File tree

2 files changed

+16
-41
lines changed

2 files changed

+16
-41
lines changed

‎src/workspace/workspacesProvider.ts‎

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import{
22
typeWorkspace,
33
typeWorkspaceAgent,
4-
typeWorkspaceApp,
54
}from"coder/site/src/api/typesGenerated";
6-
import*aspathfrom"path";
5+
import*aspathfrom"node:path";
76
import*asvscodefrom"vscode";
87

98
import{
@@ -132,7 +131,7 @@ export class WorkspaceProvider
132131
constshowMetadata=this.getWorkspacesQuery===WorkspaceQuery.Mine;
133132
if(showMetadata){
134133
constagents=extractAllAgents(resp.workspaces);
135-
agents.forEach(async(agent)=>{
134+
for(constagentofagents){
136135
// If we have an existing watcher, re-use it.
137136
constoldWatcher=this.agentWatchers.get(agent.id);
138137
if(oldWatcher){
@@ -146,16 +145,16 @@ export class WorkspaceProvider
146145
watcher.onChange(()=>this.refresh());
147146
this.agentWatchers.set(agent.id,watcher);
148147
}
149-
});
148+
}
150149
}
151150

152151
// Dispose of watchers we ended up not reusing.
153-
oldWatcherIds.forEach((id)=>{
152+
for(constidofoldWatcherIds){
154153
if(!reusedWatcherIds.includes(id)){
155154
this.agentWatchers.get(id)?.dispose();
156155
this.agentWatchers.delete(id);
157156
}
158-
});
157+
}
159158

160159
// Create tree items for each workspace
161160
constworkspaceTreeItems=resp.workspaces.map((workspace:Workspace)=>{
@@ -165,22 +164,6 @@ export class WorkspaceProvider
165164
showMetadata,
166165
);
167166

168-
// Get app status from the workspace agents
169-
constagents=extractAgents(workspace.latest_build.resources);
170-
agents.forEach((agent)=>{
171-
// Check if agent has apps property with status reporting
172-
if(agent.apps&&Array.isArray(agent.apps)){
173-
workspaceTreeItem.appStatus=agent.apps.map((app:WorkspaceApp)=>({
174-
name:app.display_name,
175-
url:app.url,
176-
agent_id:agent.id,
177-
agent_name:agent.name,
178-
command:app.command,
179-
workspace_name:workspace.name,
180-
}));
181-
}
182-
});
183-
184167
returnworkspaceTreeItem;
185168
});
186169

@@ -196,10 +179,10 @@ export class WorkspaceProvider
196179
this.visible=visible;
197180
if(!visible){
198181
this.cancelPendingRefresh();
199-
}elseif(!this.workspaces){
200-
this.fetchAndRefresh();
201-
}else{
182+
}elseif(this.workspaces){
202183
this.maybeScheduleRefresh();
184+
}else{
185+
this.fetchAndRefresh();
203186
}
204187
}
205188

@@ -222,15 +205,15 @@ export class WorkspaceProvider
222205
}
223206
}
224207

225-
private_onDidChangeTreeData:vscode.EventEmitter<
226-
vscode.TreeItem|undefined|null|void
227-
>=newvscode.EventEmitter<vscode.TreeItem|undefined|null|void>();
208+
privatereadonly_onDidChangeTreeData:vscode.EventEmitter<
209+
vscode.TreeItem|undefined
210+
>=newvscode.EventEmitter<vscode.TreeItem|undefined>();
228211
readonlyonDidChangeTreeData:vscode.Event<
229212
vscode.TreeItem|undefined|null|void
230213
>=this._onDidChangeTreeData.event;
231214

232-
// refresh causes the tree to re-render.It does not fetch fresh workspaces.
233-
refresh(item:vscode.TreeItem|undefined|null|void):void{
215+
// refresh causes the tree to re-render. It does not fetch fresh workspaces.
216+
refresh(item?:vscode.TreeItem):void{
234217
this._onDidChangeTreeData.fire(item);
235218
}
236219

@@ -279,9 +262,10 @@ export class WorkspaceProvider
279262

280263
// Show the section if it has any items
281264
if(appStatuses.length>0){
265+
appStatuses.reverse();
282266
constappStatusSection=newSectionTreeItem(
283267
"App Statuses",
284-
appStatuses.reverse(),
268+
appStatuses,
285269
);
286270
items.push(appStatusSection);
287271
}
@@ -430,15 +414,6 @@ export class AgentTreeItem extends OpenableTreeItem {
430414
}
431415

432416
exportclassWorkspaceTreeItemextendsOpenableTreeItem{
433-
publicappStatus:{
434-
name:string;
435-
url?:string;
436-
agent_id?:string;
437-
agent_name?:string;
438-
command?:string;
439-
workspace_name?:string;
440-
}[]=[];
441-
442417
constructor(
443418
workspace:Workspace,
444419
publicreadonlyshowOwner:boolean,

‎yarn.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2806,7 +2806,7 @@ cockatiel@^3.1.2:
28062806

28072807
"coder@https://github.com/coder/coder#main":
28082808
version "0.0.0"
2809-
resolved "https://github.com/coder/coder#2efb8088f4d923d1884fe8947dc338f9d179693b"
2809+
resolved "https://github.com/coder/coder#cac6d4ce98094e2d15afae5f6105ab2f3a46cbc1"
28102810

28112811
collapse-white-space@^1.0.2:
28122812
version "1.0.6"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp