Merge pull request #1047 from westlywright/bug.service.labels

Service Bugs
This commit is contained in:
Vincent Fiduccia 2020-08-18 13:42:34 -07:00 committed by GitHub
commit 8ede12d7a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 6 deletions

View File

@ -38,6 +38,11 @@ export default {
scrollOnChange: { scrollOnChange: {
type: Boolean, type: Boolean,
default: false default: false
},
tabsUseHistoryReplace: {
type: Boolean,
default: true,
} }
}, },
@ -168,7 +173,11 @@ export default {
select(name/* , event */) { select(name/* , event */) {
const { const {
sortedTabs, sortedTabs,
$route: { hash: routeHash }, tabsUseHistoryReplace,
$route: {
hash: routeHash,
fullPath
},
} = this; } = this;
const selected = this.find(name); const selected = this.find(name);
@ -183,7 +192,13 @@ export default {
} }
if (routeHash !== hashName) { if (routeHash !== hashName) {
window.location.hash = `#${ name }`; if (tabsUseHistoryReplace) {
const fullPathWOHash = fullPath.includes('#') ? fullPath.split('#')[0] : fullPath;
window.history.replaceState(null, '', `${ fullPathWOHash }#${ name }`);
} else {
window.location.hash = `#${ name }`;
}
} }
for ( const tab of sortedTabs ) { for ( const tab of sortedTabs ) {

View File

@ -125,7 +125,7 @@ export default {
<th v-if="specType !== 'NodePort'" class="port-protocol"> <th v-if="specType !== 'NodePort'" class="port-protocol">
<t k="servicePorts.rules.protocol.label" /> <t k="servicePorts.rules.protocol.label" />
</th> </th>
<th v-if="specType !== 'Headless'" class="target-port"> <th class="target-port">
<t k="servicePorts.rules.target.label" /> <t k="servicePorts.rules.target.label" />
</th> </th>
<th v-if="specType === 'NodePort' || specType === 'LoadBalancer'" class="node-port"> <th v-if="specType === 'NodePort' || specType === 'LoadBalancer'" class="node-port">
@ -173,7 +173,7 @@ export default {
@input="queueUpdate" @input="queueUpdate"
/> />
</td> </td>
<td v-if="specType !== 'Headless'" class="target-port"> <td class="target-port">
<span v-if="isView">{{ row.targetPort }}</span> <span v-if="isView">{{ row.targetPort }}</span>
<input <input
v-else v-else

View File

@ -204,7 +204,7 @@ export default {
</div> </div>
</div> </div>
</Tab> </Tab>
<Tab v-else name="define-external-name" :label="t('servicesPage.ips.define')"> <Tab v-else name="define-service-ports" :label="t('servicesPage.ips.define')">
<ServicePorts <ServicePorts
v-model="value.spec.ports" v-model="value.spec.ports"
class="col span-12" class="col span-12"
@ -325,7 +325,7 @@ export default {
<div class="row labels-row"> <div class="row labels-row">
<Labels <Labels
:default-container-class="'labels-and-annotations-container'" :default-container-class="'labels-and-annotations-container'"
:value="value.spec" :value="value"
:mode="mode" :mode="mode"
:display-side-by-side="false" :display-side-by-side="false"
/> />