!7 concept Entry { S computerID, shortName, comment; S controllableByMe; } cmodule ComputerNames > DynCRUD { bool automaticallyAddOnlineComputers = true; start { indexConceptField(Entry, 'computerID); // Add myself cset(uniq_returnIfNew(Entry, computerID := computerID()), comment := "This computer"); dm_vmBus_onMessage('onlineComputerIDs, voidfunc(Collection ids) { if (automaticallyAddOnlineComputers) slurpIDs(ids) }); dm_requireModule("#1016578/AllOnlineComputers"); // Add currently online computers pcall { slurpIDs((LS) dm_callModuleOpt(dm_findModule("#1016578/AllOnlineComputers"), 'onlineComputerIDs)); } onConceptsChange(r { dm_findAndCallModule("#1016578/AllOnlineComputers", 'updateList) }); } // API svoid slurpIDs(Collection ids) { for (S id : unnull(ids)) uniq_lock(Entry, computerID := id); } S nameForID(S computerID) { ret cget(conceptWhere(Entry, +computerID), 'shortName); } void setControllableByMe(S computerID, bool b) { cset(uniq_sync(Entry, +computerID), controllableByMe := yesNo_short(b)); } LS controllableComputers() { ret withoutMyComputerID(collect('computerID, conceptsWhere(Entry, controllableByMe := 'yes))); } }