mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-05-05 05:30:44 +08:00
fix: batch 2 audit fixes — diffSettings notify fields, slog migration, frontend constants
H5: diffSettings now tracks 5 balance/quota notify fields in audit log
M15: log.Printf audit log migrated to slog.Info, removed "log" import
M14: New frontend/src/constants/account.ts with shared constants
QuotaNotifyToggle.vue uses QUOTA_THRESHOLD_TYPE_FIXED/PERCENTAGE
L2: UsageTable.vue uses BILLING_MODE_TOKEN/IMAGE from billingMode.ts
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { QUOTA_THRESHOLD_TYPE_FIXED, QUOTA_THRESHOLD_TYPE_PERCENTAGE } from '@/constants/account'
|
||||
|
||||
defineProps<{
|
||||
enabled: boolean | null
|
||||
threshold: number | null
|
||||
@@ -35,17 +37,17 @@ const emit = defineEmits<{
|
||||
@input="emit('update:threshold', parseFloat(($event.target as HTMLInputElement).value) || null)"
|
||||
type="number"
|
||||
min="0"
|
||||
:max="thresholdType === 'percentage' ? 100 : undefined"
|
||||
:step="thresholdType === 'percentage' ? 1 : 0.01"
|
||||
:max="thresholdType === QUOTA_THRESHOLD_TYPE_PERCENTAGE ? 100 : undefined"
|
||||
:step="thresholdType === QUOTA_THRESHOLD_TYPE_PERCENTAGE ? 1 : 0.01"
|
||||
class="input py-1 text-sm flex-1 min-w-0"
|
||||
/>
|
||||
<select
|
||||
:value="thresholdType || 'fixed'"
|
||||
:value="thresholdType || QUOTA_THRESHOLD_TYPE_FIXED"
|
||||
@change="emit('update:thresholdType', ($event.target as HTMLSelectElement).value)"
|
||||
class="input py-1 text-xs w-[4.5rem] flex-shrink-0 text-center"
|
||||
>
|
||||
<option value="fixed">$</option>
|
||||
<option value="percentage">%</option>
|
||||
<option :value="QUOTA_THRESHOLD_TYPE_FIXED">$</option>
|
||||
<option :value="QUOTA_THRESHOLD_TYPE_PERCENTAGE">%</option>
|
||||
</select>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user