implement driver add update remove and improve rename tree experience
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import type { Driver } from './Drivers';
|
||||
export type Publish = {
|
||||
event: string;
|
||||
uuid: string;
|
||||
path: string;
|
||||
type: string;
|
||||
drivers?: Record<string, Driver>;
|
||||
value: string | number | boolean | null;
|
||||
hasChild: boolean;
|
||||
};
|
||||
export type Pubs = Publish[];
|
||||
|
||||
import { updateSubscriptionValue, removeRawSubscriptions } from './Subscriptions';
|
||||
import {
|
||||
updateSubscriptionValue,
|
||||
removeRawSubscriptions,
|
||||
addRawSubscription,
|
||||
removeRawSubscription,
|
||||
} from './Subscriptions';
|
||||
import { buildTree, buildTreeWithRawSubs, removeNodes } from '../dbm/dbmTree';
|
||||
import type { RawSubs, RawSubscribe } from '../models/Subscribe';
|
||||
import { ref } from 'vue';
|
||||
@@ -33,6 +40,11 @@ export function publishToSubscriptions(pubs: Pubs) {
|
||||
rawSubs.value.push(pub as RawSubscribe);
|
||||
break;
|
||||
}
|
||||
if (pub.drivers) {
|
||||
removeRawSubscription(pub as RawSubscribe);
|
||||
addRawSubscription(pub as RawSubscribe);
|
||||
UpdateTable();
|
||||
}
|
||||
updateSubscriptionValue(pub.uuid, pub.value);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user