Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3306,6 +3306,8 @@
"state.expunging": "Expunging",
"state.migrating": "Migrating",
"state.pending": "Pending",
"state.readonly": "Read-Only",
"state.readwrite": "Read-Write",
"state.running": "Running",
"state.starting": "Starting",
"state.stopped": "Stopped",
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/view/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
<span v-else>{{ text }}</span>
</span>
<a slot="readonly" slot-scope="text, record">
<status :text="record.readonly ? 'ReadOnly' : 'ReadWrite'" />
<status :text="record.readonly ? 'ReadOnly' : 'ReadWrite'" displayText />
</a>
<span slot="created" slot-scope="text">
{{ $toLocaleDate(text) }}
Expand Down
8 changes: 7 additions & 1 deletion ui/src/components/widgets/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ export default {
case 'Error':
state = this.$t('state.error')
break
case 'ReadOnly':
state = this.$t('state.readonly')
break
case 'ReadWrite':
state = this.$t('state.readwrite')
break
}
return state.charAt(0).toUpperCase() + state.slice(1)
}
Expand Down Expand Up @@ -106,7 +112,6 @@ export default {
case 'Error':
case 'False':
case 'Stopped':
case 'ReadOnly':
status = 'error'
break
case 'Migrating':
Expand All @@ -126,6 +131,7 @@ export default {
case 'Created':
case 'Maintenance':
case 'Pending':
case 'ReadOnly':
status = 'warning'
break
}
Expand Down
5 changes: 4 additions & 1 deletion ui/src/config/section/infra/secondaryStorages.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export default {
columns: () => {
var fields = ['name', 'url', 'protocol', 'scope', 'zonename']
if (store.getters.apis.listImageStores.params.filter(x => x.name === 'readonly').length > 0) {
fields.push('readonly')
fields.push({
field: 'readonly',
customTitle: 'access'
})
}
return fields
},
Expand Down
16 changes: 12 additions & 4 deletions ui/src/views/AutogenView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,21 @@ export default {

const customRender = {}
for (var columnKey of this.columnKeys) {
var key = columnKey
let key = columnKey
let title = columnKey
if (typeof columnKey === 'object') {
key = Object.keys(columnKey)[0]
customRender[key] = columnKey[key]
if ('customTitle' in columnKey && 'field' in columnKey) {
key = columnKey.field
title = columnKey.customTitle
customRender[key] = columnKey[key]
} else {
key = Object.keys(columnKey)[0]
title = Object.keys(columnKey)[0]
customRender[key] = columnKey[key]
}
}
this.columns.push({
title: this.$t('label.' + String(key).toLowerCase()),
title: this.$t('label.' + String(title).toLowerCase()),
dataIndex: key,
scopedSlots: { customRender: key },
sorter: function (a, b) { return genericCompare(a[this.dataIndex] || '', b[this.dataIndex] || '') }
Expand Down