Add save listing and subscriptions

Add link messages for listing saves and listening for changes to the
list of saves for instances along with a table in the instance view page
showing the save list for the instance and a list-saves command to ctl.
This commit is contained in:
Hornwitser committed 2021-06-01 11:22:22 +02:00
1 parent b53ed7f6ca
commit a96fae5ffd
16 files changed
+390 -3

No files matched your search

+8
View File
@@ -26,11 +26,15 @@ class TestControl extends libLink.Link {
super("control", "master", connector);
libLink.attachAllMessages(this);
this.instanceUpdates = [];
this.saveListUpdates = [];
this.connector.on("connect", () => {
libLink.messages.setInstanceSubscriptions.send(
this, { all: true, instance_ids: [] }
).catch(err => logger.error(`Error setting instance subscriptions:\n${err.stack}`));
libLink.messages.setSaveListSubscriptions.send(
this, { all: true, instance_ids: [] }
).catch(err => logger.error(`Error setting save list subscriptions:\n${err.stack}`));
});
}
@@ -45,6 +49,10 @@ class TestControl extends libLink.Link {
this.instanceUpdates.push(message.data);
}
async saveListUpdateEventHandler(message) {
this.saveListUpdates.push(message.data);
}
async logMessageEventHandler() { }
}