@powerhousedao/ph-cli 0.40.85-dev.11 → 0.40.85-dev.13
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
|
@@ -87,11 +87,7 @@ else
|
|
|
87
87
|
# Build Connect
|
|
88
88
|
echo "Building Connect..."
|
|
89
89
|
ph connect build
|
|
90
|
-
|
|
91
|
-
# Fix permissions for Connect build
|
|
92
|
-
echo "Fixing permissions for Connect build..."
|
|
93
|
-
sudo chown -R www-data:www-data .ph/connect-build/dist
|
|
94
|
-
sudo chmod -R 755 .ph/connect-build/dist
|
|
90
|
+
sudo cp -r .ph/connect-build/dist /var/www/html/${PROJECT_NAME}
|
|
95
91
|
|
|
96
92
|
# Enable Nginx site
|
|
97
93
|
manage_nginx_site "enable"
|
|
@@ -124,11 +120,7 @@ else
|
|
|
124
120
|
# Build Connect
|
|
125
121
|
echo "Building Connect..."
|
|
126
122
|
ph connect build
|
|
127
|
-
|
|
128
|
-
# Fix permissions for Connect build
|
|
129
|
-
echo "Fixing permissions for Connect build..."
|
|
130
|
-
sudo chown -R www-data:www-data .ph/connect-build/dist
|
|
131
|
-
sudo chmod -R 755 .ph/connect-build/dist
|
|
123
|
+
sudo cp -r .ph/connect-build/dist /var/www/html/${PROJECT_NAME}
|
|
132
124
|
|
|
133
125
|
# Restart Nginx site
|
|
134
126
|
manage_nginx_site "disable"
|
|
@@ -146,16 +138,44 @@ else
|
|
|
146
138
|
|
|
147
139
|
"status")
|
|
148
140
|
check_setup "$PROJECT_NAME"
|
|
149
|
-
echo "
|
|
150
|
-
echo "
|
|
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"
|
|
151
154
|
if [ -L "/etc/nginx/sites-enabled/$PROJECT_NAME" ]; then
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
+
connect_memory=$(ps -o rss= -p $(pgrep -f "nginx.*$PROJECT_NAME") 2>/dev/null | awk '{printf "%.1fmb", $1/1024}')
|
|
162
|
+
# Get Nginx uptime
|
|
163
|
+
connect_uptime=$(ps -o etime= -p $(pgrep -f "nginx.*$PROJECT_NAME") 2>/dev/null || echo "N/A")
|
|
155
164
|
fi
|
|
165
|
+
printf "%-15s %-10s %-15s %-10s %-10s\n" "Connect" "$connect_status" "$connect_memory" "$connect_uptime" "$connect_health"
|
|
156
166
|
|
|
157
|
-
|
|
158
|
-
pm2 list | grep "switchboard_${PROJECT_NAME}"
|
|
167
|
+
# Check Switchboard status
|
|
168
|
+
switchboard_info=$(pm2 list | grep "switchboard_${PROJECT_NAME}")
|
|
169
|
+
if [ -n "$switchboard_info" ]; then
|
|
170
|
+
switchboard_status=$(echo "$switchboard_info" | awk '{print $10}')
|
|
171
|
+
switchboard_memory=$(echo "$switchboard_info" | awk '{print $12}')
|
|
172
|
+
switchboard_uptime=$(echo "$switchboard_info" | awk '{print $7}')
|
|
173
|
+
switchboard_health="✅"
|
|
174
|
+
printf "%-15s %-10s %-15s %-10s %-10s\n" "Switchboard" "$switchboard_status" "$switchboard_memory" "$switchboard_uptime" "$switchboard_health"
|
|
175
|
+
else
|
|
176
|
+
printf "%-15s %-10s %-15s %-10s %-10s\n" "Switchboard" "Stopped" "N/A" "N/A" "❌"
|
|
177
|
+
fi
|
|
178
|
+
echo "────────────────────────────────────────────────────────────────────"
|
|
159
179
|
;;
|
|
160
180
|
|
|
161
181
|
*)
|
|
@@ -40,6 +40,7 @@ else
|
|
|
40
40
|
# Connect Build
|
|
41
41
|
# =============================================================================
|
|
42
42
|
ph connect build
|
|
43
|
+
cp -r .ph/connect-build/dist /var/www/html/$PROJECT_NAME
|
|
43
44
|
|
|
44
45
|
# =============================================================================
|
|
45
46
|
# Database Configuration
|
|
@@ -253,7 +254,7 @@ server {
|
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
location / {
|
|
256
|
-
root
|
|
257
|
+
root /var/www/html/$PROJECT_NAME;
|
|
257
258
|
try_files \$uri \$uri/ /index.html;
|
|
258
259
|
add_header Cache-Control "no-cache";
|
|
259
260
|
add_header X-Forwarded-Proto \$scheme;
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "0.40.85-dev.
|
|
1
|
+
export declare const version = "0.40.85-dev.13";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/src/version.js
CHANGED