feat: Add proxy clone functionality to settings (#5944)

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
mindsolo
2025-06-23 16:38:01 +03:00
committed by GitHub
parent 9e7ea4913a
commit 9976ef94af
2 changed files with 34 additions and 1 deletions

View File

@@ -174,6 +174,38 @@ export default {
this.modal.show();
},
/**
* Show dialog to clone a proxy
* @param {number} proxyID ID of proxy to clone
* @returns {void}
*/
showClone(proxyID) {
if (proxyID) {
for (let proxy of this.$root.proxyList) {
if (proxy.id === proxyID) {
// Create a clone of the proxy data
this.proxy = {
protocol: proxy.protocol,
host: proxy.host,
port: proxy.port,
auth: proxy.auth,
username: proxy.username,
password: proxy.password,
active: proxy.active,
default: false, // Cloned proxy should not be default
applyExisting: false,
};
break;
}
}
}
// Set id to null to indicate this is a new proxy (clone)
this.id = null;
this.modal.show();
},
/**
* Submit form data for saving
* @returns {void}