Made-with: Cursor
This commit is contained in:
+15
-2
@@ -76,6 +76,14 @@ function loadFilterPresets() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Подпись аккаунта в select: при фильтре по одному хостеру — только имя, иначе «хостер / аккаунт». */
|
||||||
|
function accountSelectLabel(account, providerById, scopedProviderId) {
|
||||||
|
const name = account.name?.trim() || '—'
|
||||||
|
if (scopedProviderId) return name
|
||||||
|
const providerName = providerById.get(account.providerId)?.name ?? '—'
|
||||||
|
return `${providerName} / ${name}`
|
||||||
|
}
|
||||||
|
|
||||||
function vpsMonthlyEstimateInBase(item, baseCurrency, ratesData) {
|
function vpsMonthlyEstimateInBase(item, baseCurrency, ratesData) {
|
||||||
if (item.status !== 'active') return 0
|
if (item.status !== 'active') return 0
|
||||||
const tariffType = item.tariffType || (Number(item.dailyRate || 0) > 0 ? 'daily' : 'monthly')
|
const tariffType = item.tariffType || (Number(item.dailyRate || 0) > 0 ? 'daily' : 'monthly')
|
||||||
@@ -135,6 +143,11 @@ export function VpsPage({ db, actions, settings, ratesData }) {
|
|||||||
() => db.providerAccounts.filter((a) => a.apiType === 'billmanager' && a.apiBaseUrl),
|
() => db.providerAccounts.filter((a) => a.apiType === 'billmanager' && a.apiBaseUrl),
|
||||||
[db.providerAccounts],
|
[db.providerAccounts],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const providerById = useMemo(
|
||||||
|
() => new Map(db.providers.map((p) => [p.id, p])),
|
||||||
|
[db.providers],
|
||||||
|
)
|
||||||
const [filters, setFilters] = useState({
|
const [filters, setFilters] = useState({
|
||||||
search: '',
|
search: '',
|
||||||
providerId: '',
|
providerId: '',
|
||||||
@@ -742,7 +755,7 @@ export function VpsPage({ db, actions, settings, ratesData }) {
|
|||||||
<option value="">Все аккаунты</option>
|
<option value="">Все аккаунты</option>
|
||||||
{accountFilterOptions.map((account) => (
|
{accountFilterOptions.map((account) => (
|
||||||
<option key={account.id} value={account.id}>
|
<option key={account.id} value={account.id}>
|
||||||
{account.name}
|
{accountSelectLabel(account, providerById, filters.providerId)}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
@@ -1452,7 +1465,7 @@ export function VpsPage({ db, actions, settings, ratesData }) {
|
|||||||
<option value="">— Выберите —</option>
|
<option value="">— Выберите —</option>
|
||||||
{accountOptions.map((account) => (
|
{accountOptions.map((account) => (
|
||||||
<option key={account.id} value={account.id}>
|
<option key={account.id} value={account.id}>
|
||||||
{account.name}
|
{accountSelectLabel(account, providerById, form.providerId)}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user