mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allow port-forwards to be restarted with the same local port (#4097)
* allow port-forwards to be restarted with the same local port Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * address review comment Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
parent
0dab7b8073
commit
c0c0b3ae11
@ -49,7 +49,6 @@ const dialogState = observable.object({
|
||||
|
||||
@observer
|
||||
export class PortForwardDialog extends Component<Props> {
|
||||
@observable ready = false;
|
||||
@observable currentPort = 0;
|
||||
@observable desiredPort = 0;
|
||||
|
||||
@ -81,16 +80,13 @@ export class PortForwardDialog extends Component<Props> {
|
||||
|
||||
this.currentPort = +portForward.forwardPort;
|
||||
this.desiredPort = this.currentPort;
|
||||
this.ready = this.currentPort ? false : true;
|
||||
};
|
||||
|
||||
onClose = () => {
|
||||
this.ready = false;
|
||||
};
|
||||
|
||||
changePort = (value: string) => {
|
||||
this.desiredPort = Number(value);
|
||||
this.ready = Boolean(this.desiredPort == 0 || this.currentPort !== this.desiredPort);
|
||||
};
|
||||
|
||||
startPortForward = async () => {
|
||||
@ -170,7 +166,6 @@ export class PortForwardDialog extends Component<Props> {
|
||||
contentClass="flex gaps column"
|
||||
next={this.startPortForward}
|
||||
nextLabel={this.currentPort === 0 ? "Start" : "Restart"}
|
||||
disabledNext={!this.ready}
|
||||
>
|
||||
{this.renderContents()}
|
||||
</WizardStep>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user