From 40022899743152448d7d271ff038e5f3b904b7d9 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 3 Jul 2018 13:23:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=B8=AD=E5=88=A0=E9=99=A4=E6=97=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/templates/users/user_detail.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/templates/users/user_detail.html b/apps/users/templates/users/user_detail.html index 22ab4b5d4..d40251563 100644 --- a/apps/users/templates/users/user_detail.html +++ b/apps/users/templates/users/user_detail.html @@ -421,8 +421,8 @@ $(document).ready(function() { APIUpdateAttr({ url: the_url, body: JSON.stringify(body), success: success, error: fail}); }).on('click', '.btn-delete-user', function () { var $this = $(this); - var name = "{{ user.name }}"; - var uid = "{{ user.id }}"; + var name = "{{ user_object.name }}"; + var uid = "{{ user_object.id }}"; var the_url = '{% url "api-users:user-detail" pk=DEFAULT_PK %}'.replace('{{ DEFAULT_PK }}', uid); var redirect_url = "{% url 'users:user-list' %}"; objectDelete($this, name, the_url, redirect_url); From f8c2a445f7b65db5d130f781400d74e5c5415f2c Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 5 Jul 2018 10:26:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E6=94=B9gateway=20port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/assets/utils.py b/apps/assets/utils.py index cc4942ade..f841e4a79 100644 --- a/apps/assets/utils.py +++ b/apps/assets/utils.py @@ -54,7 +54,8 @@ def test_gateway_connectability(gateway): proxy.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: - proxy.connect(gateway.ip, username=gateway.username, + proxy.connect(gateway.ip, gateway.port, + username=gateway.username, password=gateway.password, pkey=gateway.private_key_obj) except(paramiko.AuthenticationException, From 37bb344166f8fe77212772de965aeff170dfc8a3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 5 Jul 2018 10:58:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E7=AB=AF=E5=8F=A3=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/templates/assets/gateway_create_update.html | 4 ++-- apps/assets/views/domain.py | 5 ----- utils/make_migrations.sh | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/assets/templates/assets/gateway_create_update.html b/apps/assets/templates/assets/gateway_create_update.html index e0b10ba73..7c1bf14b2 100644 --- a/apps/assets/templates/assets/gateway_create_update.html +++ b/apps/assets/templates/assets/gateway_create_update.html @@ -75,10 +75,10 @@ var port = '#' + '{{ form.port.id_for_label }}'; function protocolChange() { if ($(protocol_id + " option:selected").text() === 'rdp') { - $(port).val(3389); + {#$(port).val(3389);#} $(private_key_id).closest('.form-group').addClass('hidden') } else { - $(port).val(22); + {#$(port).val(22);#} $(private_key_id).closest('.form-group').removeClass('hidden') } } diff --git a/apps/assets/views/domain.py b/apps/assets/views/domain.py index e6a353373..be6528219 100644 --- a/apps/assets/views/domain.py +++ b/apps/assets/views/domain.py @@ -140,11 +140,6 @@ class DomainGatewayUpdateView(AdminUserRequiredMixin, UpdateView): domain = self.object.domain return reverse('assets:domain-gateway-list', kwargs={"pk": domain.id}) - def form_valid(self, form): - response = super().form_valid(form) - print(form.cleaned_data) - return response - def get_context_data(self, **kwargs): context = { 'app': _('Assets'), diff --git a/utils/make_migrations.sh b/utils/make_migrations.sh index b6068a1ca..fbe3e577c 100755 --- a/utils/make_migrations.sh +++ b/utils/make_migrations.sh @@ -5,4 +5,4 @@ python3 ../apps/manage.py makemigrations python3 ../apps/manage.py migrate -python3 ../apps/manage.py makemigrations –merge +python3 ../apps/manage.py makemigrations –-merge