Update installation and start of components
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
@@ -9,8 +9,8 @@ export default class ComponentTreeItem extends TreeItem implements GithubLocalAc
|
||||
constructor(component: Component<CliStatus | ExtensionStatus>) {
|
||||
super(component.name, TreeItemCollapsibleState.None);
|
||||
this.component = component;
|
||||
this.description = component.version;
|
||||
this.contextValue = ComponentTreeItem.contextValue;
|
||||
this.description = component.version ? `(${component.version}) - ${component.status}` : `${component.status}`;
|
||||
this.contextValue = `${ComponentTreeItem.contextValue}_${component.status}`;
|
||||
this.iconPath = new ThemeIcon(component.icon);
|
||||
this.resourceUri = Uri.parse(`${ComponentTreeItem.contextValue}:${component.name}?status=${component.status}&required=${component.required}`, true);
|
||||
this.tooltip = `Name: ${component.name}\n` +
|
||||
|
||||
@@ -18,7 +18,19 @@ export default class ComponentsTreeDataProvider implements TreeDataProvider<Gith
|
||||
this.refresh();
|
||||
}),
|
||||
commands.registerCommand('githubLocalActions.information', async (componentTreeItem: ComponentTreeItem) => {
|
||||
env.openExternal(Uri.parse(componentTreeItem.component.information));
|
||||
await env.openExternal(Uri.parse(componentTreeItem.component.information));
|
||||
}),
|
||||
commands.registerCommand('githubLocalActions.installComponent', async (componentTreeItem: ComponentTreeItem) => {
|
||||
await componentTreeItem.component.installation();
|
||||
this.refresh();
|
||||
}),
|
||||
commands.registerCommand('githubLocalActions.startComponent', async (componentTreeItem: ComponentTreeItem) => {
|
||||
const start = componentTreeItem.component.start;
|
||||
if (start) {
|
||||
await start();
|
||||
}
|
||||
|
||||
this.refresh();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,17 +12,17 @@ export class DecorationProvider implements FileDecorationProvider {
|
||||
const status = params.get('status');
|
||||
const required = params.get('required') === 'true';
|
||||
|
||||
if (status === CliStatus.Installed || status === ExtensionStatus.Activated) {
|
||||
if (status === CliStatus.Installed || status === CliStatus.Running || status === ExtensionStatus.Activated) {
|
||||
return {
|
||||
badge: '✅',
|
||||
color: new ThemeColor('GitHubLocalActions.green')
|
||||
};
|
||||
} else if (!required && (status === CliStatus.NotInstalled || status === ExtensionStatus.NotActivated)) {
|
||||
} else if (!required && (status === CliStatus.NotInstalled || status === CliStatus.NotRunning|| status === ExtensionStatus.NotActivated)) {
|
||||
return {
|
||||
badge: '⚠️',
|
||||
color: new ThemeColor('GitHubLocalActions.yellow')
|
||||
};
|
||||
} else if (required && (status === CliStatus.NotInstalled || status === ExtensionStatus.NotActivated)) {
|
||||
} else if (required && (status === CliStatus.NotInstalled || status === CliStatus.NotRunning || status === ExtensionStatus.NotActivated)) {
|
||||
return {
|
||||
badge: '❌',
|
||||
color: new ThemeColor('GitHubLocalActions.red')
|
||||
|
||||
Reference in New Issue
Block a user