Feature(Protocol): UDP Implemented
- updated controllers - templates to accommodate tcp or udp - English localization labelpull/834/head
parent
31058ba18b
commit
8b990bfa56
|
@ -182,6 +182,7 @@ $sm_lang = array(
|
|||
'fieldset_permissions' => 'Permissions',
|
||||
'permissions' => 'Server will be visible for the following users',
|
||||
'port' => 'Port',
|
||||
'protocol' => 'Protocol',
|
||||
'custom_port' => 'Custom Port',
|
||||
'popular_ports' => 'Popular Ports',
|
||||
'request_method' => 'Request method',
|
||||
|
|
|
@ -61,6 +61,7 @@ abstract class AbstractServerController extends AbstractController
|
|||
`s`.`server_id`,
|
||||
`s`.`ip`,
|
||||
`s`.`port`,
|
||||
`s`.`protocol`,
|
||||
`s`.`request_method`,
|
||||
`s`.`post_field`,
|
||||
`s`.`type`,
|
||||
|
@ -111,6 +112,7 @@ abstract class AbstractServerController extends AbstractController
|
|||
*/
|
||||
protected function formatServer($server)
|
||||
{
|
||||
$server['protocol'] = strtoupper($server['protocol']);
|
||||
$server['rtime'] = round((float) $server['rtime'], 4);
|
||||
$server['last_online'] = psm_timespan($server['last_online']);
|
||||
$server['last_offline'] = psm_timespan($server['last_offline']);
|
||||
|
|
|
@ -195,6 +195,7 @@ class ServerController extends AbstractServerController
|
|||
'edit_value_label' => $edit_server['label'],
|
||||
'edit_value_ip' => $edit_server['ip'],
|
||||
'edit_value_port' => $edit_server['port'],
|
||||
'edit_value_protocol' => $edit_server['protocol'],
|
||||
'edit_value_request_method' => $edit_server['request_method'],
|
||||
'edit_value_post_field' => $edit_server['post_field'],
|
||||
'edit_value_timeout' => $edit_server['timeout'],
|
||||
|
@ -269,6 +270,8 @@ class ServerController extends AbstractServerController
|
|||
'website_username' => psm_POST('website_username'),
|
||||
'website_password' => $encrypted_password,
|
||||
'port' => intval(psm_POST('port', 0)),
|
||||
'protocol' => in_array($_POST['protocol'], array('tcp', 'udp')) ?
|
||||
$_POST['protocol'] : 'tcp',
|
||||
'request_method' => empty(psm_POST('request_method')) ? null : psm_POST('request_method'),
|
||||
'post_field' => empty(psm_POST('post_field')) ? null : psm_POST('post_field'),
|
||||
'type' => psm_POST('type', ''),
|
||||
|
@ -514,6 +517,7 @@ class ServerController extends AbstractServerController
|
|||
'label_fieldset_permissions' => psm_get_lang('servers', 'fieldset_permissions'),
|
||||
'label_permissions' => psm_get_lang('servers', 'permissions'),
|
||||
'label_port' => psm_get_lang('servers', 'port'),
|
||||
'label_protocol' => psm_get_lang('servers', 'protocol'),
|
||||
'label_custom_port' => psm_get_lang('servers', 'custom_port'),
|
||||
'label_popular_ports' => psm_get_lang('servers', 'popular_ports'),
|
||||
'label_request_method' => psm_get_lang('servers', 'request_method'),
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<th scope="col">{{ label_label }}</th>
|
||||
<th scope="col">{{ label_domain }}</th>
|
||||
<th scope="col">{{ label_port }}</th>
|
||||
<th scope="col">{{ label_protocol }}</th>
|
||||
<th scope="col">{{ label_type }}</th>
|
||||
<th scope="col">{{ label_rtime }}</th>
|
||||
<th scope="col">{{ label_last_online }}</th>
|
||||
|
@ -40,6 +41,7 @@
|
|||
</th>
|
||||
<td><div class="content">{{ server.ip|raw }}</div></td>
|
||||
<td>{{ server.port }}</td>
|
||||
<td>{{ server.protocol }}</td>
|
||||
<td>{{ server.type }}</td>
|
||||
<td>{{ server.rtime }}</td>
|
||||
<td><div class="content">{{ server.last_online }}</div></td>
|
||||
|
|
|
@ -45,6 +45,15 @@
|
|||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Protocol -->
|
||||
<div class="form-group types typeService">
|
||||
<label for="protocol">{{ label_protocol }}</label>
|
||||
<select id="protocol" name="protocol" class="custom-select">
|
||||
<option {% if not edit_value_protocol %}selected {% endif %} disabled>{{ label_please_select }}</option>
|
||||
<option {% if edit_value_protocol|lower=='tcp' %}selected {% endif %}value="tcp">TCP</option>
|
||||
<option {% if edit_value_protocol|lower=='udp' %}selected {% endif %}value="udp">UDP</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Custom port -->
|
||||
{{ macro.input_field("number", "port", "port types typeService", "port", label_custom_port, edit_value_port, null, "5") }}
|
||||
<!-- Request method -->
|
||||
|
|
|
@ -37,6 +37,12 @@
|
|||
<dd class="col-md-8">{{ port }}</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<dl class="row">
|
||||
<dt class="col-md-4">{{ label_protocol }}:</dt>
|
||||
<dd class="col-md-8">{{ protocol }}</dd>
|
||||
</dl>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="list-group-item">
|
||||
<dl class="row">
|
||||
|
|
Loading…
Reference in New Issue