๐ Test Statistics Cards
Tanggal Test: 16/08/2026 12:13:12
Status: STATISTICS CARDS IMPLEMENTED
โ
1. Statistics Cards yang Ditambahkan
| Card |
Icon |
Color |
Calculation |
Status |
| Total Kendaraan |
directions_car |
Primary (Blue) |
vehicles.value.length |
โ
ADDED |
| Mesin Hidup |
power |
Positive (Green) |
StatusMesin === 'Hidup' |
โ
ADDED |
| Mesin Mati |
power_off |
Negative (Red) |
StatusMesin === 'Mati' |
โ
ADDED |
| Overspeed >50 km/h |
speed |
Warning (Orange) |
Kecepatan > 50 |
โ
ADDED |
๐ง 2. Implementation Details
Template Structure:
<!-- Statistics Cards -->
<div v-if="!loading && !error" class="row q-gutter-md q-mb-xl">
<!-- Total Kendaraan -->
<div class="col-12 col-sm-6 col-lg-3">
<q-card class="shadow-1 stats-card">
<q-card-section class="text-center">
<q-icon name="directions_car" color="primary" size="32px" />
<div class="text-h4 text-weight-bold text-primary">{{ totalVehicles }}</div>
<div class="text-body2 text-grey-7">Total Kendaraan</div>
</q-card-section>
</q-card>
</div>
<!-- ... other cards -->
</div>
Computed Properties:
// Total kendaraan
const totalVehicles = computed(() => {
return vehicles.value.length
})
// Mesin hidup
const engineOnCount = computed(() => {
return vehicles.value.filter(vehicle => vehicle.StatusMesin === 'Hidup').length
})
// Mesin mati
const engineOffCount = computed(() => {
return vehicles.value.filter(vehicle => vehicle.StatusMesin === 'Mati').length
})
// Overspeed >50 km/h
const overspeedCount = computed(() => {
return vehicles.value.filter(vehicle => {
const speed = parseFloat(vehicle.Kecepatan) || 0
return speed > 50
}).length
})
๐งช 3. Test Scenarios
Scenario 1: Sample Data Calculation
Misalkan ada 10 kendaraan dengan data berikut:
| Vehicle |
StatusMesin |
Kecepatan |
Contributes To |
| Vehicle 1 |
Hidup |
45 km/h |
Total, Mesin Hidup |
| Vehicle 2 |
Hidup |
65 km/h |
Total, Mesin Hidup, Overspeed |
| Vehicle 3 |
Mati |
0 km/h |
Total, Mesin Mati |
| Vehicle 4 |
Hidup |
80 km/h |
Total, Mesin Hidup, Overspeed |
| Vehicle 5 |
Mati |
0 km/h |
Total, Mesin Mati |
Expected Results:
10
Total Kendaraan
3
Mesin Hidup
2
Mesin Mati
2
Overspeed >50 km/h
Scenario 2: Edge Cases
| Case |
Data |
Expected Result |
Status |
| No Vehicles |
vehicles = [] |
All counts = 0 |
โ To Test |
| All Engines Off |
All StatusMesin = 'Mati' |
engineOnCount = 0 |
โ To Test |
| All Engines On |
All StatusMesin = 'Hidup' |
engineOffCount = 0 |
โ To Test |
| No Overspeed |
All Kecepatan โค 50 |
overspeedCount = 0 |
โ To Test |
| All Overspeed |
All Kecepatan > 50 |
overspeedCount = totalVehicles |
โ To Test |
๐จ 4. Visual Design
Card Layout:
- Grid: row with col-12 col-sm-6 col-lg-3 (responsive)
- Spacing: q-gutter-md between cards
- Margin: q-mb-xl below statistics section
- Style: shadow-1 stats-card with hover effects
Card Content:
- Icon: 32px size with color matching theme
- Number: text-h4 text-weight-bold with theme color
- Label: text-body2 text-grey-7
- Alignment: text-center
Color Scheme:
| Card |
Color |
Hex Code |
Usage |
| Total Kendaraan |
Primary |
#1976d2 |
General information |
| Mesin Hidup |
Positive |
#4caf50 |
Good status (engines on) |
| Mesin Mati |
Negative |
#f44336 |
Alert status (engines off) |
| Overspeed |
Warning |
#ff9800 |
Warning status (speed violation) |
๐ 5. Testing Instructions
Step 1: Akses Customer Asset Page
- Login: Login Page
- Credentials: dayansgi / dayansgi123
- Navigate: Customer Asset Page
Step 2: Verifikasi Statistics Cards
| What to Check |
How to Check |
Expected Result |
| Cards Position |
Look at top of page above vehicle cards |
4 cards in a row (responsive layout) |
| Total Kendaraan |
Count vehicle cards below |
Number matches actual vehicle count |
| Mesin Hidup |
Count green status chips |
Number matches "Hidup" status count |
| Mesin Mati |
Count red status chips |
Number matches "Mati" status count |
| Overspeed |
Count vehicles with speed >50 km/h |
Number matches high speed vehicles |
Step 3: Responsive Testing
- Desktop (โฅ1024px): 4 cards in one row
- Tablet (768-1023px): 2 cards per row
- Mobile (<768px): 1 card per row
Step 4: Data Accuracy
- Manually count vehicles and verify totals
- Check engine status distribution
- Verify overspeed calculation (>50 km/h)
- Ensure real-time updates when data changes
๐ง 6. Technical Implementation
Vue.js Computed Properties:
// Reactive calculations that update automatically
const totalVehicles = computed(() => vehicles.value.length)
const engineOnCount = computed(() =>
vehicles.value.filter(v => v.StatusMesin === 'Hidup').length
)
const engineOffCount = computed(() =>
vehicles.value.filter(v => v.StatusMesin === 'Mati').length
)
const overspeedCount = computed(() =>
vehicles.value.filter(v => parseFloat(v.Kecepatan) > 50).length
)
Responsive Grid System:
<div class="row q-gutter-md q-mb-xl">
<div class="col-12 col-sm-6 col-lg-3">
<!-- Card content -->
</div>
</div>
Performance Considerations:
- Computed Properties: Cached and only recalculate when dependencies change
- Filter Operations: Efficient array filtering for statistics
- Type Safety: parseFloat() with fallback for speed calculations
- Conditional Rendering: Only show when data is loaded
โ
7. Implementation Status
| Feature |
Status |
Notes |
| Statistics Cards Layout |
โ
IMPLEMENTED |
4 cards in responsive grid |
| Total Kendaraan |
โ
IMPLEMENTED |
Count of all vehicles |
| Mesin Hidup |
โ
IMPLEMENTED |
Count of StatusMesin === 'Hidup' |
| Mesin Mati |
โ
IMPLEMENTED |
Count of StatusMesin === 'Mati' |
| Overspeed >50 km/h |
โ
IMPLEMENTED |
Count of Kecepatan > 50 |
| Responsive Design |
โ
IMPLEMENTED |
col-12 col-sm-6 col-lg-3 |
| Real-time Updates |
โ
IMPLEMENTED |
Computed properties auto-update |
๐ STATISTICS CARDS IMPLEMENTED!
4 statistics cards ditambahkan di atas vehicle cards dengan data real-time.
Test di: Customer Asset Page
Generated by: test_statistics_cards.php | Author: Rodhi | Date: 16/08/2026 12:13:12
Status: STATISTICS CARDS IMPLEMENTED - READY FOR TESTING