|
| 1 | +<h1>Limits</h1> |
| 2 | + |
| 3 | +<div class="section"> |
| 4 | + <h2>Virtual host Limits</h2> |
| 5 | + <div class="hider"> |
| 6 | + <div class="updatable"> |
| 7 | + |
| 8 | + <% if (limits.length > 0) { %> |
| 9 | + <table class="list"> |
| 10 | + <thead> |
| 11 | + <tr> |
| 12 | + <th>Virtual Host</th> |
| 13 | + <th>Limit</th> |
| 14 | + <th>Value</th> |
| 15 | + <th class="administrator-only"></th> |
| 16 | + </tr> |
| 17 | + </thead> |
| 18 | + <tbody> |
| 19 | + <% for (var i = 0; i < limits.length; i++) { |
| 20 | + var limit = limits[i]; |
| 21 | + var limit_values = Object.keys(limit.value).sort().map( |
| 22 | + function(k) { return {name: k, value: limit.value[k]};}); |
| 23 | + %> |
| 24 | +
|
| 25 | + <% for (var j = 0; j < limit_values.length; j++) { |
| 26 | + var limit_value = limit_values[j]; |
| 27 | + %> |
| 28 | +
|
| 29 | + <tr<%= alt_rows(j+1)%>> |
| 30 | + <% if(j == 0) { %> |
| 31 | + <td rowspan="<%= limit_values.length %>"> <%= fmt_string(limit.vhost) %> </td> |
| 32 | + <% } %> |
| 33 | + <td><%= limit_value.name %></td> |
| 34 | + <td><%= limit_value.value %></td> |
| 35 | + <td class="administrator-only"> |
| 36 | + <form action="#/limits" method="delete" class="confirm"> |
| 37 | + <input type="hidden" name="name" value="<%= fmt_string(limit_value.name) %>"/> |
| 38 | + <input type="hidden" name="vhost" value="<%= fmt_string(limit.vhost) %>"/> |
| 39 | + <input type="submit" value="Clear"/> |
| 40 | + </form> |
| 41 | + </td> |
| 42 | + </tr> |
| 43 | + <% } %> |
| 44 | + <% } %> |
| 45 | + </tbody> |
| 46 | + </table> |
| 47 | + <% } %> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | +</div> |
| 51 | + |
| 52 | +<div class="section administrator-only"> |
| 53 | + <h2>Set / update a virtual host limit</h2> |
| 54 | + <div class="hider"> |
| 55 | + <form action="#/limits" method="put"> |
| 56 | + <table class="form"> |
| 57 | + <tr> |
| 58 | + <th><label>Virtual host:</label></th> |
| 59 | + <td> |
| 60 | + <select name="vhost"> |
| 61 | + <% for (var i = 0; i < vhosts.length; i++) { %> |
| 62 | + <option value="<%= fmt_string(vhosts[i].name) %>"> |
| 63 | + <%= fmt_string(vhosts[i].name) %> |
| 64 | + </option> |
| 65 | + <% } %> |
| 66 | + </select> |
| 67 | + </td> |
| 68 | + </tr> |
| 69 | + <tr> |
| 70 | + <th><label>Limit:</label></th> |
| 71 | + <td> |
| 72 | + <select name="name"> |
| 73 | + <option value="max-connections">max-connections</option> |
| 74 | + <option value="max-queues">max-queues</option> |
| 75 | + </select> |
| 76 | + </td> |
| 77 | + </tr> |
| 78 | + <tr> |
| 79 | + <th><label>Value:</label></th> |
| 80 | + <td> |
| 81 | + <input type="text" name="value"/> |
| 82 | + <span class="mand">*</span> |
| 83 | + </td> |
| 84 | + </tr> |
| 85 | + </table> |
| 86 | + <input type="submit" value="Set / update limit"/> |
| 87 | + </form> |
| 88 | + </div> |
| 89 | +</div> |
| 90 | + |
| 91 | +<div class="section"> |
| 92 | + <h2>User Limits</h2> |
| 93 | + <div class="hider"> |
| 94 | + <div class="updatable"> |
| 95 | + |
| 96 | + <% if (user_limits.length > 0) { %> |
| 97 | + <table class="list"> |
| 98 | + <thead> |
| 99 | + <tr> |
| 100 | + <th>User</th> |
| 101 | + <th>Limit</th> |
| 102 | + <th>Value</th> |
| 103 | + <th class="administrator-only"></th> |
| 104 | + </tr> |
| 105 | + </thead> |
| 106 | + <tbody> |
| 107 | + <% for (var i = 0; i < user_limits.length; i++) { |
| 108 | + var user_limit = user_limits[i]; |
| 109 | + var user_limit_values = Object.keys(user_limit.value).sort().map( |
| 110 | + function(k) { return {name: k, value: user_limit.value[k]};}); |
| 111 | + %> |
| 112 | +
|
| 113 | + <% for (var j = 0; j < user_limit_values.length; j++) { |
| 114 | + var user_limit_value = user_limit_values[j]; |
| 115 | + %> |
| 116 | +
|
| 117 | + <tr<%= alt_rows(j+1)%>> |
| 118 | + <% if(j == 0) { %> |
| 119 | + <td rowspan="<%= user_limit_values.length %>"> <%= fmt_string(user_limit.user) %> </td> |
| 120 | + <% } %> |
| 121 | + <td><%= user_limit_value.name %></td> |
| 122 | + <td><%= user_limit_value.value %></td> |
| 123 | + <td class="administrator-only"> |
| 124 | + <form action="#/user-limits" method="delete" class="confirm"> |
| 125 | + <input type="hidden" name="name" value="<%= fmt_string(user_limit_value.name) %>"/> |
| 126 | + <input type="hidden" name="user" value="<%= fmt_string(user_limit.user) %>"/> |
| 127 | + <input type="submit" value="Clear"/> |
| 128 | + </form> |
| 129 | + </td> |
| 130 | + </tr> |
| 131 | + <% } %> |
| 132 | + <% } %> |
| 133 | + </tbody> |
| 134 | + </table> |
| 135 | + <% } %> |
| 136 | + </div> |
| 137 | + </div> |
| 138 | +</div> |
| 139 | + |
| 140 | +<div class="section administrator-only"> |
| 141 | + <h2>Set / update a user limit</h2> |
| 142 | + <div class="hider"> |
| 143 | + <form action="#/user-limits" method="put"> |
| 144 | + <table class="form"> |
| 145 | + <tr> |
| 146 | + <th><label>User:</label></th> |
| 147 | + <td> |
| 148 | + <select name="user"> |
| 149 | + <% for (var i = 0; i < users.length; i++) { %> |
| 150 | + <option value="<%= fmt_string(users[i].name) %>"> |
| 151 | + <%= fmt_string(users[i].name) %> |
| 152 | + </option> |
| 153 | + <% } %> |
| 154 | + </select> |
| 155 | + </td> |
| 156 | + </tr> |
| 157 | + <tr> |
| 158 | + <th><label>Limit:</label></th> |
| 159 | + <td> |
| 160 | + <select name="name"> |
| 161 | + <option value="max-connections">max-connections</option> |
| 162 | + <option value="max-channels">max-channels</option> |
| 163 | + </select> |
| 164 | + </td> |
| 165 | + </tr> |
| 166 | + <tr> |
| 167 | + <th><label>Value:</label></th> |
| 168 | + <td> |
| 169 | + <input type="text" name="value"/> |
| 170 | + <span class="mand">*</span> |
| 171 | + </td> |
| 172 | + </tr> |
| 173 | + </table> |
| 174 | + <input type="submit" value="Set / update limit"/> |
| 175 | + </form> |
| 176 | + </div> |
| 177 | +</div> |
0 commit comments