diff --git a/html/dashboard/css/index.css b/html/dashboard/css/index.css
deleted file mode 100644
index e69de29..0000000
diff --git a/html/dashboard/files.html b/html/dashboard/files.html
index 8701ed4..b4dddd9 100644
--- a/html/dashboard/files.html
+++ b/html/dashboard/files.html
@@ -1,7 +1,7 @@
{{define "all"}}
{{template "header" .}}
-
-
+
{{template "aside" .}}
@@ -19,6 +19,7 @@
diff --git a/html/dashboard/index.html b/html/dashboard/index.html
index 14da4d3..008c83c 100644
--- a/html/dashboard/index.html
+++ b/html/dashboard/index.html
@@ -1,6 +1,5 @@
{{define "all"}}
{{template "header" .}}
-
{{template "aside" .}}
diff --git a/html/dashboard/js/index.js b/html/dashboard/js/index.js
index 1e9f126..df975f3 100644
--- a/html/dashboard/js/index.js
+++ b/html/dashboard/js/index.js
@@ -31,10 +31,15 @@ var page = {
recv_packet += link.recv_packet;
});
var op = '';
- if (tunnel.type == 'reverse') {
+ switch (tunnel.type) {
+ case 'reverse':
op = `
http
-
https`
+
https`;
+ break;
+ case 'shell':
+ op = `
连接`;
+ break;
}
var str = `
diff --git a/html/dashboard/js/terminal.js b/html/dashboard/js/terminal.js
new file mode 100644
index 0000000..2db0985
--- /dev/null
+++ b/html/dashboard/js/terminal.js
@@ -0,0 +1,47 @@
+var page = {
+ init: function() {
+ page.load();
+ $('#connect').click(page.connect);
+ },
+ load: function() {
+ $.get('/api/tunnels', function(ret) {
+ $('#terms').empty();
+ $.each(ret, function(_, tunnel) {
+ if (tunnel.type != 'shell') {
+ return;
+ }
+ $('#terms').append($(``));
+ });
+ });
+ },
+ connect: function() {
+ $('#tabs>.nav-item>.active').removeClass('active');
+ $('#tab-content>.active').removeClass('show').removeClass('active');
+ var idx = page.idx;
+ var str = `
+
+
+ `;
+ var obj = $(str);
+ 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-'+idx).addClass('show').addClass('active');
+ });
+ $('#tabs').append(obj);
+ var str = `
+
+
+
`;
+ var obj = $(str);
+ $('#tab-content').append(obj);
+ page.idx++;
+ },
+ idx: 0
+};
+$(document).ready(page.init);
\ No newline at end of file
diff --git a/html/dashboard/terminal.html b/html/dashboard/terminal.html
index 04bc265..572ea74 100644
--- a/html/dashboard/terminal.html
+++ b/html/dashboard/terminal.html
@@ -1,7 +1,6 @@
{{define "all"}}
{{template "header" .}}
-
-
+
{{template "aside" .}}