+XOSTenantApp.downloadSSH = function(model) {\r
+ var sshCommands = "";\r
+ for (index in model.attributes.sliceInfo.sshCommands) {\r
+ sshCommand = model.attributes.sliceInfo.sshCommands[index];\r
+ sshCommands = sshCommands + sshCommand + "\n";\r
+ }\r
+\r
+ if (sshCommands.length == 0) {\r
+ alert("this slice has no instantiated slivers yet");\r
+ return;\r
+ }\r
+\r
+ var htmlView = new HTMLView({html: '<pre style="overflow: auto; word-wrap: normal; white-space: pre; word-wrap: normal;">' + sshCommands + '</pre>'});\r
+ XOSTenantApp.tenantSSHCommandsInterior.show(htmlView);\r
+\r
+ $("#tenant-ssh-commands-dialog").dialog({\r
+ autoOpen: false,
+ modal: true,
+ width: 640,
+ buttons : {
+ "Download": function() {
+ var dlLink = document.createElement('a');
+ dlLink.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(sshCommands));
+ dlLink.setAttribute('download', 'sshcommands.txt');
+ dlLink.click();
+
+ //window.open('data:text/text,' + encodeURIComponent(sshCommands));
+ },
+ "Close" : function() {
+ $(this).dialog("close");
+ },
+ }
+ });
+ $("#tenant-ssh-commands-dialog").dialog("open");\r
+};\r
+\r