feat(sidepanel): 添加 VPS 密码切换按钮及其标签同步功能
This commit is contained in:
@@ -19,6 +19,7 @@ const statusBar = document.getElementById('status-bar');
|
|||||||
const inputEmail = document.getElementById('input-email');
|
const inputEmail = document.getElementById('input-email');
|
||||||
const inputPassword = document.getElementById('input-password');
|
const inputPassword = document.getElementById('input-password');
|
||||||
const btnToggleVpsUrl = document.getElementById('btn-toggle-vps-url');
|
const btnToggleVpsUrl = document.getElementById('btn-toggle-vps-url');
|
||||||
|
const btnToggleVpsPassword = document.getElementById('btn-toggle-vps-password');
|
||||||
const btnFetchEmail = document.getElementById('btn-fetch-email');
|
const btnFetchEmail = document.getElementById('btn-fetch-email');
|
||||||
const btnTogglePassword = document.getElementById('btn-toggle-password');
|
const btnTogglePassword = document.getElementById('btn-toggle-password');
|
||||||
const btnSaveSettings = document.getElementById('btn-save-settings');
|
const btnSaveSettings = document.getElementById('btn-save-settings');
|
||||||
@@ -1463,6 +1464,13 @@ function syncVpsUrlToggleLabel() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function syncVpsPasswordToggleLabel() {
|
||||||
|
syncToggleButtonLabel(btnToggleVpsPassword, inputVpsPassword, {
|
||||||
|
show: '显示管理密钥',
|
||||||
|
hide: '隐藏管理密钥',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function maybeTakeoverAutoRun(actionLabel) {
|
async function maybeTakeoverAutoRun(actionLabel) {
|
||||||
if (!isAutoRunPausedPhase()) {
|
if (!isAutoRunPausedPhase()) {
|
||||||
return true;
|
return true;
|
||||||
@@ -1799,6 +1807,11 @@ btnToggleVpsUrl.addEventListener('click', () => {
|
|||||||
syncVpsUrlToggleLabel();
|
syncVpsUrlToggleLabel();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
btnToggleVpsPassword.addEventListener('click', () => {
|
||||||
|
inputVpsPassword.type = inputVpsPassword.type === 'password' ? 'text' : 'password';
|
||||||
|
syncVpsPasswordToggleLabel();
|
||||||
|
});
|
||||||
|
|
||||||
localCpaStep9ModeButtons.forEach((button) => {
|
localCpaStep9ModeButtons.forEach((button) => {
|
||||||
button.addEventListener('click', () => {
|
button.addEventListener('click', () => {
|
||||||
const nextMode = button.dataset.localCpaStep9Mode;
|
const nextMode = button.dataset.localCpaStep9Mode;
|
||||||
@@ -2279,6 +2292,7 @@ setLocalCpaStep9Mode(DEFAULT_LOCAL_CPA_STEP9_MODE);
|
|||||||
restoreState().then(() => {
|
restoreState().then(() => {
|
||||||
syncPasswordToggleLabel();
|
syncPasswordToggleLabel();
|
||||||
syncVpsUrlToggleLabel();
|
syncVpsUrlToggleLabel();
|
||||||
|
syncVpsPasswordToggleLabel();
|
||||||
updatePanelModeUI();
|
updatePanelModeUI();
|
||||||
updateButtonStates();
|
updateButtonStates();
|
||||||
updateStatusDisplay(latestState);
|
updateStatusDisplay(latestState);
|
||||||
|
|||||||
Reference in New Issue
Block a user