web app, fleshed out delete sessions, updated sessions dialog to use selection and buttons for joining/deletion

This commit is contained in:
Blake J. Harnden 2018-05-18 12:39:45 -07:00
parent aa55daf2e8
commit 98e8e2d627
4 changed files with 63 additions and 18 deletions

View file

@ -181,7 +181,7 @@
const coreNetwork = new CoreNetwork('core-network', coreRest);
const serviceModal = new ServiceModal(coreRest);
const servicesModal = new ServicesModal(coreRest, coreNetwork, serviceModal);
const sessionsModal = new SessionsModal(coreRest, coreNetwork, joinSession);
const sessionsModal = new SessionsModal(coreRest, coreNetwork, joinSession, initialSetup);
const nodeEditModal = new NodeEditModal(coreNetwork, coreRest);
const nodeContext = new NodeContext(coreNetwork, coreRest, nodeEditModal, servicesModal);
const edgeEditModal = new EdgeEditModal(coreNetwork, coreRest);
@ -189,13 +189,15 @@
const infoPanel = new InfoPanel(coreNetwork);
const configModal = new ConfigModel(coreRest);
coreNetwork.initialSession()
.then(function (session) {
joinSession(session);
})
.catch(function (err) {
console.log('initial session error: ', err);
});
function initialSetup() {
coreNetwork.initialSession()
.then(function (session) {
joinSession(session);
})
.catch(function (err) {
console.log('initial session error: ', err);
});
}
function setRunButton(start) {
console.log('set run button: ', start);
@ -222,6 +224,8 @@
$sessionSaveButton.attr('download', true);
}
initialSetup();
// handle network clicks
coreNetwork.network.on('click', function (properties) {
console.log('click properties: ', properties);
@ -252,7 +256,7 @@
const nodeId = coreNetwork.network.getNodeAt(location);
if (nodeId) {
nodeContext.show(nodeId, x, y)
.catch(function(err) {
.catch(function (err) {
console.log('error showing node context: ', err);
});
} else {

View file

@ -21,6 +21,8 @@
</table>
</div>
<div class="modal-footer">
<button id="session-join" type="button" class="btn btn-primary">Join</button>
<button id="session-delete" type="button" class="btn btn-danger">Delete</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>