Sanoopsn commited on
Commit
64c9a90
·
verified ·
1 Parent(s): e4c5e35

single page website remove the image and data not populated

Browse files
Files changed (2) hide show
  1. components/navbar.js +2 -3
  2. script.js +13 -42
components/navbar.js CHANGED
@@ -36,9 +36,8 @@ class CustomNavbar extends HTMLElement {
36
  <i data-feather="bell"></i>
37
  </button>
38
  <div class="flex items-center space-x-2">
39
- <img src="http://static.photos/people/1200x630/1" alt="User" class="w-8 h-8 rounded-full">
40
- <span class="hidden md:inline text-sm font-medium text-gray-700">Admin</span>
41
- </div>
42
  </div>
43
  </div>
44
  </nav>
 
36
  <i data-feather="bell"></i>
37
  </button>
38
  <div class="flex items-center space-x-2">
39
+ <span class="text-sm font-medium text-gray-700">Admin</span>
40
+ </div>
 
41
  </div>
42
  </div>
43
  </nav>
script.js CHANGED
@@ -1,69 +1,40 @@
1
 
2
  // Sample data - in a real app this would come from an API
3
  const sampleLogs = [
4
- {
5
  id: 1,
6
  status: 500,
7
  method: 'POST',
8
- time: '2023-05-15 14:32:45',
9
- url: 'https://api.example.com/v1/users',
10
  errorMessage: 'Internal Server Error: Database connection timeout',
11
  errorCode: 'DB_CONN_TIMEOUT',
12
  errorType: 'Database',
13
- resolution: 'Check database connection pool. Verify database server is running and accessible. Consider increasing connection timeout setting.'
14
  },
15
  {
16
  id: 2,
17
  status: 404,
18
  method: 'GET',
19
- time: '2023-05-15 14:30:12',
20
- url: 'https://api.example.com/v1/products/12345',
21
- errorMessage: 'Product not found with ID 12345',
22
  errorCode: 'RESOURCE_NOT_FOUND',
23
  errorType: 'Validation',
24
- resolution: 'Verify the product ID exists in the database. Check if the product was deleted. Validate the request parameters.'
25
  },
26
  {
27
  id: 3,
28
  status: 400,
29
- method: 'PUT',
30
- time: '2023-05-15 14:25:33',
31
- url: 'https://api.example.com/v1/orders/678',
32
- errorMessage: 'Invalid request body: Missing required field "quantity"',
33
  errorCode: 'VALIDATION_ERROR',
34
  errorType: 'Validation',
35
- resolution: 'Check the API documentation for required fields. Validate the request body before sending. Ensure all required fields are included.'
36
- },
37
- {
38
- id: 4,
39
- status: 401,
40
- method: 'GET',
41
- time: '2023-05-15 14:20:18',
42
- url: 'https://api.example.com/v1/users/me',
43
- errorMessage: 'Unauthorized: Invalid or expired access token',
44
- errorCode: 'INVALID_TOKEN',
45
- errorType: 'Authentication',
46
- resolution: 'Check if the access token is valid and not expired. Verify the token signature. Refresh the token if needed.'
47
- },
48
- {
49
- id: 5,
50
- status: 503,
51
- method: 'POST',
52
- time: '2023-05-15 14:15:42',
53
- url: 'https://api.example.com/v1/payments',
54
- errorMessage: 'Service Unavailable: Payment gateway not responding',
55
- errorCode: 'GATEWAY_TIMEOUT',
56
- errorType: 'Integration',
57
- resolution: 'Check the payment gateway status. Verify network connectivity. Implement retry logic with exponential backoff.'
58
  }
59
  ];
60
-
61
- // Add default time to sample logs to make time filtering work
62
- sampleLogs.forEach((log, index) => {
63
- const now = new Date();
64
- const hoursToSubtract = index * 3; // Vary the times for demo purposes
65
- log.time = new Date(now - hoursToSubtract * 60 * 60 * 1000).toISOString().replace('T', ' ').substring(0, 19);
66
- });
67
  // DOM elements
68
  const logsTable = document.getElementById('logsTable');
69
  const errorModal = document.getElementById('errorModal');
 
1
 
2
  // Sample data - in a real app this would come from an API
3
  const sampleLogs = [
4
+ {
5
  id: 1,
6
  status: 500,
7
  method: 'POST',
8
+ time: new Date().toISOString().replace('T', ' ').substring(0, 19),
9
+ url: '/api/users',
10
  errorMessage: 'Internal Server Error: Database connection timeout',
11
  errorCode: 'DB_CONN_TIMEOUT',
12
  errorType: 'Database',
13
+ resolution: 'Check database connection pool. Verify database server is running and accessible.'
14
  },
15
  {
16
  id: 2,
17
  status: 404,
18
  method: 'GET',
19
+ time: new Date(Date.now() - 3600000).toISOString().replace('T', ' ').substring(0, 19),
20
+ url: '/api/products/123',
21
+ errorMessage: 'Product not found with ID 123',
22
  errorCode: 'RESOURCE_NOT_FOUND',
23
  errorType: 'Validation',
24
+ resolution: 'Verify the product ID exists in the database.'
25
  },
26
  {
27
  id: 3,
28
  status: 400,
29
+ method: 'POST',
30
+ time: new Date(Date.now() - 7200000).toISOString().replace('T', ' ').substring(0, 19),
31
+ url: '/api/orders',
32
+ errorMessage: 'Invalid request: Missing required fields',
33
  errorCode: 'VALIDATION_ERROR',
34
  errorType: 'Validation',
35
+ resolution: 'Check API documentation for required fields.'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
  ];
 
 
 
 
 
 
 
38
  // DOM elements
39
  const logsTable = document.getElementById('logsTable');
40
  const errorModal = document.getElementById('errorModal');