From d3972b659a60d5473f324c8f6f19b49a35cf5c6f Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Tue, 30 Oct 2018 09:55:31 +0700 Subject: [PATCH] Add record helper for TXT type. #380 --- app/templates/domain.html | 16 ++++++++++++++++ app/views.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/templates/domain.html b/app/templates/domain.html index 07a6082..b82808b 100644 --- a/app/templates/domain.html +++ b/app/templates/domain.html @@ -412,6 +412,22 @@ modal.modal('hide'); }) modal.modal('show'); + } else if (record_type == "TXT") { + var txt_data = record_data.val().replace(/"/g, '"'); + var modal = $("#modal_custom_record"); + var form = " \ + \ + "; + modal.find('.modal-body p').html(form); + modal.find('#button_save').click(function() { + data = modal.find('#txt_record').val(); + if (! /^".*"$/.test(data)) { + data = '"' + data + '"'; + } + record_data.val(data); + modal.modal('hide'); + }) + modal.modal('show'); } }); {% endif %} diff --git a/app/views.py b/app/views.py index 83a62ab..0d73c9e 100644 --- a/app/views.py +++ b/app/views.py @@ -600,7 +600,7 @@ def dashboard_domains_updater(): return jsonify(response_data) -@app.route('/domain/', methods=['GET', 'POST']) +@app.route('/domain/', methods=['GET']) @login_required @can_access_domain def domain(domain_name):