Skip to content

Commit 66c3bf5

Browse files
committed
frontend: Resource: Add environment variables display for containers
1 parent bd7b6ab commit 66c3bf5

22 files changed

+733
-50
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
@@ -365,6 +365,8 @@
365365
"Delete port forward": "Portweiterleitung löschen",
366366
"Stop port forward": "Portweiterleitung stoppen",
367367
"Copied": "",
368+
"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}}",
369+
"Value": "Wert",
368370
"Mount Path": "Mount Path",
369371
"from": "von",
370372
"I/O": "I/O",
@@ -481,7 +483,6 @@
481483
"Suspend": "Pausieren",
482484
"Key": "Schlüssel",
483485
"Operator": "Betreiber",
484-
"Value": "Wert",
485486
"Effect": "Wirkung",
486487
"Current": "Aktuell",
487488
"Desired//context:pods": "Gewünscht",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@
365365
"Delete port forward": "Delete port forward",
366366
"Stop port forward": "Stop port forward",
367367
"Copied": "Copied",
368+
"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}}",
369+
"Value": "Value",
368370
"Mount Path": "Mount Path",
369371
"from": "from",
370372
"I/O": "I/O",
@@ -481,7 +483,6 @@
481483
"Suspend": "Suspend",
482484
"Key": "Key",
483485
"Operator": "Operator",
484-
"Value": "Value",
485486
"Effect": "Effect",
486487
"Current": "Current",
487488
"Desired//context:pods": "Desired",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@
367367
"Delete port forward": "Eliminar redireccionamiento de puerto",
368368
"Stop port forward": "Parar redireccionamiento de puerto",
369369
"Copied": "",
370+
"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}}",
371+
"Value": "Valor",
370372
"Mount Path": "Camino de montaje",
371373
"from": "desde",
372374
"I/O": "I/O",
@@ -484,7 +486,6 @@
484486
"Suspend": "Suspender",
485487
"Key": "Clave",
486488
"Operator": "Operador",
487-
"Value": "Valor",
488489
"Effect": "Efecto",
489490
"Current": "Actual",
490491
"Desired//context:pods": "Deseados",

0 commit comments

Comments
 (0)