Skip to content

Commit 6dd2c8e

Browse files
committed
frontend: Resource: Add environment variables display for containers
1 parent f56b3db commit 6dd2c8e

15 files changed

+719
-43
lines changed

frontend/src/components/common/Resource/Resource.tsx

Lines changed: 623 additions & 25 deletions
Large diffs are not rendered by default.

frontend/src/components/secret/Details.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ export default function SecretDetails(props: {
6060
{
6161
id: 'headlamp.secrets-data',
6262
section: () => {
63-
const initialData = _.mapValues(item.data, (v: string) => Base64.decode(v));
63+
// Keep data in base64 format - SecretField handles decoding for display
64+
const initialData = item.data || {};
6465
const [data, setData] = React.useState(initialData);
6566
const lastDataRef = React.useRef(initialData);
6667

6768
React.useEffect(() => {
68-
const newData = _.mapValues(item.data, (v: string) => Base64.decode(v));
69+
const newData = item.data || {};
6970
if (!_.isEqual(newData, lastDataRef.current)) {
7071
if (_.isEqual(data, lastDataRef.current)) {
7172
setData(newData);
@@ -75,12 +76,13 @@ export default function SecretDetails(props: {
7576
}, [item.data]);
7677

7778
const handleFieldChange = (key: string, newValue: string) => {
78-
setData(prev => ({ ...prev, [key]: newValue }));
79+
// User edits in plaintext, encode back to base64 for storage
80+
setData(prev => ({ ...prev, [key]: Base64.encode(newValue) }));
7981
};
8082

8183
const handleSave = () => {
82-
const encodedData = _.mapValues(data, (v: string) => Base64.encode(v));
83-
const updatedSecret = { ...item.jsonData, data: encodedData };
84+
// Data is already base64 encoded
85+
const updatedSecret = { ...item.jsonData, data };
8486
dispatch(
8587
clusterAction(() => item.update(updatedSecret), {
8688
startMessage: t('translation|Applying changes to {{ itemName }}…', {

frontend/src/components/secret/__snapshots__/Details.WithBase.stories.storyshot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
281281
readonly=""
282282
type="password"
283-
value="******"
283+
value="••••••••"
284284
/>
285285
</div>
286286
</div>
@@ -334,7 +334,7 @@
334334
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
335335
readonly=""
336336
type="password"
337-
value="******"
337+
value="••••••••"
338338
/>
339339
</div>
340340
</div>
@@ -388,7 +388,7 @@
388388
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
389389
readonly=""
390390
type="password"
391-
value="******"
391+
value="••••••••"
392392
/>
393393
</div>
394394
</div>

frontend/src/components/webhookconfiguration/__snapshots__/MutatingWebhookConfigDetails.WithService.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
335335
readonly=""
336336
type="password"
337-
value="******"
337+
value="••••••••"
338338
/>
339339
</div>
340340
</div>

frontend/src/components/webhookconfiguration/__snapshots__/MutatingWebhookConfigDetails.WithURL.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
332332
readonly=""
333333
type="password"
334-
value="******"
334+
value="••••••••"
335335
/>
336336
</div>
337337
</div>

frontend/src/components/webhookconfiguration/__snapshots__/ValidatingWebhookConfigDetails.WithService.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
335335
readonly=""
336336
type="password"
337-
value="******"
337+
value="••••••••"
338338
/>
339339
</div>
340340
</div>

frontend/src/components/webhookconfiguration/__snapshots__/ValidatingWebhookConfigDetails.WithURL.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
class="MuiInputBase-input MuiInput-input Mui-readOnly MuiInputBase-readOnly css-1x51dt5-MuiInputBase-input-MuiInput-input"
332332
readonly=""
333333
type="password"
334-
value="******"
334+
value="••••••••"
335335
/>
336336
</div>
337337
</div>

frontend/src/i18n/locales/de/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,5 +673,6 @@
673673
"\"{{metricName}}\" on pods": "\"{{metricName}}\" auf Pods",
674674
"resource {{resourceName}} on pods": "Ressource {{resourceName}} auf Pods",
675675
"resource {{resourceName}} of container {{containerName}} on pods": "Ressource {{resourceName}} des Containers {{containerName}} auf Pods",
676-
"Warning. Incompatible plugins disabled: ({{ pluginList }})": "Warnung. Inkompatible Plugins deaktiviert: ({{ pluginList }})"
676+
"Warning. Incompatible plugins disabled: ({{ pluginList }})": "Warnung. Inkompatible Plugins deaktiviert: ({{ pluginList }})",
677+
"This value may differ in the container, since the pod is older than {{from}}": "Dieser Wert kann im Container abweichen, da der Pod älter ist als {{from}}"
677678
}

frontend/src/i18n/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,5 +673,6 @@
673673
"\"{{metricName}}\" on pods": "\"{{metricName}}\" on pods",
674674
"resource {{resourceName}} on pods": "resource {{resourceName}} on pods",
675675
"resource {{resourceName}} of container {{containerName}} on pods": "resource {{resourceName}} of container {{containerName}} on pods",
676-
"Warning. Incompatible plugins disabled: ({{ pluginList }})": "Warning. Incompatible plugins disabled: ({{ pluginList }})"
676+
"Warning. Incompatible plugins disabled: ({{ pluginList }})": "Warning. Incompatible plugins disabled: ({{ pluginList }})",
677+
"This value may differ in the container, since the pod is older than {{from}}": "This value may differ in the container, since the pod is older than {{from}}"
677678
}

frontend/src/i18n/locales/es/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,5 +677,6 @@
677677
"\"{{metricName}}\" on pods": "\"{{metricName}}\" en pods",
678678
"resource {{resourceName}} on pods": "recurso {{resourceName}} en pods",
679679
"resource {{resourceName}} of container {{containerName}} on pods": "recurso {{resourceName}} del contenedor {{containerName}} en pods",
680-
"Warning. Incompatible plugins disabled: ({{ pluginList }})": "Advertencia. Plugins incompatibles deshabilitados: ({{ pluginList }})"
680+
"Warning. Incompatible plugins disabled: ({{ pluginList }})": "Advertencia. Plugins incompatibles deshabilitados: ({{ pluginList }})",
681+
"This value may differ in the container, since the pod is older than {{from}}": "Este valor puede diferir en el contenedor, ya que el pod es más antiguo que {{from}}"
681682
}

0 commit comments

Comments
 (0)