Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,23 @@ const props = defineProps({
})

const environmentVariablesKeys = toRef(props, 'environmentVariablesKeys')

const handlePaste = (event) => {
const oldLength = props.environmentVariablesKeys.length
const clipboardText = event.clipboardData.getData('text')
const lines = clipboardText.split('\n')
const env_variables = lines.map((line) => line.split('='))
env_variables.forEach(([name, value], index) => {
props.addEnvironmentVariable()
console.log(props.environmentVariablesKeys[oldLength + index])
props.onVariableNameChange(props.environmentVariablesKeys[oldLength + index], name)
props.onVariableValueChange(props.environmentVariablesKeys[oldLength + index], value)
})
}
</script>

<template>
<Table :divider-between-rows="false">
<Table :divider-between-rows="false" @paste="handlePaste">
<template v-slot:header>
<TableHeader align="center">Variable Name</TableHeader>
<TableHeader align="center">Value</TableHeader>
Expand Down