go-duck-cli 1.4.16 → 1.4.17

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,6 +1,6 @@
1
1
  {
2
2
  "name": "go-duck-cli",
3
- "version": "1.4.16",
3
+ "version": "1.4.17",
4
4
  "description": "The Ultimate Evolutionary Go Microservice Scaffolder.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/parser/gdl.js CHANGED
@@ -273,6 +273,8 @@ export const toGoType = (type, enums = []) => {
273
273
  Time: 'time.Time',
274
274
  LocalDate: 'time.Time',
275
275
  Instant: 'time.Time',
276
+ Datetime: 'time.Time',
277
+ DateTime: 'time.Time',
276
278
  JSON: 'datatypes.JSON',
277
279
  JSONB: 'datatypes.JSON',
278
280
  };
@@ -300,7 +302,9 @@ export const toLiquibaseType = (field, enums = []) => {
300
302
  Time: 'TIME',
301
303
  LocalDate: 'DATE',
302
304
  Instant: 'TIMESTAMP',
303
- JSON: 'JSON',
305
+ Datetime: 'TIMESTAMP',
306
+ DateTime: 'TIMESTAMP',
307
+ JSON: 'JSONB',
304
308
  JSONB: 'JSONB',
305
309
  };
306
310
  return map[field.type] || 'VARCHAR(255)';
@@ -44,11 +44,13 @@ const compactWidgetHTML = `<!DOCTYPE html>
44
44
  <title>Live Telemetry</title>
45
45
  <style>
46
46
  html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #121212; color: #fff; font-family: system-ui, sans-serif; overflow: hidden; }
47
- .bento-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: 8px; width: 100%; height: 100%; padding: 8px; box-sizing: border-box; }
48
- .bento-card { background: #1e1e1e; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border: 1px solid #333; transition: all 0.2s; }
47
+ .bento-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; width: 100%; height: 100%; padding: 8px; box-sizing: border-box; }
48
+ .bento-col { display: flex; flex-direction: column; gap: 8px; height: 100%; }
49
+ .bento-card { background: #1e1e1e; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border: 1px solid #333; transition: all 0.2s; flex: 1; }
49
50
  .bento-title { position: absolute; top: 10px; left: 10px; font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }
50
51
  .bento-badge { position: absolute; top: 10px; right: 10px; font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; background: #e74c3c; color: #fff; display: none; }
51
52
  .bento-value { font-size: 2.5rem; font-weight: 700; color: #fff; margin-top: 15px; display: flex; align-items: baseline; gap: 4px; }
53
+ .bento-value-small { font-size: 1.5rem; font-weight: 700; color: #fff; margin-top: 15px; display: flex; align-items: baseline; gap: 4px; }
52
54
  .bento-unit { font-size: 1rem; color: #888; font-weight: normal; }
53
55
  .bento-sub { font-size: 0.75rem; color: #666; margin-top: 5px; }
54
56
 
@@ -67,10 +69,20 @@ const compactWidgetHTML = `<!DOCTYPE html>
67
69
  <div class="bento-badge" id="cpu-badge">QUOTA</div>
68
70
  <div class="bento-value"><span id="cpu-val">0</span><span class="bento-unit">%</span></div>
69
71
  </div>
70
- <div class="bento-card" id="card-mem">
71
- <div class="bento-title">RAM</div>
72
- <div class="bento-value"><span id="mem-val">0</span><span class="bento-unit">%</span></div>
73
- <div class="bento-sub"><span id="mem-raw">0 / 0 MB</span></div>
72
+ <div class="bento-col">
73
+ <div class="bento-card" id="card-mem">
74
+ <div class="bento-title">HEAP ALLOC</div>
75
+ <div class="bento-value-small"><span id="mem-val">0</span><span class="bento-unit">%</span></div>
76
+ <div class="bento-sub"><span id="mem-raw">0 / 0 MB</span></div>
77
+ </div>
78
+ <div class="bento-card" id="card-goroutines">
79
+ <div class="bento-title">GOROUTINES</div>
80
+ <div class="bento-value-small"><span id="go-val">0</span></div>
81
+ </div>
82
+ <div class="bento-card" id="card-uptime">
83
+ <div class="bento-title">UPTIME</div>
84
+ <div class="bento-value-small" style="font-size: 1rem;"><span id="up-val">-</span></div>
85
+ </div>
74
86
  </div>
75
87
  </div>
76
88
  <script>
@@ -115,6 +127,10 @@ const compactWidgetHTML = `<!DOCTYPE html>
115
127
 
116
128
  if (memPct > 90) document.getElementById('card-mem').classList.add('alarm-active');
117
129
  else document.getElementById('card-mem').classList.remove('alarm-active');
130
+
131
+ // Goroutines & Uptime
132
+ document.getElementById('go-val').innerText = sys.goroutines || 0;
133
+ document.getElementById('up-val').innerText = sys.uptime || '-';
118
134
  });
119
135
  evtSource.onerror = function() {
120
136
  document.getElementById('cpu-val').innerText = "OFF";
@@ -1472,9 +1488,8 @@ func SetupRouter(appConfig *config.Config) *gin.Engine {
1472
1488
  if (topic.includes('/')) {
1473
1489
  let btnHtml = "";
1474
1490
  if (keycloak && keycloak.authenticated) {
1475
- const isSend = /patch|put|post|create|update/i.test(topic);
1476
- const btnLabel = isSend ? "SEND" : "SUBSCRIBE";
1477
- const btnColor = isSend ? "#e74c3c" : "#3498db";
1491
+ const btnLabel = "SUBSCRIBE";
1492
+ const btnColor = "#3498db";
1478
1493
  btnHtml = " <button class=\"mqtt-action-btn\" style=\"background:" + btnColor + "\" onclick=\"openMqttAction('" + topic + "', '" + btnLabel + "')\">" + btnLabel + "</button>";
1479
1494
  }
1480
1495
  return '"' + topic + '"' + punct + btnHtml;