Enhancement and support for multi-arch (#201)
* [Direct method] Support passing JSON in payload * Add 'Refresh' into context menu of normal device * Support deployment for multi-arch * Add refresh icon inline
This commit is contained in:
Родитель
2695555179
Коммит
1af92d8c54
33
package.json
33
package.json
|
@ -300,6 +300,11 @@
|
|||
}
|
||||
],
|
||||
"view/item/context": [
|
||||
{
|
||||
"command": "azure-iot-toolkit.refresh",
|
||||
"when": "view == iotHubDevices && viewItem == device",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.generateCode",
|
||||
"when": "view == iotHubDevices && viewItem == device",
|
||||
|
@ -356,10 +361,20 @@
|
|||
"group": "azure-iot-toolkit@10"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.deleteDevice",
|
||||
"command": "azure-iot-toolkit.refresh",
|
||||
"when": "view == iotHubDevices && viewItem == device",
|
||||
"group": "azure-iot-toolkit@11"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.deleteDevice",
|
||||
"when": "view == iotHubDevices && viewItem == device",
|
||||
"group": "azure-iot-toolkit@12"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.refresh",
|
||||
"when": "view == iotHubDevices && viewItem == edge",
|
||||
"group": "inline"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.generateCode",
|
||||
"when": "view == iotHubDevices && viewItem == edge",
|
||||
|
@ -416,20 +431,20 @@
|
|||
"group": "azure-iot-toolkit@10"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.deleteDevice",
|
||||
"command": "azure-iot-toolkit.refresh",
|
||||
"when": "view == iotHubDevices && viewItem == edge",
|
||||
"group": "azure-iot-toolkit@11"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.deleteDevice",
|
||||
"when": "view == iotHubDevices && viewItem == edge",
|
||||
"group": "azure-iot-toolkit@12"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.createDeployment",
|
||||
"when": "view == iotHubDevices && viewItem == edge",
|
||||
"group": "azure-iot-toolkit-edge@0"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.refresh",
|
||||
"when": "view == iotHubDevices && viewItem == edge",
|
||||
"group": "azure-iot-toolkit-edge@1"
|
||||
},
|
||||
{
|
||||
"command": "azure-iot-toolkit.getModule",
|
||||
"when": " view == iotHubDevices && viewItem == module",
|
||||
|
@ -500,12 +515,12 @@
|
|||
],
|
||||
"explorer/context": [
|
||||
{
|
||||
"when": "resourceFilename == deployment.json",
|
||||
"when": "resourceFilename =~ /deployment(?!\\.template\\.)(\\.[a-z0-9]+)*(\\.debug)?.json/",
|
||||
"command": "azure-iot-toolkit.createDeployment",
|
||||
"group": "azure-iot-toolkit-edge@0 "
|
||||
},
|
||||
{
|
||||
"when": "resourceFilename == deployment.json",
|
||||
"when": "resourceFilename =~ /deployment(?!\\.template\\.)(\\.[a-z0-9]+)*(\\.debug)?.json/",
|
||||
"command": "azure-iot-toolkit.createDeploymentAtScale",
|
||||
"group": "azure-iot-toolkit-edge@1"
|
||||
}
|
||||
|
|
|
@ -140,8 +140,8 @@ export class IoTEdgeExplorer extends BaseExplorer {
|
|||
filePath = filePathUri[0].fsPath;
|
||||
}
|
||||
|
||||
if (path.basename(filePath) === "deployment.template.json") {
|
||||
vscode.window.showWarningMessage("Please select 'deployment.json' under 'config' folder for deployment.");
|
||||
if (path.basename(filePath) === "deployment.template.json" || path.basename(filePath) === "deployment.template.debug.json" ) {
|
||||
vscode.window.showWarningMessage("Please select deployment manifest file under 'config' folder for deployment.");
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ export class IotHubDirectMethodExplorer extends BaseExplorer {
|
|||
}
|
||||
|
||||
private invokeDirectMethod(iotHubConnectionString: string, deviceId: string, moduleId?: string) {
|
||||
const target = moduleId ? `[${deviceId}/${moduleId}]` : `[${deviceId}]`;
|
||||
const target = moduleId ? `[${deviceId}/${moduleId}]` : `[${deviceId}]`;
|
||||
|
||||
vscode.window.showInputBox({ prompt: `Enter [Method Name] sent to ${target}`, ignoreFocusOut: true }).then((methodName: string) => {
|
||||
if (methodName === undefined) {
|
||||
|
@ -52,6 +52,9 @@ export class IotHubDirectMethodExplorer extends BaseExplorer {
|
|||
if (payload === undefined) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
payload = JSON.parse(payload);
|
||||
} catch (e) { }
|
||||
const methodParams: DeviceMethodParams = {
|
||||
methodName,
|
||||
payload,
|
||||
|
|
Загрузка…
Ссылка в новой задаче