diff --git a/html/dashboard/js/terminal.js b/html/dashboard/js/terminal.js index 1582393..ad48116 100644 --- a/html/dashboard/js/terminal.js +++ b/html/dashboard/js/terminal.js @@ -29,25 +29,27 @@ var page = { $('#tab-content>.active').removeClass('show').removeClass('active'); var idx = page.idx; var str = ` - `; - $('#tabs').append($(str)); - $("#tabs #tab-${idx}").click(function() { + var obj = $(str); + obj.find('button').text('shell - ['+$('#terms option:selected').text()+']'); + obj.click(function() { var $this = $(this); $('#tabs>.nav-item>.active').removeClass('active'); $this.find('button').addClass('active'); $('#tab-content>.active').removeClass('show').removeClass('active'); - $('#tab-content-'+idx).addClass('show').addClass('active'); + $('#tab-'+idx).addClass('show').addClass('active'); }); + $('#tabs').append(obj); var str = ` -
- +
+
`; - $('#tab-content').append($(str)); + var obj = $(str); + obj.attr('id', 'tab-'+idx); + obj.find('iframe').attr('src', 'http://'+location.hostname+':'+$('#terms').val()); + $('#tab-content').append(obj); page.idx++; }, idx: 0