Skip to content

Commit 671b6e9

Browse files
committed
Ẩn nhãn verifier dev trên UI
1 parent 9a397bd commit 671b6e9

4 files changed

Lines changed: 39 additions & 3 deletions

File tree

frontend/src/App.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,8 +2776,8 @@ const ledgerTrendingProjects = computed(() => {
27762776
});
27772777
const ledgerChainRows = computed(() => [
27782778
{ label: 'Token', value: tokenSymbol.value },
2779-
{ label: 'Payment mode', value: runtimeConfig.value?.payment_mode || 'not loaded' },
2780-
{ label: 'Repo provider', value: runtimeConfig.value?.repo_provider || 'not loaded' },
2779+
{ label: 'Payment mode', value: paymentModeLabel(runtimeConfig.value?.payment_mode) },
2780+
{ label: 'Repo provider', value: repoProviderLabel(runtimeConfig.value?.repo_provider) },
27812781
]);
27822782
const ledgerFooterStats = computed(() => [
27832783
{ value: formatLedgerMRGFromCents(publicVerifiedFundingCents.value), label: 'Verified funding' },
@@ -3876,6 +3876,24 @@ function toTitleLabel(value = '') {
38763876
.join(' ');
38773877
}
38783878
3879+
function paymentModeLabel(value = '') {
3880+
const normalized = String(value || '').trim().toLowerCase();
3881+
return {
3882+
'live-adapters': 'Live payment adapters',
3883+
'local-dev-verifier': 'MergeOS verifier',
3884+
'not-configured': 'Not configured',
3885+
'': 'Not loaded',
3886+
}[normalized] || toTitleLabel(value);
3887+
}
3888+
3889+
function repoProviderLabel(value = '') {
3890+
const normalized = String(value || '').trim().toLowerCase();
3891+
if (!normalized) return 'Not loaded';
3892+
if (normalized.startsWith('github-private:')) return 'GitHub private repos';
3893+
if (normalized === 'local-git') return 'MergeOS repositories';
3894+
return toTitleLabel(value);
3895+
}
3896+
38793897
function formatMarketplaceDate(value) {
38803898
const date = value ? new Date(value) : null;
38813899
if (!date || Number.isNaN(date.getTime())) return 'Funded';

scan/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ import {
275275
ledgerTypeMeta,
276276
normalizeExplorerPath,
277277
parseExplorerRoute,
278+
paymentModeLabel,
278279
shortHash,
279280
sortLedgerEntries,
280281
tokenAmountFromCents,
@@ -303,7 +304,7 @@ const typeFilter = ref('all');
303304
const route = ref(parseRoute());
304305
305306
const tokenSymbol = computed(() => config.value?.token_symbol || marketplace.value?.stats?.token_symbol || 'MRG');
306-
const paymentMode = computed(() => config.value?.payment_mode || 'not configured');
307+
const paymentMode = computed(() => paymentModeLabel(config.value?.payment_mode));
307308
const githubOAuthReady = computed(() => Boolean(config.value?.github_oauth_ready && config.value?.github_oauth_client_id));
308309
const networkLabel = computed(() => config.value?.environment === 'production' ? 'MergeOS main ledger' : 'MergeOS ledger');
309310
const linkedGitHubUsername = computed(() => cleanGitHubUsername(

scan/src/explorer.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ export function toTitleLabel(value = '') {
5656
.join(' ');
5757
}
5858

59+
export function paymentModeLabel(value = '') {
60+
const normalized = String(value || '').trim().toLowerCase();
61+
return {
62+
'live-adapters': 'Live payment adapters',
63+
'local-dev-verifier': 'MergeOS verifier',
64+
'not-configured': 'Not configured',
65+
'': 'Not configured',
66+
}[normalized] || toTitleLabel(value);
67+
}
68+
5969
export function ledgerTypeMeta(type = '') {
6070
const normalized = String(type || '').toLowerCase();
6171
const fallback = { label: toTitleLabel(normalized || 'Ledger Entry'), tone: 'neutral', direction: 'neutral' };

scan/src/explorer.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
githubUsernameFromAccount,
1111
normalizeExplorerPath,
1212
parseExplorerRoute,
13+
paymentModeLabel,
1314
tokenAmountFromCents,
1415
verifyLedgerChain,
1516
} from './explorer.js';
@@ -76,6 +77,12 @@ test('treats github aliases as short public addresses', () => {
7677
assert.equal(accountRole('github:hummusonrails'), 'GitHub Contributor');
7778
});
7879

80+
test('shows production-friendly payment mode labels', () => {
81+
assert.equal(paymentModeLabel('local-dev-verifier'), 'MergeOS verifier');
82+
assert.equal(paymentModeLabel('live-adapters'), 'Live payment adapters');
83+
assert.equal(paymentModeLabel(''), 'Not configured');
84+
});
85+
7986
test('parses history routes and legacy hash routes', () => {
8087
assert.deepEqual(parseExplorerRoute('/address/wallet%3A0x123', ''), { name: 'address', value: 'wallet:0x123' });
8188
assert.deepEqual(parseExplorerRoute('/', '#/tx/bbbbbbbb'), { name: 'tx', value: 'bbbbbbbb' });

0 commit comments

Comments
 (0)