mirror of https://github.com/rancher/dashboard.git
Updating ingress page to include new requests
- Enable freeform target service - Add status support to LabeledSelect - Indicate that the target service isn't one of the existing options with LabeledSelect warning status - Update text https://github.com/rancher/dashboard/issues/272#issuecomment-642436439
This commit is contained in:
parent
6b914d70e0
commit
94ebf0783e
|
|
@ -23,6 +23,20 @@ TEXTAREA,
|
||||||
border: solid $outline-width var(--input-border);
|
border: solid $outline-width var(--input-border);
|
||||||
color: var(--input-text);
|
color: var(--input-text);
|
||||||
|
|
||||||
|
&:not(.focused) {
|
||||||
|
&.success {
|
||||||
|
border: solid 1px var(--success);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
border: solid 1px var(--warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.error {
|
||||||
|
border: solid 1px var(--error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:not(.view) {
|
&:not(.view) {
|
||||||
background-color: var(--input-bg);
|
background-color: var(--input-bg);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ export default {
|
||||||
|
|
||||||
&.error {
|
&.error {
|
||||||
background: var(--error-banner-bg);
|
background: var(--error-banner-bg);
|
||||||
border: solid 1px (--error);
|
border: solid 1px var(--error);
|
||||||
color: var(--error);
|
color: var(--error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
status: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
reduce: {
|
reduce: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: (e) => {
|
default: (e) => {
|
||||||
|
|
@ -152,7 +156,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="labeled-select labeled-input" :class="{disabled, focused, [mode]: true}">
|
<div class="labeled-select labeled-input" :class="{disabled, focused, [mode]: true, [status]: status }">
|
||||||
<div :class="{'labeled-container': true, raised, empty, [mode]: true}" :style="{border:'none'}">
|
<div :class="{'labeled-container': true, raised, empty, [mode]: true}" :style="{border:'none'}">
|
||||||
<label v-if="label">
|
<label v-if="label">
|
||||||
{{ label }}
|
{{ label }}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,11 @@ export default {
|
||||||
const service = this.serviceTargets.find(s => s.label === this.serviceName);
|
const service = this.serviceTargets.find(s => s.label === this.serviceName);
|
||||||
|
|
||||||
return service?.ports || [];
|
return service?.ports || [];
|
||||||
|
},
|
||||||
|
serviceTargetStatus() {
|
||||||
|
const isValueAnOption = !this.serviceName || this.serviceTargets.find(target => this.serviceName === target.value);
|
||||||
|
|
||||||
|
return isValueAnOption ? null : 'warning';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -54,10 +59,12 @@ export default {
|
||||||
<div class="col span-4">
|
<div class="col span-4">
|
||||||
<LabeledSelect
|
<LabeledSelect
|
||||||
v-model="serviceName"
|
v-model="serviceName"
|
||||||
|
:taggable="true"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
:label="t('ingress.defaultBackend.targetService.label')"
|
:label="t('ingress.defaultBackend.targetService.label')"
|
||||||
:options="serviceTargets"
|
:options="serviceTargets"
|
||||||
option-label="label"
|
option-label="label"
|
||||||
|
:status="serviceTargetStatus"
|
||||||
@input="update(); servicePort = ''"
|
@input="update(); servicePort = ''"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,14 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
portOptions() {
|
portOptions() {
|
||||||
const service = this.serviceTargets.find(s => s.label === this.serviceName);
|
const service = this.serviceTargets.find(s => s.label === this.value);
|
||||||
|
|
||||||
return service?.ports || [];
|
return service?.ports || [];
|
||||||
|
},
|
||||||
|
serviceTargetStatus() {
|
||||||
|
const isValueAnOption = !this.serviceName || this.serviceTargets.find(target => this.serviceName === target.value);
|
||||||
|
|
||||||
|
return isValueAnOption ? null : 'warning';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -51,6 +56,7 @@ export default {
|
||||||
option-label="label"
|
option-label="label"
|
||||||
option-key="label"
|
option-key="label"
|
||||||
:options="serviceTargets"
|
:options="serviceTargets"
|
||||||
|
:status="serviceTargetStatus"
|
||||||
:taggable="true"
|
:taggable="true"
|
||||||
@input="update(); servicePort = ''"
|
@input="update(); servicePort = ''"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue