-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFastTransfer_Wizard.html
More file actions
840 lines (751 loc) · 33.3 KB
/
FastTransfer_Wizard.html
File metadata and controls
840 lines (751 loc) · 33.3 KB
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>FastTransfer Command Line Wizard</title>
<!-- Link to external CSS -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>FastTransfer Command Line Wizard</h1>
<h2>Set parameters and collect the built command line at the bottom of the page</h2>
<!-- Platform (Windows or Linux) -->
<label for="platform">Platform:</label>
<select id="platform" onchange="updateCommand()">
<option value="windows">Windows (FastTransfer.exe)</option>
<option value="linux">Linux (FastTransfer)</option>
</select>
<!-- =================== SOURCE SECTION =================== -->
<div class="section">
<h2>Source Configuration</h2>
<table>
<thead>
<tr>
<th>Short Description</th>
<th>Value</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<!-- sourceconnectiontype -->
<tr>
<td>Source Conn. Type</td>
<td>
<select id="sourceconnectiontype" onchange="onSourceTypeChange(); updateCommand()">
<option value="">-- choose --</option>
<option value="clickhouse">clickhouse</option>
<option value="duckdb">duckdb</option>
<option value="duckdbstream">duckdbstream</option>
<option value="hana">hana</option>
<option value="mssql">mssql</option>
<option value="msoledbsql">msoledbsql</option>
<option value="mysql">mysql</option>
<option value="nzoledb">nzoledb</option>
<option value="nzsql">nzsql</option>
<option value="odbc">odbc</option>
<option value="oledb">oledb</option>
<option value="oraodp">oraodp</option>
<option value="pgcopy">pgcopy</option>
<option value="pgsql">pgsql</option>
<option value="teradata">teradata</option>
</select>
</td>
<td>--sourceconnectiontype</td>
<td>[none]</td>
</tr>
<!-- sourceconnectstring vs (sourcedsn, sourceprovider, sourceserver, sourceuser, sourcepassword, sourcetrusted) -->
<tr id="tr-sourceconnectstring">
<td>Source Connect String</td>
<td><input type="text" id="sourceconnectstring" oninput="onSourceConnectstringChange(); updateCommand()"></td>
<td>--sourceconnectstring</td>
<td>[none]</td>
</tr>
<!-- sourcedsn (only if not using sourceconnectstring) -->
<tr id="tr-sourcedsn">
<td>ODBC DSN</td>
<td><input type="text" id="sourcedsn" oninput="updateCommand()"></td>
<td>--sourcedsn</td>
<td>[none]</td>
</tr>
<!-- sourceprovider (only if not using sourceconnectstring nor sourcedsn) -->
<tr id="tr-sourceprovider">
<td>OleDB Provider</td>
<td><input type="text" id="sourceprovider" oninput="updateCommand()"></td>
<td>--sourceprovider</td>
<td>[none]</td>
</tr>
<!-- sourceserver (only if not using sourceconnectstring nor sourcedsn) -->
<tr id="tr-sourceserver">
<td>Source Server</td>
<td><input type="text" id="sourceserver" oninput="updateCommand()"></td>
<td>--sourceserver</td>
<td>[none]</td>
</tr>
<!-- sourcetrusted vs (sourceuser, sourcepassword) -->
<tr id="tr-sourcetrusted">
<td>Source Trusted Auth?</td>
<td><input type="checkbox" id="sourcetrusted" onchange="onSourceTrustedChange(); updateCommand()"></td>
<td>--sourcetrusted</td>
<td>false</td>
</tr>
<tr id="tr-sourceuser">
<td>Source User</td>
<td><input type="text" id="sourceuser" oninput="updateCommand()"></td>
<td>--sourceuser</td>
<td>[none]</td>
</tr>
<tr id="tr-sourcepassword">
<td>Source Password</td>
<td><input type="text" id="sourcepassword" oninput="updateCommand()"></td>
<td>--sourcepassword</td>
<td>[none]</td>
</tr>
<!-- sourcedatabase -->
<tr id="tr-sourcedatabase">
<td>Source Database</td>
<td><input type="text" id="sourcedatabase" oninput="updateCommand()"></td>
<td>--sourcedatabase</td>
<td>[none]</td>
</tr>
</tbody>
</table>
</div>
<!-- =================== SOURCE QUERY/TABLE SECTION =================== -->
<div class="section">
<h2>Source Query / Table</h2>
<table>
<thead>
<tr>
<th>Short Description</th>
<th>Value</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<!-- sourceschema -->
<tr id="tr-sourceschema">
<td>Source Schema</td>
<td><input type="text" id="sourceschema" oninput="updateCommand()"></td>
<td>--sourceschema</td>
<td>[none]</td>
</tr>
<!-- sourcetable -->
<tr id="tr-sourcetable">
<td>Source Table</td>
<td><input type="text" id="sourcetable" oninput="updateCommand()"></td>
<td>--sourcetable</td>
<td>[none]</td>
</tr>
<!-- query vs fileinput (one or none used) -->
<tr id="tr-query">
<td>SQL Query</td>
<td><input type="text" id="query" oninput="onQueryChange(); updateCommand()"></td>
<td>--query</td>
<td>[none]</td>
</tr>
<tr id="tr-fileinput">
<td>File Input</td>
<td><input type="text" id="fileinput" oninput="onFileInputChange(); updateCommand()"></td>
<td>--fileinput</td>
<td>[none]</td>
</tr>
</tbody>
</table>
</div>
<!-- =================== TARGET SECTION =================== -->
<div class="section">
<h2>Target Configuration</h2>
<table>
<thead>
<tr>
<th>Short Description</th>
<th>Value</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<!-- targetconnectiontype -->
<tr>
<td>Target Conn. Type</td>
<td>
<select id="targetconnectiontype" onchange="updateCommand()">
<option value="">-- choose --</option>
<option value="clickhousebulk">clickhousebulk</option>
<option value="duckdb">duckdb</option>
<option value="hanabulk">hanabulk</option>
<option value="msbulk">msbulk</option>
<option value="mysqlbulk">mysqlbulk</option>
<option value="nzbulk">nzbulk</option>
<option value="orabulk">orabulk</option>
<option value="oradirect">oradirect</option>
<option value="pgcopy">pgcopy</option>
<option value="pgsql">pgsql</option>
<option value="teradata">teradata</option>
</select>
</td>
<td>--targetconnectiontype</td>
<td>[none]</td>
</tr>
<!-- targetconnectstring vs (targetserver, targetuser, targetpassword, targettrusted) -->
<tr id="tr-targetconnectstring">
<td>Target Connect String</td>
<td><input type="text" id="targetconnectstring" oninput="onTargetConnectstringChange(); updateCommand()"></td>
<td>--targetconnectstring</td>
<td>[none]</td>
</tr>
<tr id="tr-targetserver">
<td>Target Server</td>
<td><input type="text" id="targetserver" oninput="updateCommand()"></td>
<td>--targetserver</td>
<td>[none]</td>
</tr>
<tr id="tr-targettrusted">
<td>Target Trusted Auth?</td>
<td><input type="checkbox" id="targettrusted" onchange="onTargetTrustedChange(); updateCommand()"></td>
<td>--targettrusted</td>
<td>false</td>
</tr>
<tr id="tr-targetuser">
<td>Target User</td>
<td><input type="text" id="targetuser" oninput="updateCommand()"></td>
<td>--targetuser</td>
<td>[none]</td>
</tr>
<tr id="tr-targetpassword">
<td>Target Password</td>
<td><input type="text" id="targetpassword" oninput="updateCommand()"></td>
<td>--targetpassword</td>
<td>[none]</td>
</tr>
<!-- targetdatabase -->
<tr id="tr-targetdatabase">
<td>Target Database</td>
<td><input type="text" id="targetdatabase" oninput="updateCommand()"></td>
<td>--targetdatabase</td>
<td>[none]</td>
</tr>
<!-- targetschema -->
<tr>
<td>Target Schema</td>
<td><input type="text" id="targetschema" oninput="updateCommand()"></td>
<td>--targetschema</td>
<td>[none]</td>
</tr>
<!-- targettable -->
<tr>
<td>Target Table</td>
<td><input type="text" id="targettable" oninput="updateCommand()"></td>
<td>--targettable</td>
<td>[none]</td>
</tr>
</tbody>
</table>
</div>
<!-- =================== ADVANCED / PARALLEL SECTION =================== -->
<div class="section">
<h2>Advanced / Parallel</h2>
<table>
<thead>
<tr>
<th>Short Description</th>
<th>Value</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<!-- degree -->
<tr id="tr-degree">
<td>Parallel Degree</td>
<td><input type="number" id="degree" value="-2" min="-32" max="1024" oninput="updateCommand()"></td>
<td>--degree</td>
<td>-2</td>
</tr>
<!-- method -->
<tr>
<td>Parallel method for parallelization </td>
<td>
<select id="method" onchange="onMethodChange(); updateCommand()">
<option value="None">None</option>
<option value="Ctid">Ctid (PostgreSQL Only)</option>
<option value="DataDriven">DataDriven</option>
<option value="Ntile">Ntile</option>
<option value="NZDataSlice">NZDataSlice (Netezza Only)</option>
<option value="Random">Random</option>
<option value="RangeId">RangeId</option>
<option value="Rowid">Rowid (Oracle Only)</option>
</select>
</td>
<td>--method</td>
<td>None</td>
</tr>
<!-- distributekeycolumn -->
<tr id="tr-distributekeycolumn">
<td>Distribute Key Column</td>
<td><input type="text" id="distributekeycolumn" oninput="updateCommand()"></td>
<td>--distributekeycolumn</td>
<td>[none]</td>
</tr>
<!-- datadrivenquery -->
<tr id="tr-datadrivenquery">
<td>DataDriven Query (optionnal)</td>
<td><input type="text" id="datadrivenquery" oninput="updateCommand()"></td>
<td>--datadrivenquery</td>
<td>[none]</td>
</tr>
<!-- loadmode -->
<tr>
<td>Load Mode</td>
<td>
<select id="loadmode" onchange="updateCommand()">
<option value="Append">Append</option>
<option value="Truncate">Truncate</option>
<!-- <option value="Replace">Replace</option> -->
</select>
</td>
<td>--loadmode</td>
<td>Append</td>
</tr>
<!-- mapmethod -->
<tr>
<td>Column Map Method</td>
<td>
<select id="mapmethod" onchange="updateCommand()">
<option value="Position">Position</option>
<option value="Name">Name</option>
</select>
</td>
<td>--mapmethod</td>
<td>Position</td>
</tr>
<!-- batchsize -->
<tr>
<td>Batch Size</td>
<td><input type="number" id="batchsize" value="1048576" oninput="updateCommand()"></td>
<td>--batchsize</td>
<td>1048576</td>
</tr>
<!-- useworktables -->
<tr>
<td>Use Work Tables?</td>
<td><input type="checkbox" id="useworktables" onchange="updateCommand()"></td>
<td>--useworktables</td>
<td>false</td>
</tr>
</tbody>
</table>
<!-- =================== LOGGING SECTION =================== -->
<div class="section">
<h2>Logging</h2>
<table>
<thead>
<tr>
<th>Short Description</th>
<th>Value</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<!-- runid -->
<tr>
<td>Run ID</td>
<td><input type="text" id="runid" oninput="updateCommand()"></td>
<td>--runid</td>
<td>[none]</td>
</tr>
<!-- settingsfile -->
<tr>
<td>Settings File</td>
<td><input type="text" id="settingsfile" oninput="updateCommand()"></td>
<td>--settingsfile</td>
<td>[none]</td>
</tr>
<!-- loglevel-->
<tr>
<td>Log Level</td>
<td>
<select id="loglevel" onchange="updateCommand()">
<option value="information">information</option>
<option value="debug">debug</option>
<option value="error">error</option>
<option value="warning">warning</option>
</select>
</td>
<td>--loglevel</td>
<td>information</td>
</tbody>
</table>
</div>
<!-- =================== LICENSE SECTION =================== -->
<div class="section">
<h2>License</h2>
<table>
<thead>
<tr>
<th>Short Description</th>
<th>Value</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<!-- license -->
<tr>
<td>License</td>
<td><input type="text" id="license" oninput="updateCommand()"></td>
<td>--license</td>
<td>[none] if not provided, will use FastTransfer.lic</td>
</tr>
</tbody>
</table>
</div>
<!-- =================== COMMAND OUTPUT =================== -->
<button type="button" onclick="copyCommand()">Copy Command</button>
<button type="button" onclick="updateCommand()">Refresh</button>
<pre id="result"></pre>
<script>
/* --- Show/hide logic for partial group constraints, etc. --- */
// If sourceconnectstring is used => hide DSN/provider/server/trusted
function onSourceConnectstringChange() {
const scs = document.getElementById('sourceconnectstring').value.trim();
if (scs) {
document.getElementById('tr-sourcedsn').style.display = 'none';
document.getElementById('tr-sourceprovider').style.display = 'none';
document.getElementById('tr-sourceserver').style.display = 'none';
document.getElementById('tr-sourcetrusted').style.display = 'none';
document.getElementById('tr-sourceuser').style.display = 'none';
document.getElementById('tr-sourcepassword').style.display = 'none';
document.getElementById('tr-sourcedatabase').style.display = 'none';
} else {
// Show them again
document.getElementById('tr-sourcedsn').style.display = 'table-row';
document.getElementById('tr-sourceprovider').style.display = 'table-row';
document.getElementById('tr-sourceserver').style.display = 'table-row';
document.getElementById('tr-sourcetrusted').style.display = 'table-row';
document.getElementById('tr-sourcedatabase').style.display = 'table-row';
// And we must check if trusted is toggled
onSourceTrustedChange();
}
}
// If sourcetrusted => hide user/password
function onSourceTrustedChange() {
const trusted = document.getElementById('sourcetrusted').checked;
if (trusted) {
document.getElementById('tr-sourceuser').style.display = 'none';
document.getElementById('tr-sourcepassword').style.display = 'none';
} else {
document.getElementById('tr-sourceuser').style.display = 'table-row';
document.getElementById('tr-sourcepassword').style.display = 'table-row';
}
}
// If query => hide fileinput (group f,q)
function onQueryChange() {
const q = document.getElementById('query').value.trim();
if (q) {
document.getElementById('fileinput').value = "";
// maybe hide the row or just clear?
}
}
// If fileinput => clear query
function onFileInputChange() {
const f = document.getElementById('fileinput').value.trim();
if (f) {
document.getElementById('query').value = "";
// similarly, could hide the query row, etc.
}
}
// If targetconnectstring => hide targetserver, targettrusted, targetuser, targetpassword
function onTargetConnectstringChange() {
const tcs = document.getElementById('targetconnectstring').value.trim();
if (tcs) {
document.getElementById('tr-targetserver').style.display = 'none';
document.getElementById('tr-targettrusted').style.display = 'none';
document.getElementById('tr-targetuser').style.display = 'none';
document.getElementById('tr-targetpassword').style.display = 'none';
document.getElementById('tr-targetdatabase').style.display = 'none';
} else {
document.getElementById('tr-targetserver').style.display = 'table-row';
document.getElementById('tr-targettrusted').style.display = 'table-row';
document.getElementById('tr-targetuser').style.display = 'table-row';
document.getElementById('tr-targetpassword').style.display = 'table-row';
document.getElementById('tr-targetdatabase').style.display = 'table-row';
onTargetTrustedChange();
}
}
// If targettrusted => hide user/password
function onTargetTrustedChange() {
const ttrusted = document.getElementById('targettrusted').checked;
if (ttrusted) {
document.getElementById('tr-targetuser').style.display = 'none';
document.getElementById('tr-targetpassword').style.display = 'none';
} else {
document.getElementById('tr-targetuser').style.display = 'table-row';
document.getElementById('tr-targetpassword').style.display = 'table-row';
}
}
// If method=DataDriven => show datadrivenquery, if method=Random => show distributekeycolumn, etc.
function onMethodChange() {
const method = document.getElementById('method').value;
// if method = None ==> cleanup parallel options
if (method === 'None') {
// Hide distributekeycolumn
document.getElementById('distributekeycolumn').value = "";
document.getElementById('tr-distributekeycolumn').style.display = 'none';
// Hide datadrivenquery
document.getElementById('datadrivenquery').value = "";
document.getElementById('tr-datadrivenquery').style.display = 'none';
// Hide degree
document.getElementById('degree').value = "";
}
else {
// Show degree
document.getElementById('tr-degree').style.display = 'table-row';
document.getElementById('degree').value = "-2";
// If DataDriven => show datadrivenquery, else hide
if (method === 'DataDriven') {
document.getElementById('tr-datadrivenquery').style.display = 'table-row';
} else {
document.getElementById('datadrivenquery').value = "";
document.getElementById('tr-datadrivenquery').style.display = 'none';
}
// Example: if method=Random => you might want to highlight distributekeycolumn
// We'll keep it always visible except for demonstration below:
if (method === 'Ctid' || method === 'Rowid' || method === 'NZDataSlice') {
// maybe hide distributekeycolumn
document.getElementById('distributekeycolumn').value = "";
document.getElementById('tr-distributekeycolumn').style.display = 'none';
} else {
document.getElementById('tr-distributekeycolumn').style.display = 'table-row';
}
}
updateCommand();
}
/* --- Build the final command line --- */
function updateCommand() {
const platform = document.getElementById('platform').value;
let baseCmd = (platform === 'windows') ? '.\\FastTransfer.exe' : './FastTransfer';
let args = [];
// --sourceconnectiontype
const sctype = document.getElementById('sourceconnectiontype').value.trim();
if (sctype) {
args.push(` --sourceconnectiontype "${sctype}"`);
}
// --sourceconnectstring
const scs = document.getElementById('sourceconnectstring').value.trim();
if (scs) {
args.push(` --sourceconnectstring "${scs}"`);
} else {
// if no connectstring, gather DSN/provider/server/trusted/user/password
const dsn = document.getElementById('sourcedsn').value.trim();
if (dsn) {
args.push(` --sourcedsn "${dsn}"`);
}
const sprv = document.getElementById('sourceprovider').value.trim();
if (sprv) {
args.push(` --sourceprovider "${sprv}"`);
}
const ssvr = document.getElementById('sourceserver').value.trim();
if (ssvr) {
args.push(` --sourceserver "${ssvr}"`);
}
const strusted = document.getElementById('sourcetrusted').checked;
if (strusted) {
args.push(` --sourcetrusted`);
} else {
const suser = document.getElementById('sourceuser').value.trim();
if (suser) {
args.push(` --sourceuser "${suser}"`);
}
const spass = document.getElementById('sourcepassword').value.trim();
if (spass) {
args.push(` --sourcepassword "${spass}"`);
}
}
}
// --sourcedatabase
const sdb = document.getElementById('sourcedatabase').value.trim();
if (sdb) {
args.push(` --sourcedatabase "${sdb}"`);
}
// --sourceschema
const ssch = document.getElementById('sourceschema').value.trim();
if (ssch) {
args.push(` --sourceschema "${ssch}"`);
}
// --sourcetable
const stab = document.getElementById('sourcetable').value.trim();
if (stab) {
args.push(` --sourcetable "${stab}"`);
}
// query vs fileinput
const q = document.getElementById('query').value.trim();
const f = document.getElementById('fileinput').value.trim();
if (q) {
args.push(` --query "${q}"`);
} else if (f) {
args.push(` --fileinput "${f}"`);
}
// targetconnectiontype
const tctype = document.getElementById('targetconnectiontype').value.trim();
if (tctype) {
args.push(` --targetconnectiontype "${tctype}"`);
}
// targetconnectstring
const tcs = document.getElementById('targetconnectstring').value.trim();
if (tcs) {
args.push(` --targetconnectstring "${tcs}"`);
} else {
// gather targetserver / trusted / user / password
const tsvr = document.getElementById('targetserver').value.trim();
if (tsvr) {
args.push(` --targetserver "${tsvr}"`);
}
const ttrusted = document.getElementById('targettrusted').checked;
if (ttrusted) {
args.push(` --targettrusted`);
} else {
const tuser = document.getElementById('targetuser').value.trim();
if (tuser) {
args.push(` --targetuser "${tuser}"`);
}
const tpass = document.getElementById('targetpassword').value.trim();
if (tpass) {
args.push(` --targetpassword "${tpass}"`);
}
}
}
// targetdatabase
const tdb = document.getElementById('targetdatabase').value.trim();
if (tdb) {
args.push(` --targetdatabase "${tdb}"`);
}
// targetschema
const tsch = document.getElementById('targetschema').value.trim();
if (tsch) {
args.push(` --targetschema "${tsch}"`);
}
// targettable
const ttab = document.getElementById('targettable').value.trim();
if (ttab) {
args.push(` --targettable "${ttab}"`);
}
// degree
const degree = document.getElementById('degree').value;
if (degree) {
args.push(` --degree ${degree}`);
}
// method
const method = document.getElementById('method').value;
if (method) {
args.push(` --method "${method}"`);
}
// distributekeycolumn (only if row is visible, or always?)
if (document.getElementById('tr-distributekeycolumn').style.display !== 'none') {
const dk = document.getElementById('distributekeycolumn').value.trim();
if (dk) {
args.push(` --distributekeycolumn "${dk}"`);
}
}
// datadrivenquery (only if displayed)
if (document.getElementById('tr-datadrivenquery').style.display !== 'none') {
const ddq = document.getElementById('datadrivenquery').value.trim();
if (ddq) {
args.push(` --datadrivenquery "${ddq}"`);
}
}
// loadmode
const loadmode = document.getElementById('loadmode').value;
if (loadmode) {
args.push(` --loadmode "${loadmode}"`);
}
// mapmethod
const mapmethod = document.getElementById('mapmethod').value;
if (mapmethod) {
args.push(` --mapmethod "${mapmethod}"`);
}
// batchsize
const batchsize = document.getElementById('batchsize').value.trim();
if (batchsize) {
args.push(` --batchsize ${batchsize}`);
}
// useworktables
const usework = document.getElementById('useworktables').checked;
if (usework) {
args.push(` --useworktables`);
}
// runid
const runid = document.getElementById('runid').value.trim();
if (runid) {
args.push(` --runid "${runid}"`);
}
// settingsfile
const sfile = document.getElementById('settingsfile').value.trim();
if (sfile) {
args.push(` --settingsfile "${sfile}"`);
}
//loglevel
const loglevel = document.getElementById('loglevel').value;
if (loglevel && loglevel !== 'information') { // only add if not default
args.push(` --loglevel "${loglevel}"`);
}
// license
const license = document.getElementById('license').value.trim();
if (license) {
args.push(` --license "${license}"`);
}
// Build final command
let cmd = baseCmd;
if (args.length > 0) {
cmd += " " + args.join(" ");
}
// Display
document.getElementById('result').textContent = cmd;
}
/* Copy to clipboard */
function copyCommand() {
const cmd = document.getElementById('result').textContent;
navigator.clipboard.writeText(cmd)
.then(() => alert('Command copied!'))
.catch(() => alert('Unable to copy.'));
}
/* On page load, init display states */
function initDisplayStates() {
// Hide optional rows as needed
document.getElementById('tr-datadrivenquery').style.display = 'none';
// By default, hide distributekeycolumn
document.getElementById('tr-distributekeycolumn').style.display = 'none';
// By default hide degree
document.getElementById('tr-degree').style.display = 'none';
document.getElementById('degree').value = "";
document.getElementById('tr-sourcedsn').style.display = 'none';
document.getElementById('tr-sourceprovider').style.display = 'none';
}
function onSourceTypeChange() {
const sctype = document.getElementById('sourceconnectiontype').value.trim();
if (sctype === 'odbc') {
document.getElementById('tr-sourcedsn').style.display = 'table-row';
document.getElementById('tr-sourceprovider').style.display = 'none';
document.getElementById('tr-sourceconnectstring').style.display = 'none';
document.getElementById('tr-sourceserver').style.display = 'none';
} else if (sctype === 'oledb') {
document.getElementById('tr-sourcedsn').style.display = 'none';
document.getElementById('tr-sourceprovider').style.display = 'table-row';
document.getElementById('tr-sourceconnectstring').style.display = 'none';
document.getElementById('tr-sourceserver').style.display = 'table-row';
} else {
document.getElementById('tr-sourcedsn').style.display = 'none';
document.getElementById('tr-sourceprovider').style.display = 'none';
document.getElementById('tr-sourceconnectstring').style.display = 'table-row';
document.getElementById('tr-sourceserver').style.display = 'table-row';
}
onSourceTrustedChange();
}
initDisplayStates();
updateCommand();
</script>
</body>
</html>