feat: disable bulk edit entries with //

This commit is contained in:
liyasthomas
2021-08-30 18:35:33 +05:30
parent 174ba90fb5
commit b9fa254ab5
3 changed files with 11 additions and 15 deletions

View File

@@ -224,13 +224,11 @@ export default defineComponent({
watch(bulkHeaders, () => { watch(bulkHeaders, () => {
try { try {
const transformation = bulkHeaders.value.split("\n").map((item) => { const transformation = bulkHeaders.value.split("\n").map((item) => ({
return { key: item.substr(0, item.indexOf(":")).trim(),
key: item.substr(0, item.indexOf(":")).trim(), value: item.substr(item.indexOf(":") + 1).trim(),
value: item.substr(item.indexOf(":") + 1).trim(), active: !item.trim().startsWith("//"),
active: true, }))
}
})
setRESTHeaders(transformation) setRESTHeaders(transformation)
} catch (e) { } catch (e) {
$toast.error(t("error.something_went_wrong").toString(), { $toast.error(t("error.something_went_wrong").toString(), {

View File

@@ -232,13 +232,11 @@ export default defineComponent({
watch(bulkParams, () => { watch(bulkParams, () => {
try { try {
const transformation = bulkParams.value.split("\n").map((item) => { const transformation = bulkParams.value.split("\n").map((item) => ({
return { key: item.substr(0, item.indexOf(":")).trim(),
key: item.substr(0, item.indexOf(":")).trim(), value: item.substr(item.indexOf(":") + 1).trim(),
value: item.substr(item.indexOf(":") + 1).trim(), active: !item.trim().startsWith("//"),
active: true, }))
}
})
setRESTParams(transformation) setRESTParams(transformation)
} catch (e) { } catch (e) {
$toast.error(t("error.something_went_wrong").toString(), { $toast.error(t("error.something_went_wrong").toString(), {

View File

@@ -404,7 +404,7 @@
}, },
"state": { "state": {
"bulk_mode": "Bulk edit", "bulk_mode": "Bulk edit",
"bulk_mode_placeholder": "Entries are separated by newline\nKeys and values are separated by :", "bulk_mode_placeholder": "Entries are separated by newline\nKeys and values are separated by :\nPrepend // to any row you want to add but keep disabled",
"cleared": "Cleared", "cleared": "Cleared",
"connected": "Connected", "connected": "Connected",
"connected_to": "Connected to {name}", "connected_to": "Connected to {name}",