feat(automations): add test run button and send log modal in admin

Expose run-now and sends APIs in the automations UI, show SMS hour and last run columns, and group advanced settings toolbar actions together.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 21:46:13 +03:30
co-authored by Cursor
parent 71bf8dfc47
commit 3838d0a56c
6 changed files with 149 additions and 32 deletions
+29 -29
View File
@@ -26,27 +26,26 @@
</label>
</div>
<!-- <a-button type="primary" :loading="loading" @click="add">افزودن تنظیم</a-button>-->
<a-button
v-if="isSystemMode"
type="primary"
class="settings-toolbar__action"
:loading="loading"
@click="add"
>
افزودن تنظیم
</a-button>
<a-button
v-if="isSystemMode"
class="settings-toolbar__action"
:loading="refreshingSuperAdmin"
@click="refreshFromSuperAdmin"
>
همگام‌سازی از سوپرادمین
</a-button>
<a-button class="settings-toolbar__action" :loading="loading" @click="initConfig">
بروزرسانی
</a-button>
<div class="settings-toolbar__actions">
<a-button
v-if="isSystemMode"
type="primary"
:loading="loading"
@click="add"
>
افزودن تنظیم
</a-button>
<a-button
v-if="isSystemMode"
:loading="refreshingSuperAdmin"
@click="refreshFromSuperAdmin"
>
همگام‌سازی از سوپرادمین
</a-button>
<a-button :loading="loading" @click="initConfig">
بروزرسانی
</a-button>
</div>
</div>
<a-spin :spinning="loading && !baseData.length">
@@ -210,7 +209,7 @@ import SettingValueField from './SettingValueField.vue'
import SettingCard from './SettingCard.vue'
import { refreshAppModeMenu } from '@/router'
import { useUserStore } from '@/store/userStore'
import { applyBannerEnabledFromRows, applyTrackingSystemsEnabledFromRows, applyConditionalOrderEnabledFromRows, applyAutomationEnabledFromRows, applyProductFundsEnabledFromRows, applyPriceTriggerEnabledFromRows, applyAppNotificationEnabledFromRows, applyPriceProviderFromRows, applyPriceChannelAccessFromRows, applySupportChatMenuEnabledFromRows, applyGroupSmsFromRows, applyCustomerSpecialPricingFromRows, setBannerEnabledFromSettings, setConditionalOrderEnabledFromSettings, setAutomationEnabledFromSettings, setProductFundsEnabledFromSettings, setPriceTriggerEnabledFromSettings, setAppNotificationEnabledFromSettings, setPriceProviderFromSettings, setPriceChannelAccessFromSettings, setStoreModeFromSettings, setTrackingSystemsEnabledFromSettings, setGroupSmsEnabledFromSettings, setCustomerSpecialPricingEnabledFromSettings } from '@/utils/config'
import { applyBannerEnabledFromRows, applyTrackingSystemsEnabledFromRows, applyConditionalOrderEnabledFromRows, applyAutomationEnabledFromRows, applyProductFundsEnabledFromRows, applyPriceTriggerEnabledFromRows, applyAppNotificationEnabledFromRows, applyPriceProviderFromRows, applyPriceChannelAccessFromRows, applySupportChatMenuEnabledFromRows, applyGroupSmsFromRows, applyCustomerSpecialPricingFromRows, applyCustomerDirectSmsFromRows, applyCustomerLevelProfitEnabledFromRows, setBannerEnabledFromSettings, setConditionalOrderEnabledFromSettings, setAutomationEnabledFromSettings, setProductFundsEnabledFromSettings, setPriceTriggerEnabledFromSettings, setAppNotificationEnabledFromSettings, setPriceProviderFromSettings, setPriceChannelAccessFromSettings, setStoreModeFromSettings, setTrackingSystemsEnabledFromSettings, setGroupSmsEnabledFromSettings, setCustomerSpecialPricingEnabledFromSettings } from '@/utils/config'
import {
EDITABLE_SETTING_GROUPS,
SYSTEM_SETTING_GROUPS,
@@ -493,14 +492,9 @@ async function refreshFromSuperAdmin() {
refreshingSuperAdmin.value = true
try {
const res = await refreshSuperAdminSettings()
const auto = res?.enable_automation
message.success(
auto != null && auto !== ''
? `همگام شد (${res?.count ?? 0} کلید) — اتوماسیون: ${isSwitchOn(auto) ? 'روشن' : 'خاموش'}`
: (res?.message || `همگام شد (${res?.count ?? 0} کلید)`)
)
await initConfig()
refreshMenuAfterStoreChange()
message.success(res?.message || `همگام شد (${res?.count ?? 0} کلید دسترسی از سوپرادمین)`)
} catch (e: any) {
console.error(e)
const msg = e?.response?.data?.message || e?.message || 'همگام‌سازی از سوپرادمین ناموفق بود'
@@ -523,6 +517,8 @@ async function initConfig() {
applyConditionalOrderEnabledFromRows(baseData.value)
applyAutomationEnabledFromRows(baseData.value)
applyProductFundsEnabledFromRows(baseData.value)
applyCustomerLevelProfitEnabledFromRows(baseData.value)
applyCustomerDirectSmsFromRows(baseData.value)
applyPriceTriggerEnabledFromRows(baseData.value)
applyAppNotificationEnabledFromRows(baseData.value)
applyPriceProviderFromRows(baseData.value)
@@ -815,7 +811,11 @@ async function ok() {
align-items: flex-end;
}
&__action {
&__actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
margin-inline-start: auto;
}
}