File size: 8,700 Bytes
62aa71b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Data Connectors</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <!-- Include AdminLTE CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/css/adminlte.min.css">
    <!-- Include DataTables CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">

    <style>

        html, body {

            height: 90%;

            margin: 0;

            display: flex;

            flex-direction: column;

        }

        body {

            display: flex;

            flex-direction: column;

        }

        .main-content {

            flex: 1;

            display: flex;

            flex-direction: column;

            align-items: center;

            justify-content: flex-start;

            padding: 20px;

        }

        .container {

            margin-top: 50px;

            max-width: 600px;

            padding: 40px;

            border: 1px solid #ccc;

            border-radius: 5px;

            //background-color: #fff;

            position: relative;

            z-index: 1;

        }

        .form-group {

            margin-bottom: 20px;

        }

        .form-group label {

            font-weight: bold;

            margin-top: 10px;

            margin-bottom: 5px;

            display: block;

        }

        .form-group input, .form-group select, .form-group textarea {

            width: 100%;

            height: auto;

            padding: 10px;

            border: 1px solid #ccc;

            border-radius: 4px;

        }

        .btn-primary {

            margin-right: 10px;

            color: black;

            font-size: 16px;

            font-weight: bold;

        }

        h2 {

            text-align: center;

            margin-bottom: 30px;

        }

        .btn-container {

            text-align: center;

            margin-top: 30px;

           // margin-bottom: 20px;

            color: white;

        }

        #selectedTables ,#labelselected {

            display: none;

        }

        #saveBtn1{

            display: none;

            margin: 0 auto;

        }

        footer {

            position: relative;

            bottom: 0;

            width: 100%;

            color: black;

            text-align: right;

            padding-right: 245px;

            padding-top: 10px;

            background-color: #f8f9fa;

            border-top: 1px solid #ccc;

        }

    </style>
</head>
<body>
    {% include 'sidepane.html' %}
    <div class="container mt-2">
        <h2>Data Connectors</h2>
        <form id="companyProfileForm" class="needs-validation" novalidate>
            <div class="form-group">
                <label for="database">Database</label>
                <select type="text" id="database" name="database" class="form-control">
                    <option value="" selected>Select</option>
                    <option value="Postgress">Postgress</option>
                    <option value="mysql">Mysql</option>
                </select>
            </div>

            <div class="form-group">
                <label for="server">Server IP</label>
                <input type="text" id="server" name="server" class="form-control">
            </div>
            <div class="form-group">
                <label for="port">Port</label>
                <input type="text" id="port" name="port" class="form-control">
            </div>
            <div class="form-group">
                <label for="databaseName">Database Name</label>
                <select type="text" id="databaseName" name="databaseName" class="form-control">
                    <option value="" selected>Select</option>
                    <option value="Warehouse">Warehouse</option>
                </select>
            </div>
            <div class="form-group">
                <label for="username">UserName</label>
                <input type="text" id="username" name="username" class="form-control">
            </div>
            <div class="form-group">
                <label for="password">Password</label>
                <input type="text" id="password" name="password" class="form-control">
            </div>
            <div class="btn-container">
                <button type="button" id="connectBtn" class="btn btn-primary">Connect</button>
                <button type="reset" class="btn btn-primary">Clear</button>
            </div>
            <div id="schema-table-section" style="display: none;">
                <div class="form-group">
                    <div class="row">
                        <div class="col">
                            <label for="schemas">Available Schemas</label>
                            <select type="text" id="schemas" name="schemas" class="form-control">
                                <option value="" selected>Select</option>
                                <option value="schema1">Lookup</option>
                                <option value="schema2">Public</option>
                                <option value="schema3">Tenant_default</option>
                            </select>
                        </div>
                        <div class="col">
                            <label for="tables">Available Tables</label>
                            <select type="text" id="tables" name="tables" class="form-control" multiple>
                                <option value="" selected>Select</option>
                                <option value="customer_master">customer_master</option>
                                <option value="efs_company_master">efs_company_master</option>
                                <option value="efs_group_company_master">efs_group_company_master</option>
                                <option value="efs_region_master">efs_region_master</option>
                                <option value="party_address_detail">party_address_detail</option>
                                <option value="wms_warehouse_master">wms_warehouse_master</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label id="labelselected" for="selectedTables">Selected Tables</label>
                    <textarea id="selectedTables" class="form-control" rows="5" readonly></textarea>
                </div>
            </div>
            <div class="mt-5" id="table-container">
                <!-- Table will be dynamically inserted here -->
            </div>
            <div class="btn-container">
                <button type="button" id="saveBtn1" class="btn btn-primary">Save</button>
            </div>
        </form>
    </div>
    <footer>
        {% include 'footer.html' %}
    </footer>
    <!-- Bootstrap JS (Optional, if you need JavaScript functionality) -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/admin-lte@3.1/dist/js/adminlte.min.js"></script>

    <script>

        $(document).ready(function() {

            $('#connectBtn').on('click', function(event) {

                event.preventDefault();

                alert('Connected!');

                $('#schema-table-section').show();

                $('#saveBtn1').show();

            });



            // Handle Save button click

            $('#saveBtn1').on('click', function(event) {

                event.preventDefault();

                const selectedTables = $('#tables').val();

                if (selectedTables.length > 0) {

                    // Show the textarea and populate with selected tables

                    $('#selectedTables').empty();

                    selectedTables.forEach(table => {

                        $('#selectedTables').append(table + '\n');

                    });

                    $('#selectedTables').show();

                    $('#labelselected').show();



                    alert('Data saved successfully!');

                } else {

                    alert('Please select at least one table.');

                }

            });

        });

    </script>

</body>

</html>