From 102e1ca97ca38f481f31044f7b6fd8ed500fb84e Mon Sep 17 00:00:00 2001 From: BaiJiangjie Date: Tue, 24 Apr 2018 18:29:14 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E5=88=9B=E5=BB=BA=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=EF=BC=8C=E8=B5=84=E4=BA=A7=E7=B3=BB=E7=BB=9F=E7=BD=AE=E4=B8=8A?= =?UTF-8?q?=EF=BC=8CRDP:3389?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/templates/assets/asset_create.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/assets/templates/assets/asset_create.html b/apps/assets/templates/assets/asset_create.html index eca0f6a03..99703d2e3 100644 --- a/apps/assets/templates/assets/asset_create.html +++ b/apps/assets/templates/assets/asset_create.html @@ -15,9 +15,9 @@ {% csrf_token %}

{% trans 'Basic' %}

{% bootstrap_field form.hostname layout="horizontal" %} + {% bootstrap_field form.platform layout="horizontal" %} {% bootstrap_field form.ip layout="horizontal" %} {% bootstrap_field form.port layout="horizontal" %} - {% bootstrap_field form.platform layout="horizontal" %} {% bootstrap_field form.public_ip layout="horizontal" %} {% bootstrap_field form.domain layout="horizontal" %} @@ -85,6 +85,17 @@ $(document).ready(function () { allowClear: true, templateSelection: format }); + $("#id_platform").change(function (){ + var platform = $("#id_platform option:selected").text(); + var port = 22; + if(platform === 'Windows'){ + port = 3389; + } + if(platform === 'Other'){ + port = null; + } + $("#id_port").val(port); + }); }) {% endblock %} \ No newline at end of file