This is an automated email from the ASF dual-hosted git repository.
jeffreyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/doris-opentelemetry-demo.git
The following commit(s) were added to refs/heads/main by this push:
new 2b21000 fix: generateUid works on http protocol
2b21000 is described below
commit 2b2100066c6446f8f335ae0bca0379f375a307e0
Author: Jeffrey <[email protected]>
AuthorDate: Mon Aug 18 19:33:42 2025 +0800
fix: generateUid works on http protocol
---
src/grafana/plugins/doris-app/892.js | 228 +++++++++++++++++++--
src/grafana/plugins/doris-app/892.js.map | 2 +-
.../plugins/doris-app/gpx_doris-app_darwin_amd64 | Bin 25602304 -> 25602304
bytes
.../plugins/doris-app/gpx_doris-app_darwin_arm64 | Bin 24454450 -> 24454450
bytes
.../plugins/doris-app/gpx_doris-app_linux_amd64 | Bin 24740024 -> 24740024
bytes
.../plugins/doris-app/gpx_doris-app_linux_arm | Bin 23199928 -> 23199928
bytes
.../plugins/doris-app/gpx_doris-app_linux_arm64 | Bin 23462072 -> 23462072
bytes
.../doris-app/gpx_doris-app_windows_amd64.exe | Bin 25480192 -> 25480192
bytes
src/grafana/plugins/doris-app/module.js | 4 +-
src/grafana/plugins/doris-app/module.js.map | 2 +-
10 files changed, 216 insertions(+), 20 deletions(-)
diff --git a/src/grafana/plugins/doris-app/892.js
b/src/grafana/plugins/doris-app/892.js
index adbd4ac..9123462 100644
--- a/src/grafana/plugins/doris-app/892.js
+++ b/src/grafana/plugins/doris-app/892.js
@@ -2997,6 +2997,7 @@ var services_discover = __webpack_require__(7626);
// EXTERNAL MODULE: external "rxjs"
var external_rxjs_ = __webpack_require__(1269);
;// ./utils/utils.ts
+// --- stable stringify: 递归排序键,避免循环引用导致崩溃 ---
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
@@ -3078,28 +3079,223 @@ function utils_object_spread_props(target, source) {
}
return target;
}
+function stableStringify(value) {
+ const seen = new WeakSet();
+ const recur = (v)=>{
+ if (v === null) {
+ return 'null';
+ }
+ const t = typeof v;
+ if (t === 'number') {
+ return Number.isFinite(v) ? String(v) : 'null';
+ }
+ if (t === 'boolean') {
+ return v ? 'true' : 'false';
+ }
+ if (t === 'string') {
+ return JSON.stringify(v);
+ }
+ if (t === 'bigint') {
+ return JSON.stringify(v.toString());
+ }
+ if (t === 'undefined' || t === 'function' || t === 'symbol') {
+ return 'null';
+ }
+ // object / array
+ if (seen.has(v)) {
+ return '"[Circular]"';
+ }
+ seen.add(v);
+ if (Array.isArray(v)) {
+ return '[' + v.map(recur).join(',') + ']';
+ }
+ const keys = Object.keys(v).sort();
+ const body = keys.map((k)=>JSON.stringify(k) + ':' +
recur(v[k])).join(',');
+ return '{' + body + '}';
+ };
+ return recur(value);
+}
+// --- 小工具 ---
+function u8ToHex(u8) {
+ let out = '';
+ for(let i = 0; i < u8.length; i++){
+ out += u8[i].toString(16).padStart(2, '0');
+ }
+ return out;
+}
+function hasSubtle() {
+ var _window_crypto_subtle;
+ return typeof window !== 'undefined' && !!window.crypto &&
!!window.isSecureContext && typeof ((_window_crypto_subtle =
window.crypto.subtle) === null || _window_crypto_subtle === void 0 ? void 0 :
_window_crypto_subtle.digest) === 'function';
+}
+// --- 纯 JS 的 SHA-256 fallback(简实现,无依赖) ---
+function sha256HexJS(data) {
+ // 常量
+ const K = new Uint32Array([
+ 0x428a2f98,
+ 0x71374491,
+ 0xb5c0fbcf,
+ 0xe9b5dba5,
+ 0x3956c25b,
+ 0x59f111f1,
+ 0x923f82a4,
+ 0xab1c5ed5,
+ 0xd807aa98,
+ 0x12835b01,
+ 0x243185be,
+ 0x550c7dc3,
+ 0x72be5d74,
+ 0x80deb1fe,
+ 0x9bdc06a7,
+ 0xc19bf174,
+ 0xe49b69c1,
+ 0xefbe4786,
+ 0x0fc19dc6,
+ 0x240ca1cc,
+ 0x2de92c6f,
+ 0x4a7484aa,
+ 0x5cb0a9dc,
+ 0x76f988da,
+ 0x983e5152,
+ 0xa831c66d,
+ 0xb00327c8,
+ 0xbf597fc7,
+ 0xc6e00bf3,
+ 0xd5a79147,
+ 0x06ca6351,
+ 0x14292967,
+ 0x27b70a85,
+ 0x2e1b2138,
+ 0x4d2c6dfc,
+ 0x53380d13,
+ 0x650a7354,
+ 0x766a0abb,
+ 0x81c2c92e,
+ 0x92722c85,
+ 0xa2bfe8a1,
+ 0xa81a664b,
+ 0xc24b8b70,
+ 0xc76c51a3,
+ 0xd192e819,
+ 0xd6990624,
+ 0xf40e3585,
+ 0x106aa070,
+ 0x19a4c116,
+ 0x1e376c08,
+ 0x2748774c,
+ 0x34b0bcb5,
+ 0x391c0cb3,
+ 0x4ed8aa4a,
+ 0x5b9cca4f,
+ 0x682e6ff3,
+ 0x748f82ee,
+ 0x78a5636f,
+ 0x84c87814,
+ 0x8cc70208,
+ 0x90befffa,
+ 0xa4506ceb,
+ 0xbef9a3f7,
+ 0xc67178f2
+ ]);
+ // 初始哈希
+ let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a, h4
= 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;
+ // 预处理:填充
+ const l = data.length;
+ const bitLenHi = l >>> 29 >>> 0;
+ const bitLenLo = l << 3 >>> 0;
+ const nBlocks = (l + 9 >> 6) + 1 << 4; // 以 16 个 32bit 为一组
+ const M = new Uint32Array(nBlocks);
+ for(let i = 0; i < l; i++){
+ M[i >> 2] |= data[i] << (3 - (i & 3) << 3);
+ }
+ M[l >> 2] |= 0x80 << (3 - (l & 3) << 3);
+ M[nBlocks - 2] = bitLenHi;
+ M[nBlocks - 1] = bitLenLo;
+ const W = new Uint32Array(64);
+ const rotr = (x, n)=>x >>> n | x << 32 - n;
+ for(let i = 0; i < nBlocks; i += 16){
+ for(let t = 0; t < 16; t++){
+ W[t] = M[i + t];
+ }
+ for(let t = 16; t < 64; t++){
+ const s0 = (rotr(W[t - 15], 7) ^ rotr(W[t - 15], 18) ^ W[t - 15]
>>> 3) >>> 0;
+ const s1 = (rotr(W[t - 2], 17) ^ rotr(W[t - 2], 19) ^ W[t - 2] >>>
10) >>> 0;
+ W[t] = W[t - 16] + s0 + W[t - 7] + s1 >>> 0;
+ }
+ let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7;
+ for(let t = 0; t < 64; t++){
+ const S1 = (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) >>> 0;
+ const ch = (e & f ^ ~e & g) >>> 0;
+ const T1 = h + S1 + ch + K[t] + W[t] >>> 0;
+ const S0 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) >>> 0;
+ const maj = (a & b ^ a & c ^ b & c) >>> 0;
+ const T2 = S0 + maj >>> 0;
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1 >>> 0;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2 >>> 0;
+ }
+ h0 = h0 + a >>> 0;
+ h1 = h1 + b >>> 0;
+ h2 = h2 + c >>> 0;
+ h3 = h3 + d >>> 0;
+ h4 = h4 + e >>> 0;
+ h5 = h5 + f >>> 0;
+ h6 = h6 + g >>> 0;
+ h7 = h7 + h >>> 0;
+ }
+ const out = new Uint8Array(32);
+ const H = [
+ h0,
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6,
+ h7
+ ];
+ for(let i = 0; i < 8; i++){
+ out[i * 4 + 0] = H[i] >>> 24 & 0xff;
+ out[i * 4 + 1] = H[i] >>> 16 & 0xff;
+ out[i * 4 + 2] = H[i] >>> 8 & 0xff;
+ out[i * 4 + 3] = H[i] & 0xff;
+ }
+ return u8ToHex(out);
+}
+// --- 通用 SHA-256(浏览器优先,fallback 到纯 JS) ---
+function sha256Hex(input) {
+ return _async_to_generator(function*() {
+ const data = new TextEncoder().encode(input);
+ if (hasSubtle()) {
+ const buf = yield window.crypto.subtle.digest('SHA-256', data);
+ return u8ToHex(new Uint8Array(buf));
+ }
+ // 非 https 或老环境:走纯 JS
+ return sha256HexJS(data);
+ })();
+}
+// --- 你的两个导出函数 ---
function generateUid(obj) {
return _async_to_generator(function*() {
- // 确保属性排序一致
- const jsonString = JSON.stringify(obj, Object.keys(obj).sort());
- // 编码为 UTF-8
- const data = new TextEncoder().encode(jsonString);
- // 显式使用浏览器的 crypto.subtle
- const hashBuffer = yield window.crypto.subtle.digest('SHA-256', data);
- // 转 hex
- return Array.from(new
Uint8Array(hashBuffer)).map((b)=>b.toString(16).padStart(2, '0')).join('');
+ const json = stableStringify(obj);
+ return sha256Hex(json);
})();
}
function generateTableDataUID(items) {
return _async_to_generator(function*() {
- const result = [];
- for (const item of items){
- const uid = yield generateUid(item._original);
- result.push(utils_object_spread_props(utils_object_spread({},
item), {
- _uid: uid
+ // 允许 _original 缺失时退回整个 item;并发计算,更快
+ const sources = items.map((it)=>{
+ var _ref;
+ return (_ref = it && it._original) !== null && _ref !== void 0 ?
_ref : it;
+ });
+ const uids = yield Promise.all(sources.map(generateUid));
+ return items.map((it,
i)=>utils_object_spread_props(utils_object_spread({}, it), {
+ _uid: uids[i]
}));
- }
- return result;
})();
}
@@ -4740,4 +4936,4 @@ function PageDiscover() {
/***/ })
}]);
-//# sourceMappingURL=892.js.map?_cache=24dff9e638b25a5f1233
\ No newline at end of file
+//# sourceMappingURL=892.js.map?_cache=82e6050ef02993d795d5
\ No newline at end of file
diff --git a/src/grafana/plugins/doris-app/892.js.map
b/src/grafana/plugins/doris-app/892.js.map
index 69577b2..9143000 100644
--- a/src/grafana/plugins/doris-app/892.js.map
+++ b/src/grafana/plugins/doris-app/892.js.map
@@ -1 +1 @@
-{"version":3,"file":"892.js?_cache=24dff9e638b25a5f1233","mappings":";;;;;;;;;AAAO,MAAMA,UAAU;IACrBC,WAAW;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;IACV;IACAC,SAAS;QACPC,WAAW;QACXC,gBAAgB;IAClB;IACAC,SAAS;QACPF,WAAW;IACb;IACAG,WAAW;QACTH,WAAW;IACb;IACAI,UAAU;QACRJ,WAAW;QACXK,cAAc;IAChB;AACF,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpBiC;AACE;AAE9B,MAAMG,uBAAuBD,yCAAMA,CAACE,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsB/C,CAAC,CAAC;AAEK,MAAMC,2BAA2BH,yCAAMA,CAACE,GAAG,CAAC;;;;;;;;;;AAUnD,CAAC,CAAC;AAEK,MAAME,gBA
[...]
\ No newline at end of file
+{"version":3,"file":"892.js?_cache=82e6050ef02993d795d5","mappings":";;;;;;;;;AAAO,MAAMA,UAAU;IACrBC,WAAW;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;IACV;IACAC,SAAS;QACPC,WAAW;QACXC,gBAAgB;IAClB;IACAC,SAAS;QACPF,WAAW;IACb;IACAG,WAAW;QACTH,WAAW;IACb;IACAI,UAAU;QACRJ,WAAW;QACXK,cAAc;IAChB;AACF,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpBiC;AACE;AAE9B,MAAMG,uBAAuBD,yCAAMA,CAACE,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsB/C,CAAC,CAAC;AAEK,MAAMC,2BAA2BH,yCAAMA,CAACE,GAAG,CAAC;;;;;;;;;;AAUnD,CAAC,CAAC;AAEK,MAAME,gBA
[...]
\ No newline at end of file
diff --git a/src/grafana/plugins/doris-app/gpx_doris-app_darwin_amd64
b/src/grafana/plugins/doris-app/gpx_doris-app_darwin_amd64
index 0487cd0..bfc1559 100755
Binary files a/src/grafana/plugins/doris-app/gpx_doris-app_darwin_amd64 and
b/src/grafana/plugins/doris-app/gpx_doris-app_darwin_amd64 differ
diff --git a/src/grafana/plugins/doris-app/gpx_doris-app_darwin_arm64
b/src/grafana/plugins/doris-app/gpx_doris-app_darwin_arm64
index 7e99f9e..8c46454 100755
Binary files a/src/grafana/plugins/doris-app/gpx_doris-app_darwin_arm64 and
b/src/grafana/plugins/doris-app/gpx_doris-app_darwin_arm64 differ
diff --git a/src/grafana/plugins/doris-app/gpx_doris-app_linux_amd64
b/src/grafana/plugins/doris-app/gpx_doris-app_linux_amd64
index 6083e9f..240608f 100755
Binary files a/src/grafana/plugins/doris-app/gpx_doris-app_linux_amd64 and
b/src/grafana/plugins/doris-app/gpx_doris-app_linux_amd64 differ
diff --git a/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm
b/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm
index 369e678..aa2be35 100755
Binary files a/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm and
b/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm differ
diff --git a/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm64
b/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm64
index 7d4eac4..347aed6 100755
Binary files a/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm64 and
b/src/grafana/plugins/doris-app/gpx_doris-app_linux_arm64 differ
diff --git a/src/grafana/plugins/doris-app/gpx_doris-app_windows_amd64.exe
b/src/grafana/plugins/doris-app/gpx_doris-app_windows_amd64.exe
index 6081019..5e0c103 100755
Binary files a/src/grafana/plugins/doris-app/gpx_doris-app_windows_amd64.exe
and b/src/grafana/plugins/doris-app/gpx_doris-app_windows_amd64.exe differ
diff --git a/src/grafana/plugins/doris-app/module.js
b/src/grafana/plugins/doris-app/module.js
index c753aeb..6156af6 100644
--- a/src/grafana/plugins/doris-app/module.js
+++ b/src/grafana/plugins/doris-app/module.js
@@ -1192,7 +1192,7 @@ module.exports = domAPI;
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
-/******/ return "" + chunkId + ".js?_cache=" +
{"35":"6d86e876a981760ae4a1","181":"ce826c664576171bad6c","202":"960b652c09389756ed7b","462":"5440070870454b81ce34","632":"20f9d65c2526bb592e0a","723":"cd85aac21ae242f5f0f2","892":"24dff9e638b25a5f1233","906":"c5c71c22310462d0fa64"}[chunkId]
+ "";
+/******/ return "" + chunkId + ".js?_cache=" +
{"35":"6d86e876a981760ae4a1","181":"ce826c664576171bad6c","202":"960b652c09389756ed7b","462":"5440070870454b81ce34","632":"20f9d65c2526bb592e0a","723":"cd85aac21ae242f5f0f2","892":"82e6050ef02993d795d5","906":"c5c71c22310462d0fa64"}[chunkId]
+ "";
/******/ };
/******/ })();
/******/
@@ -1282,7 +1282,7 @@ module.exports = domAPI;
/******/
/******/ /* webpack/runtime/compat */
/******/
-/******/ __webpack_require__.sriHashes =
{"35":"sha256-8TWj0IuqCnw+QkYOR4eAnmDEKCIKywuChqXPt3S4FV0=","181":"sha256-jQioVDwy6+zI6R5tkOP1uFevBjj+G6LCx15ntqcO/8M=","202":"sha256-CN4kzTw1qZgwAinJ1/Yabb8xvpGp0KP+/BizIwiPgfQ=","462":"sha256-JS4wDqS1h7LXA99a07Iy4ej0It/6EsktYnxY1AhffHw=","632":"sha256-MW1oi1N0a/3ek7LCgIZcCVt3rVRNjLXJmSZD8oTGIZY=","723":"sha256-YDvp7Qjz8uu5Sk0fPOr2QrUrKd0OfhzUsNXFLgjBQwM=","892":"sha256-NYdhd6aUU1lpWGlumdC48ds3z8Fa3UBeQ0eFx0qOXS0=","906":"sha256-tEhWWkd4HOGiN1BQ
[...]
+/******/ __webpack_require__.sriHashes =
{"35":"sha256-8TWj0IuqCnw+QkYOR4eAnmDEKCIKywuChqXPt3S4FV0=","181":"sha256-jQioVDwy6+zI6R5tkOP1uFevBjj+G6LCx15ntqcO/8M=","202":"sha256-CN4kzTw1qZgwAinJ1/Yabb8xvpGp0KP+/BizIwiPgfQ=","462":"sha256-JS4wDqS1h7LXA99a07Iy4ej0It/6EsktYnxY1AhffHw=","632":"sha256-MW1oi1N0a/3ek7LCgIZcCVt3rVRNjLXJmSZD8oTGIZY=","723":"sha256-YDvp7Qjz8uu5Sk0fPOr2QrUrKd0OfhzUsNXFLgjBQwM=","892":"sha256-XiOYVIZWnYRcLAJlncmg4EGCFmZyjy+5CalJVSwaats=","906":"sha256-tEhWWkd4HOGiN1BQ
[...]
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
diff --git a/src/grafana/plugins/doris-app/module.js.map
b/src/grafana/plugins/doris-app/module.js.map
index f4d1dd9..a5571b6 100644
--- a/src/grafana/plugins/doris-app/module.js.map
+++ b/src/grafana/plugins/doris-app/module.js.map
@@ -1 +1 @@
-{"version":3,"file":"module.js","mappings":";;;;;;;;AAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA,gDAAgD;AAChD;AACA;AACA,qFAAqF;AACrF;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qBAAqB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,sFAAsF,qBAAqB;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV
[...]
\ No newline at end of file
+{"version":3,"file":"module.js","mappings":";;;;;;;;AAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA,gDAAgD;AAChD;AACA;AACA,qFAAqF;AACrF;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qBAAqB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,sFAAsF,qBAAqB;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV
[...]
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]