From beb651beeff3594836676453873c85aa23ab89e2 Mon Sep 17 00:00:00 2001 From: mrv777 Date: Fri, 21 Feb 2025 14:10:29 -0600 Subject: [PATCH 1/4] fix: use url params to unlock overclock --- .../app/components/edit/edit.component.html | 5 ++++ .../src/app/components/edit/edit.component.ts | 30 ++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.html b/main/http_server/axe-os/src/app/components/edit/edit.component.html index e7f86da1..705cf857 100644 --- a/main/http_server/axe-os/src/app/components/edit/edit.component.html +++ b/main/http_server/axe-os/src/app/components/edit/edit.component.html @@ -1,5 +1,10 @@
+ + + +
diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.ts b/main/http_server/axe-os/src/app/components/edit/edit.component.ts index b1a981b8..f3ea3419 100644 --- a/main/http_server/axe-os/src/app/components/edit/edit.component.ts +++ b/main/http_server/axe-os/src/app/components/edit/edit.component.ts @@ -6,6 +6,7 @@ import { startWith, Subject, takeUntil } from 'rxjs'; import { LoadingService } from 'src/app/services/loading.service'; import { SystemService } from 'src/app/services/system.service'; import { eASICModel } from 'src/models/enum/eASICModel'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-edit', @@ -124,13 +125,28 @@ export class EditComponent implements OnInit, OnDestroy { private fb: FormBuilder, private systemService: SystemService, private toastr: ToastrService, - private loadingService: LoadingService + private loadingService: LoadingService, + private route: ActivatedRoute, ) { - // Add unlockSettings to window object for console access - (window as any).unlockSettings = () => { - this.settingsUnlocked = true; - console.log('Settings unlocked. You can now set custom frequency and voltage values.'); - }; + // Check URL parameter for settings unlock + this.route.queryParams.subscribe(params => { + this.settingsUnlocked = params['oc'] !== undefined; + if (this.settingsUnlocked) { + console.log( + '🎉 The ancient seals have been broken!\n' + + '⚡ Unlimited power flows through your miner...\n' + + '🔧 You can now set custom frequency and voltage values.\n' + + '⚠️ Remember: with great power comes great responsibility!' + ); + } else { + console.log('🔒 Here be dragons! Advanced settings are locked for your protection. \n' + + 'Only the bravest miners dare to venture forth... \n' + + 'If you wish to unlock dangerous overclocking powers, add: %c?oc', + 'color: #ff4400; text-decoration: underline; cursor: pointer; font-weight: bold;', + 'to the current URL' + ); + } + }); } ngOnInit(): void { @@ -166,8 +182,6 @@ export class EditComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { - // Remove unlockSettings from window object - delete (window as any).unlockSettings; this.destroy$.next(); this.destroy$.complete(); } From 9dfeb94f462ce13435f62ec582854251dfbf2184 Mon Sep 17 00:00:00 2001 From: mrv777 Date: Sat, 22 Feb 2025 09:07:45 -0600 Subject: [PATCH 2/4] fix: better message --- .../axe-os/src/app/components/edit/edit.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.html b/main/http_server/axe-os/src/app/components/edit/edit.component.html index 705cf857..f1922c75 100644 --- a/main/http_server/axe-os/src/app/components/edit/edit.component.html +++ b/main/http_server/axe-os/src/app/components/edit/edit.component.html @@ -2,7 +2,7 @@ + text="Warning: Custom frequency and voltage settings can cause damage and system instability. Only modify these settings if you fully understand the risks and implications."> From f2a382eb9aa5be7a7a7131a8d67a5972cc877aaa Mon Sep 17 00:00:00 2001 From: mrv777 Date: Sat, 22 Feb 2025 09:22:36 -0600 Subject: [PATCH 3/4] chore: wording update again --- .../axe-os/src/app/components/edit/edit.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.html b/main/http_server/axe-os/src/app/components/edit/edit.component.html index f1922c75..bd2a1ff5 100644 --- a/main/http_server/axe-os/src/app/components/edit/edit.component.html +++ b/main/http_server/axe-os/src/app/components/edit/edit.component.html @@ -2,7 +2,7 @@ + text="Warning: Custom frequency & voltage settings can cause damage & system instability. Only modify these settings if you fully understand the risks & implications of running outside designed parameters."> From a330f1d128a40e838632a0a79e425258362dbe26 Mon Sep 17 00:00:00 2001 From: mrv777 Date: Sat, 22 Feb 2025 09:40:52 -0600 Subject: [PATCH 4/4] chore: shorten message more --- .../axe-os/src/app/components/edit/edit.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/http_server/axe-os/src/app/components/edit/edit.component.html b/main/http_server/axe-os/src/app/components/edit/edit.component.html index bd2a1ff5..106e13a9 100644 --- a/main/http_server/axe-os/src/app/components/edit/edit.component.html +++ b/main/http_server/axe-os/src/app/components/edit/edit.component.html @@ -2,7 +2,7 @@ + text="Custom settings can cause damage & system instability. Only modify these settings if you understand the risks of running outside designed parameters.">