feat(source2): lock dark mode, sans-serif typography, and all recent updates

This commit is contained in:
rafif committed 2026-08-20 23:02:00 +07:00
1 parent dd4c8f6876
commit 9f24b56e97
259 files changed
+15596 -8966

No files matched your search

+2 -2
View File
@@ -77,11 +77,11 @@ try {
});
assert('Nexus site UUID should return Nexus branding', brand4.name === 'Nexus' && brand4.logo === '/nexus-logo.png');
// Test Case 5: Nexus fallback on demoplace.my.id when no site is selected
// Test Case 5: Default fallback on demoplace.my.id when no site is selected
const brand5 = runGetSiteBranding({
hostname: 'demoplace.my.id'
});
assert('Fallback on demoplace.my.id should be Nexus branding', brand5.name === 'Nexus' && brand5.logo === '/nexus-logo.png');
assert('Fallback on demoplace.my.id should be BackOne branding', brand5.name === 'BackOne' && brand5.logo === '/backone-logo.png');
console.log(`\n=========================================`);
console.log(` RESULT: ${passedCount} / ${testCount} tests passed.`);
+2 -1
View File
@@ -13,7 +13,8 @@ const dash = fs.readFileSync('backend/routes/dashboard.js','utf8') +
fs.readFileSync('backend/routes/dashboard/tls.js','utf8') +
fs.readFileSync('backend/routes/dashboard/telemetry.js','utf8') +
fs.readFileSync('backend/routes/dashboard/events.js','utf8');
const api = fs.readFileSync('src/lib/api.ts','utf8');
const api = fs.readFileSync('src/lib/api.ts','utf8') +
fs.readFileSync('src/lib/api-types.ts','utf8');
console.log('=== Field Name Alignment: Backend ↔ Frontend ===\n');
+64
View File
@@ -0,0 +1,64 @@
// test/multipart_proxy_test.js
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const ROOT = path.join(__dirname, '..');
console.log('=========================================');
console.log(' RUNNING TDD TESTS FOR MULTIPART PROXIES');
console.log('=========================================\n');
let testCount = 0;
let passedCount = 0;
function runAssert(label, condition) {
testCount++;
if (condition) {
console.log(` ✓ PASSED: ${label}`);
passedCount++;
} else {
console.error(` ✗ FAILED: ${label}`);
}
}
try {
// Test Case 1: Cek keberadaan file src/app/api/auth/admin/create-external-user/route.ts
const createRoutePath = path.join(ROOT, 'src', 'app', 'api', 'auth', 'admin', 'create-external-user', 'route.ts');
const createExists = fs.existsSync(createRoutePath);
runAssert('create-external-user/route.ts should exist', createExists);
if (createExists) {
const content = fs.readFileSync(createRoutePath, 'utf8');
runAssert('create-external-user/route.ts should export POST handler', content.includes('export async function POST'));
runAssert('create-external-user/route.ts should read req.json(), req.body or req.formData()', content.includes('req.json()') || content.includes('req.body') || content.includes('req.formData()'));
runAssert('create-external-user/route.ts should forward auth cookie', content.includes('Cookie') || content.includes('cookie'));
runAssert('create-external-user/route.ts should use NEXT_PUBLIC_API_URL or port 3011', content.includes('NEXT_PUBLIC_API_URL') || content.includes('3011'));
}
// Test Case 2: Cek keberadaan file src/app/api/auth/admin/update-agent-user/route.ts
const updateRoutePath = path.join(ROOT, 'src', 'app', 'api', 'auth', 'admin', 'update-agent-user', 'route.ts');
const updateExists = fs.existsSync(updateRoutePath);
runAssert('update-agent-user/route.ts should exist', updateExists);
if (updateExists) {
const content = fs.readFileSync(updateRoutePath, 'utf8');
runAssert('update-agent-user/route.ts should export POST handler', content.includes('export async function POST'));
runAssert('update-agent-user/route.ts should read req.json(), req.body or req.formData()', content.includes('req.json()') || content.includes('req.body') || content.includes('req.formData()'));
runAssert('update-agent-user/route.ts should forward auth cookie', content.includes('Cookie') || content.includes('cookie'));
runAssert('update-agent-user/route.ts should use NEXT_PUBLIC_API_URL or port 3011', content.includes('NEXT_PUBLIC_API_URL') || content.includes('3011'));
}
console.log(`\n=========================================`);
console.log(` RESULT: ${passedCount} / ${testCount} tests passed.`);
console.log(`=========================================\n`);
if (passedCount !== testCount) {
process.exit(1);
} else {
process.exit(0);
}
} catch (err) {
console.error('Test execution failed with error:', err);
process.exit(1);
}
+26
View File
@@ -33,6 +33,32 @@ async function runTests() {
await mongoose.connect(MONGODB_URI);
console.log('✓ Connected to MongoDB');
// Ensure at least one summary document exists for both SIAB and Nexus
const dbConnection = mongoose.connection.db;
const hasSiabSummary = await dbConnection.collection('summaries').findOne({ site_uuid: '6681452d_9cae_4ff4_8ae8_0d504774265e' });
if (!hasSiabSummary) {
await dbConnection.collection('summaries').insertOne({
timestamp: new Date(),
agent_uuid: 'mock_siab_agent_uuid',
site_uuid: '6681452d_9cae_4ff4_8ae8_0d504774265e',
bandwidth_down: 100,
bandwidth_up: 50,
active_flows: 10
});
}
const hasNexusSummary = await dbConnection.collection('summaries').findOne({ site_uuid: 'd7902405_0dc2_458b_8584_ed4d24b64f24' });
if (!hasNexusSummary) {
await dbConnection.collection('summaries').insertOne({
timestamp: new Date(),
agent_uuid: 'mock_nexus_agent_uuid',
site_uuid: 'd7902405_0dc2_458b_8584_ed4d24b64f24',
bandwidth_down: 100,
bandwidth_up: 50,
active_flows: 10
});
}
// 2. Validate User Accounts Seeding
const adminUser = await User.findOne({ username: 'admin' });
assert('User "admin" should exist', !!adminUser);
+2 -2
View File
@@ -20,7 +20,7 @@ const SSH = {
readyTimeout: 60000
};
const REMOTE_ROOT = '/home/adminbackend/web/demoplace.my.id/public_html';
const REMOTE_ROOT = '/home/adminbackend/web/dev.demoplace.my.id/public_html';
const LOCAL_ROOT = path.join(__dirname, '..');
let testCount = 0;
@@ -66,7 +66,7 @@ const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const root = '/home/adminbackend/web/demoplace.my.id/public_html';
const root = '/home/adminbackend/web/dev.demoplace.my.id/public_html';
function getMD5(filePath) {
try {