Skip to content

Commit

Permalink
Merge branch 'dev/1.10.5' into enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon committed Jan 24, 2025
2 parents a939419 + fcaacf2 commit 6140fcf
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/common/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { BridgeType } from '@/types/enum'

export const dateFormat = (
date: Date | string | number | (number | string)[] | null | undefined,
errorReturn?: string,
): string => {
return moment(date).format('YYYY-MM-DD HH:mm:ss')
const ret = moment(date).format('YYYY-MM-DD HH:mm:ss')
return ret === 'Invalid date' ? errorReturn ?? ret : ret
}

export const caseInsensitiveCompare = (w: string, k: string): boolean => {
Expand Down
8 changes: 8 additions & 0 deletions src/i18n/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ export default {
zh: '认证源',
en: 'Auth Source',
},
authzMongoLimit: {
zh: '记录条数限制',
en: 'Record Limit',
},
authzMongoSkip: {
zh: '跳过记录数',
en: 'Skip',
},
srvRecord: {
zh: 'SRV 记录',
en: 'SRV Record',
Expand Down
6 changes: 5 additions & 1 deletion src/i18n/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,11 @@ export default {
en: ' ',
},
lastModified: {
zh: '最后修改',
zh: '更新时间',
en: 'Last Modified',
},
createdAt: {
zh: '创建时间',
en: 'Created At',
},
}
8 changes: 8 additions & 0 deletions src/i18n/Extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ export default {
zh: '派发保留消息的最大速率',
en: 'The maximum rate of delivering retained messages',
},
maxPublishRate: {
zh: '最大发布速率',
en: 'Max Publish Rate',
},
maxPublishRateDesc: {
zh: '发布保留消息的最大速率。超过限制发布的消息会被投递,但不会存储为保留消息。',
en: 'The maximum rate of publishing retained messages. Messages that are published over the limit are delivered but not stored as retained.',
},
storageMethod: {
zh: '存储方式',
en: 'Storage Method',
Expand Down
1 change: 1 addition & 0 deletions src/types/extension.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Retainer {
allow_never_expire: boolean
msg_clear_interval: string
delivery_rate: string
max_publish_rate: string
backend: {
type: string
storage_type: string
Expand Down
12 changes: 12 additions & 0 deletions src/views/Auth/components/DatabaseConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@
</el-select>
</el-form-item>
</el-col>
<template v-if="!isAuthn">
<el-col :span="12">
<el-form-item :label="t('Auth.authzMongoLimit')">
<CustomInputNumber v-model="databaseConfig.limit" :min="1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="t('Auth.authzMongoSkip')">
<CustomInputNumber v-model="databaseConfig.skip" :min="0" />
</el-form-item>
</el-col>
</template>
</template>

<el-col :span="12">
Expand Down
13 changes: 13 additions & 0 deletions src/views/Config/BasicConfig/Retainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@
/>
</el-form-item>
</el-col>
<el-col :span="21" class="custom-col">
<el-form-item prop="max_publish_rate">
<template #label>
<FormItemLabel :label="tl('maxPublishRate')" :desc="tl('maxPublishRateDesc')" />
</template>
<InputWithUnit
v-model="retainerConfig.max_publish_rate"
:units="[{ label: `/${t('Base.second')}`, value: '/s' }]"
:disabled="!configEnable"
/>
</el-form-item>
</el-col>
<el-col :span="21" class="custom-col">
<el-form-item prop="delivery_rate">
<template #label>
Expand Down Expand Up @@ -202,6 +214,7 @@ let retainerConfig = ref<Retainer>({
msg_expiry_interval_override: DISABLED_VALUE,
allow_never_expire: true,
delivery_rate: '1000/s',
max_publish_rate: '1000/s',
backend: {
storage_type: 'ram',
type: 'built_in_database',
Expand Down
33 changes: 19 additions & 14 deletions src/views/RuleEngine/components/ActionAndSourceList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
row-key="id"
@sort-change="handleSortChange"
>
<el-table-column :label="tl('name')" :min-width="120" sortable="custom" prop="id">
<el-table-column :label="tl('name')" :min-width="172" sortable="custom" prop="id">
<template #default="{ row }">
<router-link :to="getDetailPageRoute(row.id)" class="first-column-with-icon-type">
<img v-if="row.type" class="icon-type" :src="getBridgeIcon(row.type)" />
Expand All @@ -26,7 +26,7 @@
<TargetItemStatus type="action" :target="row" />
</template>
</el-table-column>
<el-table-column prop="enable" :label="$t('Base.isEnabled')" :min-width="92" sortable>
<el-table-column prop="enable" :label="$t('Base.isEnabled')" :min-width="102" sortable>
<template #default="{ row }">
<OperateWebhookAssociatedPopover
:disabled="!judgeIsWebhookAction(row)"
Expand All @@ -47,20 +47,10 @@
:label="t('BridgeSchema.common.description.label')"
:min-width="108"
/>
<el-table-column
prop="last_modified_at"
:label="t('Base.lastModified')"
:min-width="162"
sortable
>
<template #default="{ row }">
{{ dateFormat(row.last_modified_at) }}
</template>
</el-table-column>
<el-table-column
sortable
prop="rules.length"
:min-width="120"
:min-width="168"
:label="tl('associatedRules')"
:sort-method="(row:BridgeItem) => row.rules?.length ?? 0"
>
Expand All @@ -80,7 +70,22 @@
</div>
</template>
</el-table-column>
<el-table-column :label="$t('Base.operation')" :min-width="168">
<el-table-column prop="created_at" :label="t('Base.createdAt')" :min-width="162" sortable>
<template #default="{ row }">
{{ dateFormat(row.created_at, '') }}
</template>
</el-table-column>
<el-table-column
prop="last_modified_at"
:label="t('Base.lastModified')"
:min-width="162"
sortable
>
<template #default="{ row }">
{{ dateFormat(row.last_modified_at, '') }}
</template>
</el-table-column>
<el-table-column :label="$t('Base.operation')" :min-width="180">
<template #default="{ row }">
<TableButton
v-if="
Expand Down

0 comments on commit 6140fcf

Please sign in to comment.