Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

use id from known assetid

Vincente6c596db119d
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index 56df1d531..bd48cefcf 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -370,8 +370,8 @@ export function getPanelContent(panelName: string, asset: Asset, attributes: { [
return;
}
- const discoverAssets = (agentId: string) => {
- manager.rest.api.AgentResource.doProtocolAssetDiscovery(agentId)
+ const discoverAssets = () => {
+ manager.rest.api.AgentResource.doProtocolAssetDiscovery(asset.id!)
.then(response => console.log(response.data, response)); //todo: do something with this response
}
@@ -399,7 +399,7 @@ export function getPanelContent(panelName: string, asset: Asset, attributes: { [
`;
}
else if (descriptor.assetDiscovery) {
- content = html`<or-mwc-input outlined id="discover-btn" .type="${InputType.BUTTON}" .label="${i18next.t("discoverAssets")}" @or-mwc-input-changed="${() => discoverAssets(asset.id!)}"></or-mwc-input>`;
+ content = html`<or-mwc-input outlined id="discover-btn" .type="${InputType.BUTTON}" .label="${i18next.t("discoverAssets")}" @or-mwc-input-changed="${() => discoverAssets()}"></or-mwc-input>`;
} else {
showSnackbar(undefined, "agent type doesn't support a known protocol to add assets", i18next.t("dismiss"));
}