Родитель
533fcef50b
Коммит
976d54af29
|
@ -89,10 +89,12 @@ export class Constants {
|
|||
public static IoTHubAIDeleteModuleDoneEvent = "AZ.Module.Delete.Done";
|
||||
public static IoTHubAIGetModuleStartEvent = "AZ.Module.Get.Start";
|
||||
public static IoTHubAIDGetModuleDoneEvent = "AZ.Module.Get.Done";
|
||||
|
||||
public static IoTHubAIStartLoadDeviceTreeEvent = "General.StartLoadDeviceTree";
|
||||
public static IoTHubAIShowWelcomePagetEvent = "General.WelcomePage.Show";
|
||||
|
||||
public static DeleteLabel = "Delete";
|
||||
public static DeleteMessage = "Are you sure you want to delete";
|
||||
|
||||
public static ConnectionStringFormat = {
|
||||
[Constants.IotHubConnectionStringKey]: "HostName=<my-hostname>;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>",
|
||||
[Constants.DeviceConnectionStringKey]: "HostName=<my-hostname>;DeviceId=<known-device-id>;SharedAccessKey=<known-device-key>",
|
||||
|
|
|
@ -101,9 +101,12 @@ export class DeviceExplorer extends BaseExplorer {
|
|||
|
||||
deviceItem = await Utility.getInputDevice(deviceItem, "AZ.Device.Delete.Start");
|
||||
if (deviceItem && deviceItem.label) {
|
||||
const result = await vscode.window.showWarningMessage(`${Constants.DeleteMessage} "${deviceItem.label}"?`, { modal: true }, Constants.DeleteLabel);
|
||||
if (result === Constants.DeleteLabel) {
|
||||
return this.deleteDeviceById(deviceItem.label, label, registry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async promptForDeviceId(prompt: string): Promise<string> {
|
||||
let deviceId: string = await vscode.window.showInputBox({ prompt });
|
||||
|
|
|
@ -91,6 +91,11 @@ export class IotHubModuleExplorer extends BaseExplorer {
|
|||
return;
|
||||
}
|
||||
|
||||
const result = await vscode.window.showWarningMessage(`${Constants.DeleteMessage} "${moduleItem.moduleId}"?`, { modal: true }, Constants.DeleteLabel);
|
||||
if (result !== Constants.DeleteLabel) {
|
||||
return;
|
||||
}
|
||||
|
||||
const registry: iothub.Registry = iothub.Registry.fromConnectionString(iotHubConnectionString);
|
||||
|
||||
this._outputChannel.show();
|
||||
|
|
Загрузка…
Ссылка в новой задаче