feat: Add a copy button to application parameters (#9892)

Refs https://github.com/1Panel-dev/1Panel/issues/2998
This commit is contained in:
CityFun
2025-08-07 13:44:38 +00:00
committed by GitHub
parent 3dc81d85e9
commit 04a0e15899
@@ -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>