Skip to content

Commit

Permalink
refactor(global): update label prop of el-radio to value prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon authored and ysfscream committed Sep 20, 2024
1 parent 4fcf6a9 commit afc4267
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/components/OneofRefsSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/>
</el-select>
<el-radio-group v-else v-model="typeIndex" @change="handleTypeChanged">
<el-radio v-for="{ value, label } in typeOpts" :key="value" :label="value" border>
<el-radio v-for="{ value, label } in typeOpts" :key="value" :value="value" border>
<span>{{ label }}</span>
</el-radio>
</el-radio-group>
Expand Down
16 changes: 8 additions & 8 deletions src/views/Auth/AuthnCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
>
<el-radio
class="mechanism"
:label="value"
:value="value"
:disabled="addedAuthn.includes(value)"
border
>
Expand Down Expand Up @@ -60,10 +60,10 @@
v-if="!isDisabledDatabase(item.value)"
:value="$t('Base.added')"
class="item"
:hidden="((!addedAuthn.includes(`${mechanism}_${item.value}`) || gateway) as boolean)"
:hidden="!!(!addedAuthn.includes(`${mechanism}_${item.value}`) || gateway)"
>
<el-radio
:label="item.value"
:value="item.value"
class="backend"
border
:disabled="addedAuthn.includes(`${mechanism}_${item.value}`) && !gateway"
Expand All @@ -78,12 +78,12 @@
v-for="item in others"
:key="item.value"
:value="$t('Base.added')"
:hidden="(!addedAuthn.includes(`${mechanism}_${item.value}`) || gateway) as boolean"
:hidden="!!(!addedAuthn.includes(`${mechanism}_${item.value}`) || gateway)"
class="item"
>
<el-radio
:key="item.value"
:label="item.value"
:value="item.value"
class="backend"
border
:disabled="addedAuthn.includes(`${mechanism}_${item.value}`) && !gateway"
Expand Down Expand Up @@ -124,7 +124,7 @@
v-if="['mysql', 'postgresql', 'mongodb', 'redis'].includes(backend)"
v-model="configData"
ref="formCom"
:database="backend as DatabaseAndServerDOM"
:database="backend"
auth-type="authn"
/>
<built-in-config
Expand Down Expand Up @@ -276,7 +276,7 @@ const mechanismDesc = computed(
password_based: tl('passwordBasedDesc'),
jwt: tl('jwtDesc'),
scram: tl('scramDesc'),
}[mechanism.value] || ''),
})[mechanism.value] || '',
)
const hasDatabaseToChoose = computed(() => {
const { disabledDatabases } = props
Expand Down Expand Up @@ -379,7 +379,7 @@ const beforeNext = function () {
const { step, activeGuidesIndex, guideDescList, handleNext, handleBack } = useGuide(beforeNext)
const handleCreate = async function () {
let isVerified = (await formCom.value.validate().catch(() => {
const isVerified = (await formCom.value.validate().catch(() => {
jumpToErrorFormItem()
}))
? true
Expand Down
2 changes: 1 addition & 1 deletion src/views/Auth/AuthzCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
>
<el-radio
:key="item.value"
:label="item.value"
:value="item.value"
class="backend"
border
:disabled="addedAuthz.includes(item.value)"
Expand Down
6 changes: 3 additions & 3 deletions src/views/Auth/components/AuthnUsersImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</template>
<template #description>
<el-radio-group v-model="passwordType">
<el-radio label="plain" border>{{ $t('Auth.plaintextPassword') }}</el-radio>
<el-radio label="hash" border>{{ $t('Auth.encryptedPassword') }}</el-radio>
<el-radio value="plain" border>{{ $t('Auth.plaintextPassword') }}</el-radio>
<el-radio value="hash" border>{{ $t('Auth.encryptedPassword') }}</el-radio>
</el-radio-group>
</template>
</el-step>
Expand Down Expand Up @@ -60,7 +60,7 @@
</el-step>
</el-steps>

<template #footer class="dialog-footer">
<template #footer>
<el-button @click="dialogVisible = false">{{ $t('Base.cancel') }}</el-button>
<el-button type="primary" @click="importData" :loading="importLoading">{{
$t('Base.import')
Expand Down
2 changes: 1 addition & 1 deletion src/views/Auth/components/AuthzManager.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="authz-manager">
<el-radio-group v-model="type">
<el-radio-button v-for="item in typeList" :key="item.value" :label="item.value" border>
<el-radio-button v-for="item in typeList" :key="item.value" :value="item.value" border>
{{ item.label }}
</el-radio-button>
</el-radio-group>
Expand Down
4 changes: 2 additions & 2 deletions src/views/Auth/components/JwtConfig.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="jwt-config config">
<el-radio-group v-model="jwtConfig.use_jwks" @change="handleUseJWKSChanged">
<el-radio-button :label="false" border> JWT </el-radio-button>
<el-radio-button :label="true" border> JWKS </el-radio-button>
<el-radio-button :value="false" border> JWT </el-radio-button>
<el-radio-button :value="true" border> JWKS </el-radio-button>
</el-radio-group>
<el-form
ref="formCom"
Expand Down
2 changes: 1 addition & 1 deletion src/views/Config/Monitoring/MonitoringIntegration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:span="12"
class="col-radio"
>
<el-radio class="platform-radio" :label="item.label" border>
<el-radio class="platform-radio" :value="item.label" border>
<img class="img-platform" height="52" :src="item.img" :alt="item.label" />
<span class="platform-name"> {{ item.label }} </span>
</el-radio>
Expand Down
4 changes: 2 additions & 2 deletions src/views/Dashboard/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<el-col :span="8" :lg="9">
<el-card class="rate-card">
<!-- <el-radio-group class="rate-type-radio" v-model="rateType" size="small">
<el-radio-button label="byte" />
<el-radio-button label="msg"> {{ $t('Dashboard.messageNumber') }} </el-radio-button>
<el-radio-button value="byte" />
<el-radio-button value="msg"> {{ $t('Dashboard.messageNumber') }} </el-radio-button>
</el-radio-group> -->
<template v-if="rateType === 'msg'">
<div class="rate-item">
Expand Down
2 changes: 1 addition & 1 deletion src/views/Plugins/Plugins.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="filters">
<el-input :placeholder="$t('Plugins.searchPlaceholder')" v-model="keyForSearch" />
<el-radio-group v-model="filterStatus">
<el-radio-button v-for="{ label, value } in statusOptions" :key="value" :label="value">
<el-radio-button v-for="{ label, value } in statusOptions" :key="value" :value="value">
{{ label }}
({{ statusCounter[value as keyof typeof statusCounter] }})
</el-radio-button>
Expand Down
2 changes: 1 addition & 1 deletion src/views/RuleEngine/Bridge/BridgeCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<el-radio-group class="target-type-select" v-model="chosenBridgeType">
<el-row :gutter="28">
<el-col v-for="item in bridgeTypeOptions" :key="item.label" :span="8">
<el-radio class="target-type-item" :label="item.value" border>
<el-radio class="target-type-item" :value="item.value" border>
<img
class="target-type-item-img"
height="64"
Expand Down
2 changes: 1 addition & 1 deletion src/views/RuleEngine/Connector/components/TypeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<el-radio-group class="target-type-select is-connector" v-model="chosenBridgeType">
<el-row :gutter="28">
<el-col v-for="item in connectorTypeList" :key="item.label" :span="8">
<el-radio class="target-type-item" :label="item.value" border>
<el-radio class="target-type-item" :value="item.value" border>
<img
class="target-type-item-img"
height="64"
Expand Down
2 changes: 1 addition & 1 deletion src/views/RuleEngine/components/LogDataDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<el-radio-button
v-for="(logItem, logMsg) in targetLogData.info"
:key="logMsg"
:label="logMsg"
:value="logMsg"
>
{{ getLogItemTitle(targetLogData, logMsg as LogMsg) }}
</el-radio-button>
Expand Down
4 changes: 2 additions & 2 deletions src/views/RuleEngine/components/TestSQLContextForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</div>
<div class="payload-type">
<el-radio-group v-model="payloadType">
<el-radio :label="PayloadType.JSON">JSON</el-radio>
<el-radio :label="PayloadType.Plaintext">Plaintext</el-radio>
<el-radio :value="PayloadType.JSON">JSON</el-radio>
<el-radio :value="PayloadType.Plaintext">Plaintext</el-radio>
</el-radio-group>
</div>
<StretchHeight v-model="payloadEditorHeight" class="payload" />
Expand Down
12 changes: 6 additions & 6 deletions src/views/Webhook/components/Trigger.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="webhook-trigger">
<el-radio-group v-model="selectedType" class="ml-4">
<el-radio :label="TriggerType.Messages">{{ tl('messages') }}</el-radio>
<el-radio :value="TriggerType.Messages">{{ tl('messages') }}</el-radio>
<div class="sub-selector" v-if="selectedType === TriggerType.Messages">
<el-checkbox-group v-model="selectedMsgEventList">
<el-checkbox v-for="{ event, title } in msgEventOpts" :key="event" :label="event">
<el-checkbox v-for="{ event, title } in msgEventOpts" :key="event" :value="event">
{{ getEventLabel(title) }}
</el-checkbox>
</el-checkbox-group>
Expand Down Expand Up @@ -38,16 +38,16 @@
</el-button>
</div>
</div>
<el-radio :label="TriggerType.Events">{{ tl('events') }}</el-radio>
<el-radio :value="TriggerType.Events">{{ tl('events') }}</el-radio>
<div class="sub-selector" v-if="selectedType === TriggerType.Events">
<el-checkbox-group v-model="selectedOtherEventList">
<el-checkbox v-for="{ event, title } in otherEventOpts" :key="event" :label="event">
<el-checkbox v-for="{ event, title } in otherEventOpts" :key="event" :value="event">
{{ getEventLabel(title) }}
</el-checkbox>
</el-checkbox-group>
</div>

<el-radio :label="TriggerType.All">{{ tl('allMsgsAndEvents') }}</el-radio>
<el-radio :value="TriggerType.All">{{ tl('allMsgsAndEvents') }}</el-radio>
</el-radio-group>
</div>
</template>
Expand Down Expand Up @@ -93,7 +93,7 @@ const props = defineProps({
const emit = defineEmits(['update:modelValue'])
// To prevent infinite loops
let nowSQL = ref('')
const nowSQL = ref('')
const { state } = useStore()
const { t, tl } = useI18nTl('RuleEngine')
Expand Down

0 comments on commit afc4267

Please sign in to comment.