mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use single icon prop
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
165d3b6b33
commit
f9f83576f7
@ -105,7 +105,6 @@ export interface ClusterPreferences extends ClusterPrometheusPreferences {
|
||||
* cleared by preferences.
|
||||
*/
|
||||
icon?: string | null;
|
||||
iconBackgroundColor?: string;
|
||||
httpsProxy?: string;
|
||||
hiddenMetrics?: string[];
|
||||
nodeShellImage?: string;
|
||||
|
||||
@ -23,15 +23,11 @@ const updateEntitySpecInjectable = getInjectable({
|
||||
entity.spec.metrics.prometheus = prometheus;
|
||||
}
|
||||
|
||||
entity.spec.icon ??= {};
|
||||
|
||||
if (cluster.preferences.iconBackgroundColor) {
|
||||
entity.spec.icon.background = cluster.preferences.iconBackgroundColor;
|
||||
}
|
||||
|
||||
if (cluster.preferences.icon) {
|
||||
entity.spec.icon.src = cluster.preferences.icon;
|
||||
entity.spec.icon.background = cluster.preferences.iconBackgroundColor;
|
||||
const source = cluster.preferences.icon.startsWith("data:") ? "src" : "background";
|
||||
|
||||
entity.spec.icon ??= {};
|
||||
entity.spec.icon[source] = cluster.preferences.icon;
|
||||
} else if (cluster.preferences.icon === null) {
|
||||
/**
|
||||
* NOTE: only clear the icon if set to `null` by ClusterIconSettings.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user