@@ -201,8 +201,12 @@ export class JdkDownloaderView {
201
201
}
202
202
203
203
private getMachineArchHtml = ( ) => {
204
- return `<option value="aarch64" ${ this . machineArch === 'aarch64' ? 'selected' : null } >arm64</option>
205
- <option value="x64" ${ this . machineArch === 'x64' ? 'selected' : null } >x64</option>`
204
+ if ( this . osType === 'windows' ) {
205
+ return `<option value="x64" selected>x64</option>` ;
206
+ } else {
207
+ return `<option value="aarch64" ${ this . machineArch === 'aarch64' ? 'selected' : null } >arm64</option>
208
+ <option value="x64" ${ this . machineArch === 'x64' ? 'selected' : null } >x64</option>` ;
209
+ }
206
210
}
207
211
208
212
private getScriptJs = ( ) => {
@@ -234,6 +238,28 @@ export class JdkDownloaderView {
234
238
triggerJDKDownload(event);
235
239
});
236
240
241
+ document.getElementById("oracleJDKOsTypeDropdown")?.addEventListener('change', (event) => {
242
+ updateMachineArchOptions(event.target.id);
243
+ });
244
+
245
+ document.getElementById("openJDKOsTypeDropdown")?.addEventListener('change', (event) => {
246
+ updateMachineArchOptions(event.target.id);
247
+ });
248
+
249
+ const updateMachineArchOptions = (osDropdownId) => {
250
+ const osDropdown = document.getElementById(osDropdownId);
251
+ const machineArchDropdown = document.getElementById(osDropdownId.replace('OsTypeDropdown', 'MachineArchDropdown'));
252
+
253
+ if (osDropdown.value === 'windows') {
254
+ machineArchDropdown.innerHTML = '<option value="x64" selected>x64</option>';
255
+ } else {
256
+ machineArchDropdown.innerHTML = \`
257
+ <option value="aarch64" \${machineArchDropdown.value === 'aarch64' ? 'selected' : null}>arm64</option>
258
+ <option value="x64" \${machineArchDropdown.value === 'x64' ? 'selected' : null}>x64</option>
259
+ \`;
260
+ }
261
+ };
262
+
237
263
const hideOrDisplayDivs = (e) => {
238
264
const { id } = e.target;
239
265
if(activeButton){
0 commit comments