Hi,
I created a github repository for a plugin which loads as a widget in the cockpit.
Loading and running this widget works.
I wonder why my preview image is not loaded?
Although I added the copy entry to package.json
package.json
...
"copy": [
{
"from": "widget/raise-alarm-preview.png",
"to": "c8y-widget-preview-img/raise-alarm-preview.png"
}
]
...
and reference this png in the module:
...
raise-alarm-plugin.module.ts
providers: [
{
provide: HOOK_COMPONENTS,
multi: true,
useValue: [
{
id: 'raise-alarm.widget.plugin',
label: gettext('Raise alarm widget plugin'),
description: 'Raise alarm widget plugin',
component: RaiseAlarmPluginComponent,
previewImage: 'c8y-widget-preview-img/raise-alarm-preview.png',
configComponent: RaiseAlarmPluginConfig
}
] as DynamicComponentDefinition[]
}
]
...
What I see in the preview is the following:
So it seems it can’t find the png.
What am I doing wrong?
Regards Christof