mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
style(cpu_dialog): use modal-footer
This commit is contained in:
parent
8edbbe27f8
commit
a635131f47
@ -23,13 +23,16 @@ const TPL = /*html*/`
|
||||
<p class="mb-3">
|
||||
<strong>Recommendation:</strong> ${t("cpu_arch_warning.recommendation")}
|
||||
</p>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
</div>
|
||||
<div class="modal-footer d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<button class="download-correct-version-button btn btn-primary btn-lg me-2">
|
||||
<i class="bx bx-download"></i>
|
||||
<span>${t("cpu_arch_warning.download_link")}</span>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
<button class="continue-anyway-button btn btn-secondary" data-bs-dismiss="modal">${t("cpu_arch_warning.continue_anyway")}</button>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
@ -39,7 +42,6 @@ const TPL = /*html*/`
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
export default class RosettaWarningDialog extends BasicWidget {
|
||||
|
@ -14,24 +14,7 @@ function systemChecks() {
|
||||
* @returns true if running under Rosetta 2, false otherwise
|
||||
*/
|
||||
export const isRunningUnderRosetta2 = () => {
|
||||
if (!isMac) return false;
|
||||
|
||||
try {
|
||||
// Use child_process to check sysctl.proc_translated
|
||||
// This is the proper way to detect Rosetta 2 translation
|
||||
const result = execSync("sysctl -n sysctl.proc_translated 2>/dev/null", {
|
||||
encoding: "utf8",
|
||||
timeout: 1000
|
||||
}).trim();
|
||||
|
||||
// 1 means the process is being translated by Rosetta 2
|
||||
// 0 means native execution
|
||||
// If the sysctl doesn't exist (on Intel Macs), this will return empty/error
|
||||
return result === "1";
|
||||
} catch (error) {
|
||||
// If sysctl fails or doesn't exist (Intel Macs), not running under Rosetta 2
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
export default {
|
||||
|
Loading…
x
Reference in New Issue
Block a user