From 978584f7560315827ec45060cef97bb3744727a6 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 19 Nov 2025 11:44:49 +0800 Subject: [PATCH] * [refac] Replace modern Clipboard API with compatible copy method in upgrade module - Replace navigator.clipboard.writeText() with document.execCommand('copy') for better browser compatibility - Add fallback copy method using temporary textarea element - Update copy failure messages to be more descriptive - Improve cross-browser support for copy command functionality --- module/upgrade/js/execute.ui.js | 38 +++++++++++++++++++++++++++------ module/upgrade/lang/en.php | 2 +- module/upgrade/lang/zh-cn.php | 2 +- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/module/upgrade/js/execute.ui.js b/module/upgrade/js/execute.ui.js index ab97e97c27..4740facf4d 100644 --- a/module/upgrade/js/execute.ui.js +++ b/module/upgrade/js/execute.ui.js @@ -10,13 +10,39 @@ window.submitConfirm = function(event) window.copyCommand = function() { const command = $('#command').text(); - navigator.clipboard.writeText(command).then(function() - { - zui.Messager.show({type: 'success', message: copySuccess, timeout: 1000}); - }, function() - { - zui.Messager.show({type: 'danger', message: copyFail, timeout: 1000}); + const $textArea = $('