Skip to content
Open
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: 1 addition & 1 deletion ui/src/components/view/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@
@onClick="$resetConfigurationValueConfirm(item, resetConfig)"
v-if="editableValueKey !== record.key"
icon="reload-outlined"
:disabled="!('updateConfiguration' in $store.getters.apis)"
:disabled="!('resetConfiguration' in $store.getters.apis) || record.value === record.defaultvalue"
/>
</template>
<template v-if="column.key === 'gpuDeviceActions'">
Expand Down
10 changes: 9 additions & 1 deletion ui/src/components/view/SettingsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
@search="handleSearch" />
<ConfigurationTable
:columns="columns"
:config="items" />
:config="items"
@refresh-config="handleConfigRefresh" />
</a-col>
</div>
</template>
Expand Down Expand Up @@ -139,6 +140,13 @@ export default {
handleSearch (value) {
this.filter = value
this.fetchData()
},
handleConfigRefresh (name, updatedRecord) {
if (!name || !updatedRecord) return
const index = this.items.findIndex(item => item.name === name)
if (index !== -1) {
this.items.splice(index, 1, updatedRecord)
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion ui/src/views/setting/ConfigurationHierarchy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<span :style="record.parent ? 'padding-left: 50px; display:block' : 'padding-left: 25px; display:block'">{{ record.description }}</span>
</template>
<template v-if="column.key === 'value'">
<ConfigurationValue :configrecord="record" />
<ConfigurationValue :configrecord="record" @refresh="handleConfigRefresh" />
</template>
</template>
</a-table>
Expand Down Expand Up @@ -83,6 +83,9 @@ export default {
return 'light-row'
}
return 'dark-row'
},
handleConfigRefresh (name, updatedRecord) {
this.$emit('refresh-config', name, updatedRecord)
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions ui/src/views/setting/ConfigurationTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
:count="count"
:page="page"
:pagesize="pagesize"
@change-page="changePage" />
@change-page="changePage"
@refresh-config="handleConfigRefresh" />
</a-tab-pane>
<a-tab-pane
v-for="(group) in groups"
Expand All @@ -74,7 +75,8 @@
:tab="subgroup.name" >
<ConfigurationHierarchy
:columns="columns"
:config="config" />
:config="config"
@refresh-config="handleConfigRefresh" />
</a-tab-pane>
</a-tabs>
</a-tab-pane>
Expand Down Expand Up @@ -322,6 +324,13 @@ export default {
'#' + this.$route.path
)
}
},
handleConfigRefresh (name, updatedRecord) {
if (!name || !updatedRecord) return
const index = this.config.findIndex(item => item.name === name)
if (index !== -1) {
this.config.splice(index, 1, updatedRecord)
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion ui/src/views/setting/ConfigurationTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<b> {{record.displaytext }} </b> {{ ' (' + record.name + ')' }} <br/> {{ record.description }}
</template>
<template v-if="column.key === 'value'">
<ConfigurationValue :configrecord="record" />
<ConfigurationValue :configrecord="record" @refresh="handleConfigRefresh" />
</template>
</template>
</a-table>
Expand Down Expand Up @@ -109,6 +109,9 @@ export default {
return 'config-light-row'
}
return 'config-dark-row'
},
handleConfigRefresh (name, updatedRecord) {
this.$emit('refresh-config', name, updatedRecord)
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions ui/src/views/setting/ConfigurationValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
@onClick="$resetConfigurationValueConfirm(configrecord, resetConfigurationValue)"
v-if="editableValueKey === null"
icon="reload-outlined"
:disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading)" />
:disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading || configrecord.value === configrecord.defaultvalue)" />
</span>
</a-list-item>
</a-list>
Expand Down Expand Up @@ -263,6 +263,7 @@ export default {
this.editableValueKey = null
},
updateConfigurationValue (configrecord) {
let configRecordEntry = this.configrecord
this.valueLoading = true
this.editableValueKey = null
var newValue = this.editableValue
Expand All @@ -281,7 +282,8 @@ export default {
value: newValue
}
postAPI('updateConfiguration', params).then(json => {
this.editableValue = this.getEditableValue(json.updateconfigurationresponse.configuration)
configRecordEntry = json.updateconfigurationresponse.configuration
this.editableValue = this.getEditableValue(configRecordEntry)
this.actualValue = this.editableValue
this.$emit('change-config', { value: newValue })
this.$store.dispatch('RefreshFeatures')
Expand All @@ -305,18 +307,20 @@ export default {
})
}).finally(() => {
this.valueLoading = false
this.$emit('refresh')
this.$emit('refresh', configrecord.name, configRecordEntry)
})
},
resetConfigurationValue (configrecord) {
let configRecordEntry = this.configrecord
this.valueLoading = true
this.editableValueKey = null
const params = {
[this.scopeKey]: this.$route.params?.id,
name: configrecord.name
}
postAPI('resetConfiguration', params).then(json => {
this.editableValue = this.getEditableValue(json.resetconfigurationresponse.configuration)
configRecordEntry = json.resetconfigurationresponse.configuration
this.editableValue = this.getEditableValue(configRecordEntry)
this.actualValue = this.editableValue
var newValue = this.editableValue
if (configrecord.type === 'Range') {
Expand Down Expand Up @@ -344,7 +348,7 @@ export default {
})
}).finally(() => {
this.valueLoading = false
this.$emit('refresh')
this.$emit('refresh', configrecord.name, configRecordEntry)
})
},
getEditableValue (configrecord) {
Expand Down
Loading