feat: Add proxy clone functionality to settings (#5944)
Some checks failed
Auto Test / armv7-simple-test (18, ARMv7) (push) Has been cancelled
Auto Test / armv7-simple-test (20, ARMv7) (push) Has been cancelled
Auto Test / check-linters (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
validate / json-yaml-validate (push) Has been cancelled
validate / validate (push) Has been cancelled
Auto Test / auto-test (18, ARM64) (push) Has been cancelled
Auto Test / auto-test (18, macos-latest) (push) Has been cancelled
Auto Test / auto-test (18, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (18, windows-latest) (push) Has been cancelled
Auto Test / auto-test (20, ARM64) (push) Has been cancelled
Auto Test / auto-test (20, macos-latest) (push) Has been cancelled
Auto Test / auto-test (20, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (20, windows-latest) (push) Has been cancelled

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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}

View file

@ -13,7 +13,8 @@
<li v-for="(proxy, index) in $root.proxyList" :key="index" class="list-group-item">
{{ proxy.host }}:{{ proxy.port }} ({{ proxy.protocol }})
<span v-if="proxy.default === true" class="badge bg-primary ms-2">{{ $t("Default") }}</span><br>
<a href="#" @click="$refs.proxyDialog.show(proxy.id)">{{ $t("Edit") }}</a>
<a href="#" @click="$refs.proxyDialog.show(proxy.id)">{{ $t("Edit") }}</a> |
<a href="#" @click="$refs.proxyDialog.showClone(proxy.id)">{{ $t("Clone") }}</a>
</li>
</ul>