mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Added Status to the Port Forwarding list items (#4065)
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
parent
55eceb76b2
commit
e3e7c620a1
@ -24,5 +24,10 @@
|
|||||||
&.warning {
|
&.warning {
|
||||||
@include table-cell-warning;
|
@include table-cell-warning;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.status {
|
||||||
|
@include port-forward-status-colors;
|
||||||
|
flex: 0.6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,6 +33,7 @@ enum columnId {
|
|||||||
kind = "kind",
|
kind = "kind",
|
||||||
port = "port",
|
port = "port",
|
||||||
forwardPort = "forwardPort",
|
forwardPort = "forwardPort",
|
||||||
|
status = "status",
|
||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
@ -68,6 +69,7 @@ export class PortForwards extends React.Component {
|
|||||||
[columnId.kind]: item => item.getKind(),
|
[columnId.kind]: item => item.getKind(),
|
||||||
[columnId.port]: item => item.getPort(),
|
[columnId.port]: item => item.getPort(),
|
||||||
[columnId.forwardPort]: item => item.getForwardPort(),
|
[columnId.forwardPort]: item => item.getForwardPort(),
|
||||||
|
[columnId.status]: item => item.getStatus(),
|
||||||
}}
|
}}
|
||||||
searchFilters={[
|
searchFilters={[
|
||||||
item => item.getSearchFields(),
|
item => item.getSearchFields(),
|
||||||
@ -79,6 +81,7 @@ export class PortForwards extends React.Component {
|
|||||||
{ title: "Kind", className: "kind", sortBy: columnId.kind, id: columnId.kind },
|
{ title: "Kind", className: "kind", sortBy: columnId.kind, id: columnId.kind },
|
||||||
{ title: "Pod Port", className: "port", sortBy: columnId.port, id: columnId.port },
|
{ title: "Pod Port", className: "port", sortBy: columnId.port, id: columnId.port },
|
||||||
{ title: "Local Port", className: "forwardPort", sortBy: columnId.forwardPort, id: columnId.forwardPort },
|
{ title: "Local Port", className: "forwardPort", sortBy: columnId.forwardPort, id: columnId.forwardPort },
|
||||||
|
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
||||||
]}
|
]}
|
||||||
renderTableContents={item => [
|
renderTableContents={item => [
|
||||||
item.getName(),
|
item.getName(),
|
||||||
@ -86,6 +89,7 @@ export class PortForwards extends React.Component {
|
|||||||
item.getKind(),
|
item.getKind(),
|
||||||
item.getPort(),
|
item.getPort(),
|
||||||
item.getForwardPort(),
|
item.getForwardPort(),
|
||||||
|
{ title: item.getStatus(), className: item.getStatus().toLowerCase() },
|
||||||
]}
|
]}
|
||||||
renderItemMenu={pf => (
|
renderItemMenu={pf => (
|
||||||
<PortForwardMenu
|
<PortForwardMenu
|
||||||
|
|||||||
@ -31,3 +31,15 @@ $service-status-color-list: (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$port-forward-status-color-list: (
|
||||||
|
active: $colorOk,
|
||||||
|
);
|
||||||
|
|
||||||
|
@mixin port-forward-status-colors {
|
||||||
|
@each $status, $color in $port-forward-status-color-list {
|
||||||
|
&.#{$status} {
|
||||||
|
color: $color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -78,6 +78,10 @@ export class PortForwardItem implements ItemObject {
|
|||||||
getForwardPort() {
|
getForwardPort() {
|
||||||
return this.forwardPort;
|
return this.forwardPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStatus() {
|
||||||
|
return "Active"; // to-do allow port-forward-items to be stopped (without removing them)
|
||||||
|
}
|
||||||
|
|
||||||
getSearchFields() {
|
getSearchFields() {
|
||||||
return [
|
return [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user