mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-27 09:49:28 +08:00
feat: Add a copy button to application parameters (#9892)
Refs https://github.com/1Panel-dev/1Panel/issues/2998
This commit is contained in:
parent
3dc81d85e9
commit
04a0e15899
1 changed files with 18 additions and 0 deletions
|
|
@ -30,6 +30,7 @@
|
|||
</el-descriptions-item>
|
||||
<el-descriptions-item v-for="(param, key) in params" :label="getLabel(param)" :key="key">
|
||||
<span>{{ param.showValue && param.showValue != '' ? param.showValue : param.value }}</span>
|
||||
<CopyButton v-if="showCopyButton(param.key)" :content="param.value" type="icon" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
|
@ -348,6 +349,23 @@ const updateAppConfig = async () => {
|
|||
} catch (error) {}
|
||||
};
|
||||
|
||||
const showCopyButton = (key: string) => {
|
||||
const keys = [
|
||||
'PANEL_DB_ROOT_PASSWORD',
|
||||
'PANEL_DB_NAME',
|
||||
'PANEL_DB_USER',
|
||||
'PANEL_DB_USER_PASSWORD',
|
||||
'PANEL_REDIS_ROOT_PASSWORD',
|
||||
'PANEL_DB_ROOT_USER',
|
||||
];
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if (key === keys[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
defineExpose({ acceptParams });
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue