{% extends 'components/base_nhncloud.html' %}
{% load static %}
{% block main_area %}
    <section>
        <div class="row">
            <div class="mt-5 col-12 text-center">NKS Cluster Information</div>
        </div>
        <br>
        <div class="row">
            
            <div class="col-lg-4"></div>
            <div class="col-lg-4">
                <form method="post" action="{% url 'nhncloud:infoClusterList' %}">{% csrf_token %}
                    <div class="mb-3">
                        <div class="row">
                            <div class="col-md-4 form-group">
                                <label for="region">Region</label>
                            </div>
                            <div class="col-md-8">
                                <select class="form-control" name="region" id="region" onchange="selectRegion(this.value);">
                                    <option value="select...">select...</option>
                                    <option value="kr1">판교</option>
                                    <option value="kr2">평촌</option>
                                </select>                                
                            </div>
                        </div>        
                    </div>
                    <div class="mb-3">
                        <div class="row">
                            <div class="col-md-4">
                                <label for="tenantId">Tenant ID</label>
                            </div>
                            <div class="col-md-8">
                                <input type="password" class="form-control" name="tenantId" id="tenantId">
                            </div>
                        </div>
                    </div>
                    <div class="mb-3">
                        <div class="row">
                            <div class="col-md-4">
                                <label for="usrEmail">User Email</label>
                            </div>
                            <div class="col-md-8">
                                <input type="text" class="form-control" name="usrEmail" id="usrEmail" value="{{ user.nhnc_id }}">
                            </div>
                        </div>
                    </div>
                    <div class="mb-3">
                        <div class="row">
                            <div class="col-md-4">
                                <label for="apiPw">API Password</label>
                            </div>
                            <div class="col-md-8">
                                <input type="password" class="form-control" name="apiPw" id="apiPw">
                            </div>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-info float-right">Request</button>
                </form>
            </div>
            <div class="col-lg-4"></div>
        </div>
    </section>
    <script>
        function selectRegion(){
            let selectRegionValue = document.getElementById('region').value;
            console.log(selectRegionValue);
            document.getElementById('tenantId').value = "{{ user.nhnc_api_tenant_id }}";
        }
    </script>
    <script>
        function createClickMsg(){
            alert('Cluster 상태가 조회됩니다.');
        }
    </script>
    {% endblock %}