pms_md 1.0.0 โ†’ 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,22 +1,79 @@
1
1
  {
2
2
  "name": "pms_md",
3
- "version": "1.0.0",
4
- "description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
3
+ "version": "1.0.2",
4
+ "description": "Comprehensive monitoring solution for Node.js applications with error tracking, health checks, and multi-channel notifications",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
7
+ "test": "jest",
8
+ "start": "node node-monitor/examples/express-app.js"
8
9
  },
9
10
  "repository": {
10
11
  "type": "git",
11
12
  "url": "git+https://gitlab.com/manish-proses/pms_md.git"
12
13
  },
13
14
  "keywords": [
14
- "proses"
15
+ "proses",
16
+ "monitoring",
17
+ "health-check",
18
+ "error-tracking",
19
+ "notifications",
20
+ "alerts",
21
+ "nodejs",
22
+ "express",
23
+ "logging",
24
+ "winston",
25
+ "error-handler",
26
+ "health-monitoring",
27
+ "system-monitoring",
28
+ "email-notifications",
29
+ "slack-notifications"
15
30
  ],
16
31
  "author": "Manish Desai",
17
32
  "license": "ISC",
18
33
  "bugs": {
19
34
  "url": "https://gitlab.com/manish-proses/pms_md/issues"
20
35
  },
21
- "homepage": "https://gitlab.com/manish-proses/pms_md#readme"
36
+ "homepage": "https://gitlab.com/manish-proses/pms_md#readme",
37
+ "dependencies": {
38
+ "winston": "^3.11.0",
39
+ "winston-daily-rotate-file": "^4.7.1",
40
+ "nodemailer": "^6.9.7",
41
+ "@slack/webhook": "^7.0.2",
42
+ "axios": "^1.6.2",
43
+ "node-cron": "^3.0.3"
44
+ },
45
+ "peerDependencies": {
46
+ "express": "^4.18.0 || ^5.0.0",
47
+ "mongoose": "^7.0.0 || ^8.0.0",
48
+ "pg": "^8.0.0",
49
+ "mysql2": "^2.0.0 || ^3.0.0",
50
+ "sequelize": "^6.0.0",
51
+ "ioredis": "^5.0.0"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "express": {
55
+ "optional": true
56
+ },
57
+ "mongoose": {
58
+ "optional": true
59
+ },
60
+ "pg": {
61
+ "optional": true
62
+ },
63
+ "mysql2": {
64
+ "optional": true
65
+ },
66
+ "sequelize": {
67
+ "optional": true
68
+ },
69
+ "ioredis": {
70
+ "optional": true
71
+ }
72
+ },
73
+ "devDependencies": {
74
+ "jest": "^29.7.0"
75
+ },
76
+ "engines": {
77
+ "node": ">=14.0.0"
78
+ }
22
79
  }
Binary file
Binary file
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Test script to verify Sequelize monitoring support
3
+ */
4
+
5
+ const { Sequelize } = require('sequelize');
6
+ const NodeMonitor = require('pms_md');
7
+
8
+ console.log('๐Ÿงช Testing Sequelize Monitoring Support\n');
9
+
10
+ // Create Sequelize instance (adjust credentials as needed)
11
+ const sequelize = new Sequelize('asset_tracking', 'root', 'root', {
12
+ host: 'localhost',
13
+ dialect: 'mysql',
14
+ logging: false,
15
+ pool: {
16
+ max: 5,
17
+ min: 0,
18
+ acquire: 30000,
19
+ idle: 10000
20
+ }
21
+ });
22
+
23
+ // Initialize monitor
24
+ const monitor = new NodeMonitor({
25
+ app: {
26
+ name: 'Test App',
27
+ version: '1.0.0',
28
+ environment: 'development'
29
+ },
30
+ notifications: {
31
+ email: {
32
+ enabled: false // Disable for testing
33
+ }
34
+ },
35
+ database: {
36
+ enabled: true,
37
+ queryTimeout: 5000
38
+ }
39
+ });
40
+
41
+ async function testMonitoring() {
42
+ try {
43
+ console.log('1๏ธโƒฃ Testing database connection...');
44
+ await sequelize.authenticate();
45
+ console.log(' โœ… Database connected successfully\n');
46
+
47
+ console.log('2๏ธโƒฃ Registering Sequelize instance for monitoring...');
48
+ monitor.registerDatabase('mysql', 'sequelize', sequelize);
49
+ console.log(' โœ… Database registered\n');
50
+
51
+ console.log('3๏ธโƒฃ Starting monitoring services...');
52
+ monitor.start();
53
+ console.log(' โœ… Monitoring started\n');
54
+
55
+ console.log('4๏ธโƒฃ Checking database connection status...');
56
+ const status = monitor.getStatus();
57
+ console.log(' Database Status:', JSON.stringify(status.databases, null, 2));
58
+ console.log(' โœ… Status retrieved\n');
59
+
60
+ console.log('5๏ธโƒฃ Getting database statistics...');
61
+ const stats = await monitor.getDatabaseStats('mysql');
62
+ console.log(' Database Stats:', JSON.stringify(stats, null, 2));
63
+ console.log(' โœ… Stats retrieved\n');
64
+
65
+ console.log('6๏ธโƒฃ Testing connection check...');
66
+ await new Promise(resolve => setTimeout(resolve, 2000)); // Wait 2 seconds
67
+ const statusAfter = monitor.getStatus();
68
+ console.log(' Connection Status:', statusAfter.databases.mysql.connected ? 'โœ… Connected' : 'โŒ Disconnected');
69
+ console.log(' Consecutive Failures:', statusAfter.databases.mysql.consecutiveFailures);
70
+ console.log(' โœ… Connection check completed\n');
71
+
72
+ console.log('7๏ธโƒฃ Stopping monitoring...');
73
+ monitor.stop();
74
+ console.log(' โœ… Monitoring stopped\n');
75
+
76
+ console.log('8๏ธโƒฃ Closing database connection...');
77
+ await sequelize.close();
78
+ console.log(' โœ… Database connection closed\n');
79
+
80
+ console.log('๐ŸŽ‰ All tests passed successfully!\n');
81
+ console.log('โœ… MySQL2 and Sequelize support is working correctly!');
82
+
83
+ } catch (error) {
84
+ console.error('\nโŒ Test failed:', error.message);
85
+ console.error('\nFull error:', error);
86
+
87
+ if (error.message.includes('Unknown database')) {
88
+ console.log('\n๐Ÿ’ก Tip: Make sure the "asset_tracking" database exists in MySQL');
89
+ console.log(' You can create it with: CREATE DATABASE asset_tracking;');
90
+ } else if (error.message.includes('Access denied')) {
91
+ console.log('\n๐Ÿ’ก Tip: Check your MySQL credentials (username/password)');
92
+ } else if (error.message.includes('ECONNREFUSED')) {
93
+ console.log('\n๐Ÿ’ก Tip: Make sure MySQL server is running on localhost:3306');
94
+ }
95
+ } finally {
96
+ process.exit(0);
97
+ }
98
+ }
99
+
100
+ // Run the test
101
+ testMonitoring();
102
+
@@ -1,286 +0,0 @@
1
- # ๐ŸŽจ Design Improvements - Error Logs Page
2
-
3
- ## Overview
4
- Comprehensive design improvements made to the Error Logs page to enhance visual appeal, user experience, and modern aesthetics.
5
-
6
- ---
7
-
8
- ## โœจ Key Improvements
9
-
10
- ### 1. **Modern Header with Gradient Background**
11
- - **Before:** Simple text header
12
- - **After:** Full-width gradient header with purple/blue theme
13
- - **Features:**
14
- - Large icon (๐Ÿ“‹) with drop shadow
15
- - Bold, prominent title with text shadow
16
- - Descriptive subtitle
17
- - Matches the overall app theme
18
- - Responsive design for mobile devices
19
-
20
- ### 2. **Enhanced Filter Buttons**
21
- - **Before:** Simple inline buttons with basic styling
22
- - **After:** Modern card-based filter system
23
- - **Features:**
24
- - Grid layout with responsive columns
25
- - Each button shows:
26
- - Icon
27
- - Label
28
- - Count (large, prominent number)
29
- - Animated left border that expands on active state
30
- - Gradient backgrounds for each filter type:
31
- - All Errors: Purple gradient
32
- - API Errors: Red gradient
33
- - Server Errors: Orange gradient
34
- - Database Errors: Purple gradient
35
- - Smooth hover effects with icon scaling
36
- - Active state fills entire button with gradient
37
-
38
- ### 3. **Improved Stats Cards**
39
- - **Before:** Basic white cards
40
- - **After:** Modern cards with visual enhancements
41
- - **Features:**
42
- - Left border accent (purple)
43
- - Decorative gradient background element in top-right
44
- - Hover effect (lifts up with shadow)
45
- - Better typography with uppercase labels
46
- - Larger, bolder values
47
- - Smooth transitions
48
-
49
- ### 4. **Enhanced Error Item Cards**
50
- - **Before:** Simple list items with border
51
- - **After:** Interactive cards with hover effects
52
- - **Features:**
53
- - Left border appears on hover (purple)
54
- - Gradient background on hover
55
- - Smooth padding transition
56
- - Better visual feedback
57
-
58
- ### 5. **Modernized Badges**
59
- - **Before:** Flat colored badges
60
- - **After:** Gradient badges with depth
61
- - **Features:**
62
- - Gradient backgrounds
63
- - Border for definition
64
- - Box shadow for depth
65
- - Scale animation on hover
66
- - Better contrast and readability
67
-
68
- ### 6. **Improved Action Buttons**
69
- - **Before:** Basic gradient buttons
70
- - **After:** Interactive buttons with ripple effect
71
- - **Features:**
72
- - Ripple animation on hover (expanding circle)
73
- - Better shadows
74
- - Smooth lift effect on hover
75
- - Icon and text separated for better layout
76
- - Larger, more clickable
77
-
78
- ### 7. **Enhanced File Selector**
79
- - **Before:** Simple dropdown
80
- - **After:** Styled container with visual hierarchy
81
- - **Features:**
82
- - Gradient background container
83
- - Border for definition
84
- - Icon in label (๐Ÿ“…)
85
- - Better focus states with ring effect
86
- - Hover effect on dropdown
87
- - Improved typography
88
-
89
- ### 8. **Inline Stats in Header**
90
- - **New Feature:** Quick stats at a glance
91
- - **Features:**
92
- - Shows Total, API, and Server error counts
93
- - Icon for each stat type
94
- - Gradient background cards
95
- - Left border accent
96
- - Updates in real-time
97
-
98
- ### 9. **Responsive Design**
99
- - **Mobile Optimizations:**
100
- - Stacked layout for small screens
101
- - Adjusted font sizes
102
- - Full-width buttons
103
- - Centered header content
104
- - Smaller icons and padding
105
-
106
- ### 10. **Smooth Animations**
107
- - **Added:**
108
- - Fade-in animation for error items
109
- - Smooth scroll behavior
110
- - Hover transitions on all interactive elements
111
- - Scale animations on badges
112
- - Ripple effect on buttons
113
- - Border expansion animations
114
-
115
- ---
116
-
117
- ## ๐ŸŽจ Color Scheme
118
-
119
- ### Primary Colors:
120
- - **Purple Gradient:** `#667eea` โ†’ `#764ba2`
121
- - **Red (API Errors):** `#ef4444` โ†’ `#dc2626`
122
- - **Orange (Server Errors):** `#f59e0b` โ†’ `#d97706`
123
- - **Purple (Database Errors):** `#8b5cf6` โ†’ `#7c3aed`
124
- - **Green (Success):** `#10b981` โ†’ `#059669`
125
- - **Blue (Info):** `#3b82f6` โ†’ `#2563eb`
126
-
127
- ### Neutral Colors:
128
- - **Background:** `#f9fafb`, `#f3f4f6`
129
- - **Text:** `#1f2937`, `#6b7280`
130
- - **Borders:** `#e5e7eb`
131
-
132
- ---
133
-
134
- ## ๐Ÿ“ฑ Responsive Breakpoints
135
-
136
- ### Mobile (max-width: 768px):
137
- - Single column layout
138
- - Stacked filter buttons
139
- - Full-width action buttons
140
- - Smaller header icon and title
141
- - Centered content
142
-
143
- ---
144
-
145
- ## ๐Ÿ”ง Technical Details
146
-
147
- ### CSS Features Used:
148
- - **Flexbox** - For flexible layouts
149
- - **CSS Grid** - For responsive filter buttons
150
- - **Gradients** - Linear gradients for backgrounds
151
- - **Transitions** - Smooth animations
152
- - **Transform** - Scale and translate effects
153
- - **Box Shadow** - Depth and elevation
154
- - **Pseudo-elements** - `::before` for decorative elements
155
- - **Keyframe Animations** - Fade-in and spin animations
156
-
157
- ### Performance Optimizations:
158
- - Hardware-accelerated transforms
159
- - Efficient CSS selectors
160
- - Minimal repaints
161
- - Smooth 60fps animations
162
-
163
- ---
164
-
165
- ## ๐ŸŽฏ User Experience Improvements
166
-
167
- ### Visual Hierarchy:
168
- 1. **Header** - Most prominent, sets context
169
- 2. **Quick Stats** - Immediate overview
170
- 3. **File Selector & Actions** - Primary controls
171
- 4. **Filter Buttons** - Secondary navigation
172
- 5. **Stats Cards** - Detailed metrics
173
- 6. **Error List** - Main content
174
-
175
- ### Interaction Feedback:
176
- - โœ… Hover states on all clickable elements
177
- - โœ… Active states for current selection
178
- - โœ… Loading states with spinner
179
- - โœ… Empty states with friendly message
180
- - โœ… Smooth transitions for all state changes
181
-
182
- ### Accessibility:
183
- - โœ… High contrast colors
184
- - โœ… Large click targets (min 44x44px)
185
- - โœ… Clear visual feedback
186
- - โœ… Readable font sizes
187
- - โœ… Semantic HTML structure
188
-
189
- ---
190
-
191
- ## ๐Ÿ“Š Before & After Comparison
192
-
193
- ### Header:
194
- - **Before:** Plain text "๐Ÿ“‹ API Error Logs"
195
- - **After:** Full-width gradient banner with large icon, title, and subtitle
196
-
197
- ### Filter Buttons:
198
- - **Before:** 4 inline buttons with basic colors
199
- - **After:** Grid of modern cards with icons, labels, counts, and animations
200
-
201
- ### Stats Cards:
202
- - **Before:** Simple white cards
203
- - **After:** Cards with accents, decorative elements, and hover effects
204
-
205
- ### Error Items:
206
- - **Before:** Static list items
207
- - **After:** Interactive cards with hover animations
208
-
209
- ---
210
-
211
- ## ๐Ÿš€ Future Enhancements (Optional)
212
-
213
- ### Potential Additions:
214
- 1. **Dark Mode** - Toggle for dark theme
215
- 2. **Export Options** - CSV, JSON, PDF export
216
- 3. **Search & Filter** - Text search within errors
217
- 4. **Date Range Picker** - Filter by custom date range
218
- 5. **Error Grouping** - Group similar errors
219
- 6. **Charts & Graphs** - Visual error trends
220
- 7. **Real-time Updates** - WebSocket for live updates
221
- 8. **Keyboard Shortcuts** - Quick navigation
222
- 9. **Customizable Views** - Save filter preferences
223
- 10. **Error Details Modal** - Expanded view for errors
224
-
225
- ---
226
-
227
- ## ๐Ÿ“ Code Structure
228
-
229
- ### File Modified:
230
- - `node-monitor/examples/views/error-logs.ejs`
231
-
232
- ### Sections Updated:
233
- 1. **CSS Styles** (Lines 8-647)
234
- - Page header gradient
235
- - Filter buttons
236
- - Stats cards
237
- - Error items
238
- - Badges
239
- - Action buttons
240
- - File selector
241
- - Responsive design
242
- - Animations
243
-
244
- 2. **HTML Structure** (Lines 648-908)
245
- - New gradient header
246
- - Inline stats
247
- - Restructured filter buttons
248
- - Updated action buttons
249
-
250
- ---
251
-
252
- ## โœ… Testing Checklist
253
-
254
- - [x] Desktop view (1920x1080)
255
- - [x] Tablet view (768x1024)
256
- - [x] Mobile view (375x667)
257
- - [x] Hover states
258
- - [x] Active states
259
- - [x] Loading states
260
- - [x] Empty states
261
- - [x] Long text handling
262
- - [x] Multiple errors display
263
- - [x] Filter functionality
264
- - [x] Refresh functionality
265
- - [x] Download functionality
266
-
267
- ---
268
-
269
- ## ๐ŸŽ‰ Summary
270
-
271
- The Error Logs page has been transformed from a functional but basic interface into a modern, visually appealing, and highly interactive dashboard. The improvements focus on:
272
-
273
- 1. **Visual Appeal** - Modern gradients, shadows, and animations
274
- 2. **User Experience** - Clear hierarchy, intuitive interactions
275
- 3. **Responsiveness** - Works great on all devices
276
- 4. **Performance** - Smooth 60fps animations
277
- 5. **Accessibility** - High contrast, large targets, clear feedback
278
-
279
- The new design maintains the functionality while significantly enhancing the aesthetics and user experience!
280
-
281
- ---
282
-
283
- **Last Updated:** 2025-11-12
284
- **Version:** 2.0
285
- **Author:** Manish Desai
286
-