| 80 | | <% for i, plan in pairs(ast.dialplan.plans()) do %> |
| 81 | | <div class="cbi-section-node"> |
| 82 | | <table class="cbi-section-table"> |
| 83 | | <tr class="cbi-section-table-titles"> |
| 84 | | <th style="text-align: left; padding: 3px" class="cbi-section-table-cell"> |
| 85 | | <big>Dialplan <em><%=plan.name%></em></big> |
| 86 | | </th> |
| 87 | | <td> |
| 88 | | <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delplan=<%=plan.name%>"> |
| 89 | | <img style="border:none" alt="Remove this dialplan" title="Remove this dialplan" src="/luci-static/resources/cbi/remove.gif" /> |
| 90 | | </a> |
| 91 | | </td> |
| 92 | | </tr> |
| | 81 | <% for i, plan in pairs(ast.dialplan.plans()) do %> |
| | 82 | <div class="cbi-section-node"> |
| | 83 | <table class="cbi-section-table"> |
| | 84 | <tr class="cbi-section-table-titles"> |
| | 85 | <th style="text-align: left; padding: 3px" class="cbi-section-table-cell"> |
| | 86 | <big>Dialplan <em><%=plan.name%></em></big> |
| | 87 | </th> |
| | 88 | <td> |
| | 89 | <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delplan=<%=plan.name%>"> |
| | 90 | <img style="border:none" alt="Remove this dialplan" title="Remove this dialplan" src="/luci-static/resources/cbi/remove.gif" /> |
| | 91 | </a> |
| | 92 | </td> |
| | 93 | </tr> |
| 94 | | <!-- dialzones --> |
| 95 | | <% local zones_used = { } %> |
| 96 | | <% for i, zone in ipairs(plan.zones) do zones_used[zone.name] = true %> |
| 97 | | <tr class="cbi-section-table-row <%=rowstyle(i)%>"> |
| 98 | | <td style="text-align: left; padding: 3px" class="cbi-section-table-cell"> |
| 99 | | <strong>└ Dialzone <em><%=zone.name%></em></strong> |
| 100 | | <p style="padding-left: 1em; margin-bottom:0"> |
| 101 | | Description: <%=zone.description%><br /> |
| 102 | | Lines: |
| 103 | | <%=ast.tools.hyperlinks( |
| 104 | | zone.trunks, function(v) |
| 105 | | return luci.dispatcher.build_url("admin", "asterisk", "trunks", "%s") % v:lower() |
| 106 | | end |
| 107 | | )%><br /> |
| 108 | | Matches: |
| 109 | | <%=format_matches(zone)%> |
| 110 | | </p> |
| 111 | | </td> |
| 112 | | <td style="width:5%" class="cbi-value-field"> |
| 113 | | <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'out', zone.name)%>"> |
| 114 | | <img style="border:none" alt="Edit dialzone" title="Edit dialzone" src="/luci-static/resources/cbi/edit.gif" /> |
| 115 | | </a> |
| 116 | | <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>"> |
| 117 | | <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" /> |
| 118 | | </a> |
| 119 | | </td> |
| 120 | | </tr> |
| 121 | | <% end %> |
| | 95 | <!-- dialzones --> |
| | 96 | <% local zones_used = { } %> |
| | 97 | <% for i, zone in ipairs(plan.zones) do zones_used[zone.name] = true %> |
| | 98 | <tr class="cbi-section-table-row <%=rowstyle(i)%>"> |
| | 99 | <td style="text-align: left; padding: 3px" class="cbi-section-table-cell"> |
| | 100 | <strong>└ Dialzone <em><%=zone.name%></em></strong> (<%=zone.description%>) |
| | 101 | <p style="padding-left: 1em; margin-bottom:0"> |
| | 102 | Lines: |
| | 103 | <%=ast.tools.hyperlinks( |
| | 104 | zone.trunks, function(v) |
| | 105 | return luci.dispatcher.build_url("admin", "asterisk", "trunks", "%s") % v:lower() |
| | 106 | end |
| | 107 | )%><br /> |
| | 108 | Matches: |
| | 109 | <%=format_matches(zone)%> |
| | 110 | </p> |
| | 111 | </td> |
| | 112 | <td style="width:5%" class="cbi-value-field"> |
| | 113 | <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'out', zone.name)%>"> |
| | 114 | <img style="border:none" alt="Edit dialzone" title="Edit dialzone" src="/luci-static/resources/cbi/edit.gif" /> |
| | 115 | </a> |
| | 116 | <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>"> |
| | 117 | <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" /> |
| | 118 | </a> |
| | 119 | </td> |
| | 120 | </tr> |
| | 121 | <% end %> |
| 123 | | <tr class="cbi-section-table-row"> |
| 124 | | <td style="text-align: left; padding: 3px" class="cbi-section-table-cell" colspan="2"> |
| 125 | | <hr style="margin-bottom:0.5em; border-width:0 0 1px 0" /> |
| 126 | | <select style="width:30%" name="addzone.<%=plan.name%>"> |
| 127 | | <option value="">-- Add dialzone --</option> |
| 128 | | <% for _, zone in pairs(ast.dialzone.zones()) do %> |
| 129 | | <% if not zones_used[zone.name] then %> |
| 130 | | <option value="<%=zone.name%>"><%=zone.name%> (<%=zone.description%>)</option> |
| | 123 | <tr class="cbi-section-table-row"> |
| | 124 | <td style="text-align: left; padding: 3px" class="cbi-section-table-cell" colspan="2"> |
| | 125 | <hr style="margin-bottom:0.5em; border-width:0 0 1px 0" /> |
| | 126 | <select style="width:30%" name="addzone.<%=plan.name%>"> |
| | 127 | <option value="">-- Add dialzone --</option> |
| | 128 | <% for _, zone in pairs(ast.dialzone.zones()) do %> |
| | 129 | <% if not zones_used[zone.name] then %> |
| | 130 | <option value="<%=zone.name%>"><%=zone.name%> (<%=zone.description%>)</option> |
| | 131 | <% end %> |