Skip to content

Commit

Permalink
fix: update retention days and instance label bindings in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Jan 24, 2025
1 parent fea1a2f commit 9027693
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions core/ui/src/views/settings/SettingsSystemLogs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
@click="
isEditRetentionDialogOpen = true;
lokiToEdit = instance;
retention_days = instance.retention_days;
"
:disabled="instance.offline"
>
Expand All @@ -119,6 +120,7 @@
@click="
isEditLabelDialogOpen = true;
lokiToEdit = instance;
instance_label = instance.instance_label;
"
:disabled="instance.offline"
>
Expand Down Expand Up @@ -191,7 +193,7 @@
<cv-form @submit.prevent="setLokiInstanceRetention">
<cv-text-input
:label="$t('system_logs.loki.retention')"
v-model="newRetention"
v-model="retention_days"
:helper-text="$t('system_logs.loki.days')"
ref="newRetention"
:invalid-message="error.newRetention"
Expand Down Expand Up @@ -231,7 +233,7 @@
$t('common.optional') +
')'
"
v-model.trim="newLabel"
v-model.trim="instance_label"
maxlength="24"
ref="newLabel"
:invalid-message="error.newLabel"
Expand Down Expand Up @@ -380,10 +382,10 @@ export default {
isSyslogConfigureDialogOpen: false,
isCloudLogManagerConfigureDialogOpen: false,
isUninstallDialogOpen: false,
instance_label: "",
retention_days: null,
lokiToUninstall: null,
userInputUninstall: "",
newRetention: null,
newLabel: "",
loading: {
lokiInstances: false,
subscription: false,
Expand Down Expand Up @@ -469,15 +471,15 @@ export default {
this.clearErrors(this);
let isValidationOk = true;

if (!this.newRetention) {
if (!this.retention_days) {
this.error.newRetention = this.$t("common.required");
isValidationOk = false;
}
if (this.newRetention && isNaN(this.newRetention)) {
if (this.retention_days && isNaN(this.retention_days)) {
this.error.newRetention = this.$t("system_logs.loki.valid_number");
isValidationOk = false;
}
if (this.newRetention && this.newRetention <= 0) {
if (this.retention_days && this.retention_days <= 0) {
this.error.newRetention = this.$t("system_logs.loki.greater_than_0");
isValidationOk = false;
}
Expand Down Expand Up @@ -510,7 +512,7 @@ export default {
this.createModuleTaskForApp(this.lokiToEdit.instance_id, {
action: taskAction,
data: {
retention_days: parseInt(this.newRetention),
retention_days: parseInt(this.retention_days),
},
extra: {
isNotificationHidden: true,
Expand Down Expand Up @@ -557,7 +559,7 @@ export default {
this.createModuleTaskForApp(this.lokiToEdit.instance_id, {
action: taskAction,
data: {
name: this.newLabel,
name: this.instance_label,
},
extra: {
title: this.$t("action." + taskAction),
Expand Down

0 comments on commit 9027693

Please sign in to comment.