From 1f651cf528452537f4c378228eb95d055244c83f Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Fri, 30 May 2025 15:37:27 +0800 Subject: [PATCH] Fix: Add the prefix for http url (#471) --- src/graphql/http/url.ts | 8 ++++---- src/views/settings/components/TTL.vue | 16 ++++++++++++++-- 2 files changed, 18 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..5e2a6ea8 100644 --- a/src/views/settings/components/TTL.vue +++ b/src/views/settings/components/TTL.vue @@ -21,7 +21,13 @@ limitations under the License. --> :row-style="{ backgroundColor: 'var(--layout-background)' }" > - + {{ + settingsStore.configTTL?.metrics + ? settingsStore.configTTL.metrics[item.value] < 0 + ? "N/A" + : (settingsStore.configTTL?.metrics ?? {})[item.value] + : "N/A" + }}
{{ t("recordsTTL") }}
@@ -31,7 +37,13 @@ limitations under the License. --> :row-style="{ backgroundColor: 'var(--layout-background)' }" > - + {{ + settingsStore.configTTL?.records + ? settingsStore.configTTL?.records[item.value] < 0 + ? "N/A" + : (settingsStore.configTTL?.records || {})[item.value] + : "N/A" + }}