@powerhousedao/ph-cli 0.40.85-dev.12 → 0.40.85-dev.14

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/ph-cli",
3
- "version": "0.40.85-dev.12",
3
+ "version": "0.40.85-dev.14",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -138,16 +138,46 @@ else
138
138
 
139
139
  "status")
140
140
  check_setup "$PROJECT_NAME"
141
- echo "Checking service status..."
142
- echo "Nginx site status:"
141
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
142
+ echo " Service Status for $PROJECT_NAME"
143
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
144
+
145
+ # Create table header
146
+ printf "%-15s %-10s %-15s %-10s %-10s\n" "Service" "Status" "Memory" "Uptime" "Health"
147
+ echo "────────────────────────────────────────────────────────────────────"
148
+
149
+ # Check Connect status
150
+ connect_status="Disabled"
151
+ connect_health="❌"
152
+ connect_memory="N/A"
153
+ connect_uptime="N/A"
143
154
  if [ -L "/etc/nginx/sites-enabled/$PROJECT_NAME" ]; then
144
- echo "Site is enabled"
145
- else
146
- echo "Site is disabled"
155
+ connect_status="Enabled"
156
+ # Check if Connect is reachable
157
+ if curl -s -f "http://localhost/$PROJECT_NAME" > /dev/null; then
158
+ connect_health="✅"
159
+ fi
160
+ # Get Nginx memory usage for the site
161
+ nginx_pid=$(pgrep -f "nginx.*$PROJECT_NAME" | head -n 1)
162
+ if [ -n "$nginx_pid" ]; then
163
+ connect_memory=$(ps -o rss= -p "$nginx_pid" 2>/dev/null | awk '{printf "%.1fmb", $1/1024}')
164
+ connect_uptime=$(ps -o etime= -p "$nginx_pid" 2>/dev/null)
165
+ fi
147
166
  fi
167
+ printf "%-15s %-10s %-15s %-10s %-10s\n" "Connect" "$connect_status" "$connect_memory" "$connect_uptime" "$connect_health"
148
168
 
149
- echo -e "\nSwitchboard status:"
150
- pm2 list | grep "switchboard_${PROJECT_NAME}"
169
+ # Check Switchboard status
170
+ switchboard_info=$(pm2 list | grep "switchboard_${PROJECT_NAME}")
171
+ if [ -n "$switchboard_info" ]; then
172
+ switchboard_status="Enabled"
173
+ switchboard_memory=$(echo "$switchboard_info" | awk '{print $12}')
174
+ switchboard_uptime=$(echo "$switchboard_info" | awk '{print $7}')
175
+ switchboard_health="✅"
176
+ printf "%-15s %-10s %-15s %-10s %-10s\n" "Switchboard" "$switchboard_status" "$switchboard_memory" "$switchboard_uptime" "$switchboard_health"
177
+ else
178
+ printf "%-15s %-10s %-15s %-10s %-10s\n" "Switchboard" "Disabled" "N/A" "N/A" "❌"
179
+ fi
180
+ echo "────────────────────────────────────────────────────────────────────"
151
181
  ;;
152
182
 
153
183
  *)
@@ -1,2 +1,2 @@
1
- export declare const version = "0.40.85-dev.12";
1
+ export declare const version = "0.40.85-dev.14";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated. DO NOT EDIT.
2
- export const version = "0.40.85-dev.12";
2
+ export const version = "0.40.85-dev.14";
3
3
  //# sourceMappingURL=version.js.map