mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Align Badge styles across components
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
377c09aa9a
commit
4151b754ad
@ -27,13 +27,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
.Badge {
|
@include release-status-bgs;
|
||||||
@include release-status-bgs;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart {
|
.chart {
|
||||||
|
|||||||
@ -272,7 +272,7 @@ export class ReleaseDetails extends Component<Props> {
|
|||||||
<DrawerItem name="Status" className="status" labelsOnly>
|
<DrawerItem name="Status" className="status" labelsOnly>
|
||||||
<Badge
|
<Badge
|
||||||
label={release.getStatus()}
|
label={release.getStatus()}
|
||||||
className={cssNames("status", kebabCase(release.getStatus()))}
|
className={kebabCase(release.getStatus())}
|
||||||
/>
|
/>
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
{this.renderValues()}
|
{this.renderValues()}
|
||||||
|
|||||||
@ -88,6 +88,7 @@ export class CatalogEntityItem<T extends CatalogEntity> implements ItemObject {
|
|||||||
onClick?.(event);
|
onClick?.(event);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}}
|
}}
|
||||||
|
expandable={false}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
@import "autoscaler.mixins";
|
@import "autoscaler.mixins";
|
||||||
|
|
||||||
.HpaDetails {
|
.HpaDetails {
|
||||||
.Badge {
|
.status {
|
||||||
@include hpa-status-bgc;
|
@include hpa-status-bgc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -125,7 +125,7 @@ export class HpaDetails extends React.Component<Props> {
|
|||||||
{hpa.getReplicas()}
|
{hpa.getReplicas()}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
|
||||||
<DrawerItem name="Status" labelsOnly>
|
<DrawerItem name="Status" className="status" labelsOnly>
|
||||||
{hpa.getConditions().map(({ type, tooltip, isReady }) => {
|
{hpa.getConditions().map(({ type, tooltip, isReady }) => {
|
||||||
if (!isReady) return null;
|
if (!isReady) return null;
|
||||||
|
|
||||||
|
|||||||
@ -38,10 +38,7 @@
|
|||||||
&.status {
|
&.status {
|
||||||
flex: 1.5;
|
flex: 1.5;
|
||||||
@include table-cell-labels-offsets;
|
@include table-cell-labels-offsets;
|
||||||
|
@include hpa-status-bgc;
|
||||||
.Badge {
|
|
||||||
@include hpa-status-bgc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.age {
|
&.age {
|
||||||
|
|||||||
@ -104,6 +104,7 @@ export class HorizontalPodAutoscalers extends React.Component<Props> {
|
|||||||
label={type}
|
label={type}
|
||||||
tooltip={tooltip}
|
tooltip={tooltip}
|
||||||
className={cssNames(type.toLowerCase())}
|
className={cssNames(type.toLowerCase())}
|
||||||
|
expandable={false}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export class Secrets extends React.Component<Props> {
|
|||||||
secret.getName(),
|
secret.getName(),
|
||||||
<KubeObjectStatusIcon key="icon" object={secret} />,
|
<KubeObjectStatusIcon key="icon" object={secret} />,
|
||||||
secret.getNs(),
|
secret.getNs(),
|
||||||
secret.getLabels().map(label => <Badge key={label} label={label}/>),
|
secret.getLabels().map(label => <Badge key={label} label={label} expandable={false}/>),
|
||||||
secret.getKeys().join(", "),
|
secret.getKeys().join(", "),
|
||||||
secret.type,
|
secret.type,
|
||||||
secret.getAge(),
|
secret.getAge(),
|
||||||
|
|||||||
@ -21,21 +21,19 @@
|
|||||||
|
|
||||||
.DeploymentDetails {
|
.DeploymentDetails {
|
||||||
.conditions {
|
.conditions {
|
||||||
.Badge {
|
.available {
|
||||||
&.available {
|
color: white;
|
||||||
color: white;
|
background-color: $deployment-available;
|
||||||
background-color: $deployment-available;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&.progressing {
|
.progressing {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: $deployment-progressing;
|
background-color: $deployment-progressing;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.replica-failure {
|
.replica-failure {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: $deployment-replicafailure;
|
background-color: $deployment-replicafailure;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,7 +27,6 @@ import { disposeOnUnmount, observer } from "mobx-react";
|
|||||||
import { DrawerItem } from "../drawer";
|
import { DrawerItem } from "../drawer";
|
||||||
import { Badge } from "../badge";
|
import { Badge } from "../badge";
|
||||||
import type { Deployment } from "../../api/endpoints";
|
import type { Deployment } from "../../api/endpoints";
|
||||||
import { cssNames } from "../../utils";
|
|
||||||
import { PodDetailsTolerations } from "../+workloads-pods/pod-details-tolerations";
|
import { PodDetailsTolerations } from "../+workloads-pods/pod-details-tolerations";
|
||||||
import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities";
|
import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities";
|
||||||
import { podsStore } from "../+workloads-pods/pods.store";
|
import { podsStore } from "../+workloads-pods/pods.store";
|
||||||
@ -118,7 +117,8 @@ export class DeploymentDetails extends React.Component<Props> {
|
|||||||
<Badge
|
<Badge
|
||||||
key={type}
|
key={type}
|
||||||
label={type}
|
label={type}
|
||||||
className={cssNames({ disabled: status === "False" }, kebabCase(type))}
|
disabled={status === "False"}
|
||||||
|
className={kebabCase(type)}
|
||||||
tooltip={(
|
tooltip={(
|
||||||
<>
|
<>
|
||||||
<p>{message}</p>
|
<p>{message}</p>
|
||||||
|
|||||||
@ -142,7 +142,7 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
<Badge
|
<Badge
|
||||||
key={type}
|
key={type}
|
||||||
label={type}
|
label={type}
|
||||||
className={cssNames({ disabled: status === "False" })}
|
disabled={status === "False"}
|
||||||
tooltip={`Last transition time: ${lastTransitionTime}`}
|
tooltip={`Last transition time: ${lastTransitionTime}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export class Pods extends React.Component<Props> {
|
|||||||
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
||||||
]}
|
]}
|
||||||
renderTableContents={(pod: Pod) => [
|
renderTableContents={(pod: Pod) => [
|
||||||
<Badge flat key="name" label={pod.getName()} tooltip={pod.getName()} />,
|
<Badge flat key="name" label={pod.getName()} tooltip={pod.getName()} expandable={false} />,
|
||||||
<KubeObjectStatusIcon key="icon" object={pod} />,
|
<KubeObjectStatusIcon key="icon" object={pod} />,
|
||||||
pod.getNs(),
|
pod.getNs(),
|
||||||
this.renderContainersStatus(pod),
|
this.renderContainersStatus(pod),
|
||||||
@ -145,7 +145,7 @@ export class Pods extends React.Component<Props> {
|
|||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
pod.getNodeName() ?
|
pod.getNodeName() ?
|
||||||
<Badge flat key="node" className="node" tooltip={pod.getNodeName()}>
|
<Badge flat key="node" className="node" tooltip={pod.getNodeName()} expandable={false}>
|
||||||
<Link to={getDetailsUrl(nodesApi.getUrl({ name: pod.getNodeName() }))} onClick={stopPropagation}>
|
<Link to={getDetailsUrl(nodesApi.getUrl({ name: pod.getNodeName() }))} onClick={stopPropagation}>
|
||||||
{pod.getNodeName()}
|
{pod.getNodeName()}
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.legend {
|
.legend {
|
||||||
.Badge {
|
.LegendBadge {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
transition: background-color 250ms;
|
transition: background-color 250ms;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
|
|||||||
@ -169,7 +169,7 @@ export class Chart extends React.Component<ChartProps> {
|
|||||||
const labelElem = (title: string, color: string, tooltip?: string) => (
|
const labelElem = (title: string, color: string, tooltip?: string) => (
|
||||||
<Badge
|
<Badge
|
||||||
key={title}
|
key={title}
|
||||||
className="flex gaps align-center"
|
className="LegendBadge flex gaps align-center"
|
||||||
label={(
|
label={(
|
||||||
<div>
|
<div>
|
||||||
<StatusBrick style={{ backgroundColor: color }}/>
|
<StatusBrick style={{ backgroundColor: color }}/>
|
||||||
@ -177,6 +177,7 @@ export class Chart extends React.Component<ChartProps> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
tooltip={tooltip}
|
tooltip={tooltip}
|
||||||
|
expandable={false}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -69,13 +69,14 @@ export class ShowMetricsSetting extends React.Component<Props> {
|
|||||||
const tooltipId = `${name}`;
|
const tooltipId = `${name}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Badge key={name} flat>
|
<Badge key={name} flat expandable={false}>
|
||||||
<span id={tooltipId}>{name}</span>
|
<span id={tooltipId}>{name}</span>
|
||||||
<Icon
|
<Icon
|
||||||
smallest
|
smallest
|
||||||
material="clear"
|
material="clear"
|
||||||
onClick={() => this.removeMetric(name)}
|
onClick={() => this.removeMetric(name)}
|
||||||
tooltip="Remove"
|
tooltip="Remove"
|
||||||
|
className="mx-3"
|
||||||
/>
|
/>
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Badge {
|
> div {
|
||||||
float: left;
|
float: left;
|
||||||
margin: $spacing;
|
margin: $spacing;
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
top: -20px;
|
top: -20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Badge {
|
.SelectorIndex {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background: var(--secondaryBackground);
|
background: var(--secondaryBackground);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -49,6 +49,7 @@ export function HotbarSelector({ hotbar }: Props) {
|
|||||||
preferredPositions: [TooltipPosition.TOP, TooltipPosition.TOP_LEFT],
|
preferredPositions: [TooltipPosition.TOP, TooltipPosition.TOP_LEFT],
|
||||||
children: hotbar.name
|
children: hotbar.name
|
||||||
}}
|
}}
|
||||||
|
className="SelectorIndex"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Icon material="play_arrow" className="next box" onClick={() => store.switchToNext()} />
|
<Icon material="play_arrow" className="next box" onClick={() => store.switchToNext()} />
|
||||||
|
|||||||
@ -49,8 +49,4 @@
|
|||||||
@mixin table-cell-labels-offsets {
|
@mixin table-cell-labels-offsets {
|
||||||
padding-top: $padding / 2;
|
padding-top: $padding / 2;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
|
||||||
.Badge + .Badge {
|
|
||||||
margin-left: $padding / 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user