404 hosts section and other fixes

This commit is contained in:
Jamie Curnow
2018-07-26 08:23:32 +10:00
parent 81b3366a8b
commit 5107d1529f
41 changed files with 1260 additions and 379 deletions

View File

@@ -4,26 +4,25 @@
</div>
</td>
<td>
<div>
<% domain_names.map(function(host) {
%>
<span class="tag"><%- host %></span>
<%
});
%>
<div class="text-monospace">
<%- incoming_port %>
</div>
<div class="small text-muted">
<%- i18n('str', 'created-on', {date: formatDbDate(created_on, 'Do MMMM YYYY')}) %>
</div>
</td>
<td>
<div class="text-monospace"><%- forward_ip %>:<%- forward_port %></div>
<div class="text-monospace"><%- forward_ip %>:<%- forwarding_port %></div>
</td>
<td>
<div><%- ssl_enabled && ssl_provider ? i18n('ssl', ssl_provider) : i18n('ssl', 'none') %></div>
</td>
<td>
<div><%- access_list_id ? access_list.name : i18n('str', 'public') %></div>
<div>
<% if (tcp_forwarding) { %>
<span class="tag"><%- i18n('streams', 'tcp') %></span>
<% }
if (udp_forwarding) { %>
<span class="tag"><%- i18n('streams', 'udp') %></span>
<% } %>
</div>
</td>
<% if (canManage) { %>
<td class="text-center">
@@ -31,7 +30,6 @@
<a href="#" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="#" class="edit dropdown-item"><i class="dropdown-icon fe fe-edit"></i> <%- i18n('str', 'edit') %></a>
<a href="#" class="logs dropdown-item"><i class="dropdown-icon fe fe-book"></i> <%- i18n('str', 'logs') %></a>
<div class="dropdown-divider"></div>
<a href="#" class="delete dropdown-item"><i class="dropdown-icon fe fe-trash-2"></i> <%- i18n('str', 'delete') %></a>
</div>

View File

@@ -16,17 +16,17 @@ module.exports = Mn.View.extend({
events: {
'click @ui.edit': function (e) {
e.preventDefault();
App.Controller.showNginxProxyForm(this.model);
App.Controller.showNginxStreamForm(this.model);
},
'click @ui.delete': function (e) {
e.preventDefault();
App.Controller.showNginxProxyDeleteConfirm(this.model);
App.Controller.showNginxStreamDeleteConfirm(this.model);
}
},
templateContext: {
canManage: App.Cache.User.canManage('proxy_hosts')
canManage: App.Cache.User.canManage('streams')
},
initialize: function () {

View File

@@ -1,9 +1,8 @@
<thead>
<th width="30">&nbsp;</th>
<th><%- i18n('str', 'source') %></th>
<th><%- i18n('streams', 'incoming-port') %></th>
<th><%- i18n('str', 'destination') %></th>
<th><%- i18n('str', 'ssl') %></th>
<th><%- i18n('str', 'access') %></th>
<th><%- i18n('streams', 'protocol') %></th>
<% if (canManage) { %>
<th>&nbsp;</th>
<% } %>

View File

@@ -23,7 +23,7 @@ module.exports = Mn.View.extend({
},
templateContext: {
canManage: App.Cache.User.canManage('proxy_hosts')
canManage: App.Cache.User.canManage('streams')
},
onRender: function () {