From b53edd4ecc54d9c45ef1cb398dbb6d1091965335 Mon Sep 17 00:00:00 2001 From: Fine Date: Fri, 30 May 2025 15:23:33 +0800 Subject: [PATCH] add PREFIX for http url --- src/graphql/http/url.ts | 8 ++++---- src/views/settings/components/TTL.vue | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/graphql/http/url.ts b/src/graphql/http/url.ts index 695f1acd..7ed61e89 100644 --- a/src/graphql/http/url.ts +++ b/src/graphql/http/url.ts @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +const PREFIX = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test" ? "/api" : ""; export const HttpURL = { - ClusterNodes: `/api/status/cluster/nodes`, - ConfigTTL: `/api/status/config/ttl`, - DebuggingConfigDump: `/api/debugging/config/dump`, + ClusterNodes: `${PREFIX}/status/cluster/nodes`, + ConfigTTL: `${PREFIX}/status/config/ttl`, + DebuggingConfigDump: `${PREFIX}/debugging/config/dump`, }; diff --git a/src/views/settings/components/TTL.vue b/src/views/settings/components/TTL.vue index 4e0ba92e..2cf7e634 100644 --- a/src/views/settings/components/TTL.vue +++ b/src/views/settings/components/TTL.vue @@ -21,7 +21,11 @@ limitations under the License. --> :row-style="{ backgroundColor: 'var(--layout-background)' }" > - + {{ + (settingsStore.configTTL?.metrics || {})[item.value] < 0 + ? "N/A" + : (settingsStore.configTTL?.metrics || {})[item.value] + }}
{{ t("recordsTTL") }}
@@ -31,7 +35,11 @@ limitations under the License. --> :row-style="{ backgroundColor: 'var(--layout-background)' }" > - + {{ + (settingsStore.configTTL?.records || {})[item.value] < 0 + ? "N/A" + : (settingsStore.configTTL?.records || {})[item.value] + }}