1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Add notifications, auto conf only for VILLASnode ICs #224

This commit is contained in:
Sonja Happ 2020-07-01 13:56:06 +02:00
parent c00c16ddb5
commit f038cfe0c8
2 changed files with 22 additions and 0 deletions

View file

@ -42,6 +42,7 @@ import EditConfigDialog from "../componentconfig/edit-config";
import EditSignalMapping from "../signal/edit-signal-mapping";
import FileStore from "../file/file-store"
import WidgetStore from "../widget/widget-store";
import NotificationsDataManager from "../common/data-managers/notifications-data-manager";
class Scenario extends React.Component {
@ -396,6 +397,19 @@ class Scenario extends React.Component {
let componentConfig = this.state.configs[index];
// determine host of infrastructure component
let ic = this.state.ics.find(ic => ic.id === componentConfig.icID)
if(!ic.type.includes("VILLASnode") && !ic.type.includes("villasnode") && !ic.type.includes("VILLASNODE")){
let message = "Cannot autoconfigure signals for IC type " + ic.type + " of category " + ic.category + ". This is only possible for gateway ICs of type 'VILLASnode'."
console.warn(message);
const SIGNAL_AUTOCONF_WARN_NOTIFICATION = {
title: 'Failed to load signal config for IC ' + ic.name,
message: message,
level: 'warning'
};
NotificationsDataManager.addNotification(SIGNAL_AUTOCONF_WARN_NOTIFICATION);
return;
}
let request = {};
request["id"] = this.uuidv4();
request["action"] = "config"

View file

@ -40,6 +40,14 @@ class SignalStore extends ArrayStore{
case 'signals/autoconfig-loaded':
console.log("AutoConfig Loaded: ", action.data)
// TODO save signal config contained in action.data
const SIGNAL_AUTOCONF_INFO_NOTIFICATION = {
title: 'Signal configuration loaded successfully.',
message: '',
level: 'info'
};
NotificationsDataManager.addNotification(SIGNAL_AUTOCONF_INFO_NOTIFICATION);
return super.reduce(state, action);
case 'signals/autoconfig-error':