go-duck-cli 1.4.15 → 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 +1 -1
- package/parser/gdl.js +5 -1
- package/templates/go/router.go.hbs +26 -11
package/package.json
CHANGED
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
|
-
|
|
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:
|
|
48
|
-
.bento-
|
|
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-
|
|
71
|
-
<div class="bento-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
|
1476
|
-
const
|
|
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;
|
|
@@ -1537,7 +1552,7 @@ func SetupRouter(appConfig *config.Config) *gin.Engine {
|
|
|
1537
1552
|
}
|
|
1538
1553
|
|
|
1539
1554
|
document.getElementById('live-logs-btn').onclick = () => {
|
|
1540
|
-
if (!keycloak.authenticated && {{appConfig.GoDuck.Security.OIDC.Enabled}}) {
|
|
1555
|
+
if (!keycloak.authenticated && {{#if appConfig.GoDuck.Security.OIDC.Enabled}}true{{else}}false{{/if}}) {
|
|
1541
1556
|
alert('Please login to view Server Logs');
|
|
1542
1557
|
return;
|
|
1543
1558
|
}
|
|
@@ -1564,7 +1579,7 @@ func SetupRouter(appConfig *config.Config) *gin.Engine {
|
|
|
1564
1579
|
};
|
|
1565
1580
|
|
|
1566
1581
|
document.getElementById('compact-widget-btn').onclick = () => {
|
|
1567
|
-
if (!keycloak.authenticated && {{appConfig.GoDuck.Security.OIDC.Enabled}}) {
|
|
1582
|
+
if (!keycloak.authenticated && {{#if appConfig.GoDuck.Security.OIDC.Enabled}}true{{else}}false{{/if}}) {
|
|
1568
1583
|
alert('Please login to view system telemetry.');
|
|
1569
1584
|
return;
|
|
1570
1585
|
}
|