mirror of https://github.com/rancher/dashboard.git
change targetNamespace to targetServiceNamespace
This commit is contained in:
parent
c31f9b27ef
commit
5cb875cd84
|
|
@ -62,7 +62,7 @@ export default {
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
v-else
|
v-else
|
||||||
v-model="inputString"
|
v-model="string"
|
||||||
class="input-string"
|
class="input-string"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:disabled="disableInputs"
|
:disabled="disableInputs"
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,7 @@ export default {
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
class="inline"
|
class="inline"
|
||||||
:reduce="opt=>opt.value"
|
:reduce="opt=>opt.value"
|
||||||
|
label="value"
|
||||||
@input="update"
|
@input="update"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -223,6 +224,7 @@ export default {
|
||||||
:reduce="opt=>opt.value"
|
:reduce="opt=>opt.value"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
class="inline"
|
class="inline"
|
||||||
|
label="value"
|
||||||
@input="update"
|
@input="update"
|
||||||
/>
|
/>
|
||||||
<Checkbox v-if="kind==='app'" v-model="pickVersion" label="Target one version" />
|
<Checkbox v-if="kind==='app'" v-model="pickVersion" label="Target one version" />
|
||||||
|
|
@ -236,6 +238,7 @@ export default {
|
||||||
placeholder="Select a version"
|
placeholder="Select a version"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
class="inline"
|
class="inline"
|
||||||
|
label="value"
|
||||||
:reduce="opt=>opt.value"
|
:reduce="opt=>opt.value"
|
||||||
@input="update"
|
@input="update"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,9 @@ export default {
|
||||||
mixins: [CreateEditView, LoadDeps],
|
mixins: [CreateEditView, LoadDeps],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
let spec = this.value.spec;
|
const spec = this.value.spec ? JSON.parse(JSON.stringify(this.value.spec)) : {};
|
||||||
let kind = 'app';
|
let kind = 'app';
|
||||||
|
|
||||||
if ( !this.value.spec ) {
|
|
||||||
spec = {};
|
|
||||||
this.value.spec = spec;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( spec.ipAddresses ) {
|
if ( spec.ipAddresses ) {
|
||||||
kind = 'ip';
|
kind = 'ip';
|
||||||
} else if ( spec.fqdn ) {
|
} else if ( spec.fqdn ) {
|
||||||
|
|
@ -44,6 +39,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
spec,
|
||||||
kind,
|
kind,
|
||||||
ipAddresses: spec.ipAddresses,
|
ipAddresses: spec.ipAddresses,
|
||||||
fqdn: spec.fqdn,
|
fqdn: spec.fqdn,
|
||||||
|
|
@ -54,6 +50,17 @@ export default {
|
||||||
return KIND_LABELS;
|
return KIND_LABELS;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
update(spec) {
|
||||||
|
const targetNS = spec.targetNamespace;
|
||||||
|
|
||||||
|
if (targetNS) {
|
||||||
|
delete spec.targetNamespace;
|
||||||
|
spec.targetServiceNamespace = targetNS;
|
||||||
|
}
|
||||||
|
this.value.spec = spec;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -72,7 +79,7 @@ export default {
|
||||||
|
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
|
|
||||||
<Target v-model="value.spec" :kind-labels="kindLabels">
|
<Target v-model="spec" :kind-labels="kindLabels" @input="update">
|
||||||
<template v-slot:fqdn="slotProps">
|
<template v-slot:fqdn="slotProps">
|
||||||
<LabeledInput v-model="fqdn" :mode="mode" label="DNS FQDN" @input="e=>slotProps.update(e)" />
|
<LabeledInput v-model="fqdn" :mode="mode" label="DNS FQDN" @input="e=>slotProps.update(e)" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,14 @@ export default {
|
||||||
headers = [], methods = [], path = {}, cookies = []
|
headers = [], methods = [], path = {}, cookies = []
|
||||||
} = this.spec;
|
} = this.spec;
|
||||||
|
|
||||||
let hostHeader = { name: 'host', value: { exact: '' } };
|
let hostHeader;
|
||||||
|
|
||||||
if (headers.length) {
|
if (headers.length) {
|
||||||
hostHeader = pullAt(headers, findIndex(headers, header => header.name === 'host' && Object.keys(header.value)[0] === 'exact'))[0];
|
hostHeader = pullAt(headers, findIndex(headers, header => header.name === 'host' && Object.keys(header.value)[0] === 'exact'))[0];
|
||||||
}
|
}
|
||||||
|
if (!hostHeader) {
|
||||||
|
hostHeader = { name: 'host', value: { exact: '' } };
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
httpMethods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
|
httpMethods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
|
||||||
|
|
@ -42,7 +45,7 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
formatted() {
|
formatted() {
|
||||||
const all = {
|
const all = {
|
||||||
headers: !!this.host.value.exact ? [this.host, ...this.headers] : this.headers,
|
headers: !!this.host.value.exact ? [this.hostHeader, ...this.headers] : this.headers,
|
||||||
methods: this.methods,
|
methods: this.methods,
|
||||||
path: this.path,
|
path: this.path,
|
||||||
cookies: this.cookies
|
cookies: this.cookies
|
||||||
|
|
@ -94,7 +97,7 @@ export default {
|
||||||
const pathString = Object.values(stringmatch)[0];
|
const pathString = Object.values(stringmatch)[0];
|
||||||
const method = Object.keys(stringmatch)[0];
|
const method = Object.keys(stringmatch)[0];
|
||||||
|
|
||||||
if (!pathString.match(/^\/.+/)) {
|
if (pathString.charAt(0) !== '/') {
|
||||||
this.$set(this.path, method, `/${ pathString }`);
|
this.$set(this.path, method, `/${ pathString }`);
|
||||||
} else {
|
} else {
|
||||||
this.path[method] = pathString;
|
this.path[method] = pathString;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue