Skip to content

Commit eaebc48

Browse files
author
Jamie Curnow
committed
Made the hostnames clickable and open new tabs (yay)
1 parent eb39195 commit eaebc48

File tree

7 files changed

+89
-15
lines changed

7 files changed

+89
-15
lines changed

src/frontend/js/app/nginx/dead/list/item.ejs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
<td>
77
<div>
88
<% domain_names.map(function(host) {
9-
%>
10-
<span class="tag"><%- host %></span>
11-
<%
9+
if (host.indexOf('*') === -1) {
10+
%>
11+
<span class="tag host-link hover-red" rel="http<%- certificate_id ? 's' : '' %>://<%- host %>"><%- host %></span>
12+
<%
13+
} else {
14+
%>
15+
<span class="tag"><%- host %></span>
16+
<%
17+
}
1218
});
1319
%>
1420
</div>

src/frontend/js/app/nginx/dead/list/item.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ module.exports = Mn.View.extend({
99
tagName: 'tr',
1010

1111
ui: {
12-
edit: 'a.edit',
13-
delete: 'a.delete'
12+
edit: 'a.edit',
13+
delete: 'a.delete',
14+
host_link: '.host-link'
1415
},
1516

1617
events: {
@@ -22,6 +23,12 @@ module.exports = Mn.View.extend({
2223
'click @ui.delete': function (e) {
2324
e.preventDefault();
2425
App.Controller.showNginxDeadDeleteConfirm(this.model);
26+
},
27+
28+
'click @ui.host_link': function (e) {
29+
e.preventDefault();
30+
let win = window.open($(e.currentTarget).attr('rel'), '_blank');
31+
win.focus();
2532
}
2633
},
2734

src/frontend/js/app/nginx/proxy/list/item.ejs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
<td>
77
<div>
88
<% domain_names.map(function(host) {
9-
%>
10-
<span class="tag"><%- host %></span>
11-
<%
9+
if (host.indexOf('*') === -1) {
10+
%>
11+
<span class="tag host-link hover-green" rel="http<%- certificate_id ? 's' : '' %>://<%- host %>"><%- host %></span>
12+
<%
13+
} else {
14+
%>
15+
<span class="tag"><%- host %></span>
16+
<%
17+
}
1218
});
1319
%>
1420
</div>

src/frontend/js/app/nginx/proxy/list/item.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ module.exports = Mn.View.extend({
99
tagName: 'tr',
1010

1111
ui: {
12-
edit: 'a.edit',
13-
delete: 'a.delete'
12+
edit: 'a.edit',
13+
delete: 'a.delete',
14+
host_link: '.host-link'
1415
},
1516

1617
events: {
@@ -22,6 +23,12 @@ module.exports = Mn.View.extend({
2223
'click @ui.delete': function (e) {
2324
e.preventDefault();
2425
App.Controller.showNginxProxyDeleteConfirm(this.model);
26+
},
27+
28+
'click @ui.host_link': function (e) {
29+
e.preventDefault();
30+
let win = window.open($(e.currentTarget).attr('rel'), '_blank');
31+
win.focus();
2532
}
2633
},
2734

src/frontend/js/app/nginx/redirection/list/item.ejs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
<td>
77
<div>
88
<% domain_names.map(function(host) {
9-
%>
10-
<span class="tag"><%- host %></span>
11-
<%
9+
if (host.indexOf('*') === -1) {
10+
%>
11+
<span class="tag host-link hover-yellow" rel="http<%- certificate_id ? 's' : '' %>://<%- host %>"><%- host %></span>
12+
<%
13+
} else {
14+
%>
15+
<span class="tag"><%- host %></span>
16+
<%
17+
}
1218
});
1319
%>
1420
</div>

src/frontend/js/app/nginx/redirection/list/item.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ module.exports = Mn.View.extend({
99
tagName: 'tr',
1010

1111
ui: {
12-
edit: 'a.edit',
13-
delete: 'a.delete'
12+
edit: 'a.edit',
13+
delete: 'a.delete',
14+
host_link: '.host-link'
1415
},
1516

1617
events: {
@@ -22,6 +23,12 @@ module.exports = Mn.View.extend({
2223
'click @ui.delete': function (e) {
2324
e.preventDefault();
2425
App.Controller.showNginxRedirectionDeleteConfirm(this.model);
26+
},
27+
28+
'click @ui.host_link': function (e) {
29+
e.preventDefault();
30+
let win = window.open($(e.currentTarget).attr('rel'), '_blank');
31+
win.focus();
2532
}
2633
},
2734

src/frontend/scss/tabler-extra.scss

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ $yellow: #f1c40f;
33
$blue: #467fcf;
44
$pink: #f66d9b;
55

6+
.tag.hover-green:hover, .tag.hover-green:active, .tag.hover-green:focus {
7+
background-color: #5eba00;
8+
cursor: pointer;
9+
color: #fff;
10+
}
11+
12+
.tag.hover-red:hover, .tag.hover-red:active, .tag.hover-red:focus {
13+
background-color: #cd201f;
14+
cursor: pointer;
15+
color: #fff;
16+
}
17+
618
/* For Card bodies where I don't want padding */
719
.card-body.no-padding {
820
padding: 0;
@@ -28,6 +40,12 @@ $pink: #f66d9b;
2840
border-color: $teal;
2941
}
3042

43+
.tag.hover-teal:hover, .tag.hover-teal:active, .tag.hover-teal:focus {
44+
background-color: $teal;
45+
color: #fff;
46+
cursor: pointer;
47+
}
48+
3149
/* Yellow Outline Buttons */
3250
.btn-outline-yellow {
3351
color: $yellow;
@@ -48,6 +66,12 @@ $pink: #f66d9b;
4866
border-color: $yellow;
4967
}
5068

69+
.tag.hover-yellow:hover, .tag.hover-yellow:active, .tag.hover-yellow:focus {
70+
background-color: $yellow;
71+
cursor: pointer;
72+
color: #fff;
73+
}
74+
5175
/* Blue Outline Buttons */
5276
.btn-outline-blue {
5377
color: $blue;
@@ -68,6 +92,12 @@ $pink: #f66d9b;
6892
border-color: $blue;
6993
}
7094

95+
.tag.hover-blue:hover, .tag.hover-blue:active, .tag.hover-blue:focus {
96+
background-color: $blue;
97+
cursor: pointer;
98+
color: #fff;
99+
}
100+
71101
/* Pink Outline Buttons */
72102
.btn-outline-pink {
73103
color: $pink;
@@ -88,6 +118,11 @@ $pink: #f66d9b;
88118
border-color: $pink;
89119
}
90120

121+
.tag.hover-pink:hover, .tag.hover-pink:active, .tag.hover-pink:focus {
122+
background-color: $pink;
123+
cursor: pointer;
124+
}
125+
91126
/* dimmer */
92127

93128
.dimmer .loader {

0 commit comments

Comments
 (0)