Fix: Add the prefix for http url (#471)

This commit is contained in:
Fine0830 2025-05-30 15:37:27 +08:00 committed by GitHub
parent 7dcc67f455
commit 1f651cf528
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View File

@ -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`,
};

View File

@ -21,7 +21,13 @@ limitations under the License. -->
:row-style="{ backgroundColor: 'var(--layout-background)' }"
>
<el-table-column v-for="item in MetricsTTLRow" :prop="item.value" :label="item.label" :key="item.value">
<template #default="scope">{{ scope.row[item.value] < 0 ? "N/A" : scope.row[item.value] }}</template>
{{
settingsStore.configTTL?.metrics
? settingsStore.configTTL.metrics[item.value] < 0
? "N/A"
: (settingsStore.configTTL?.metrics ?? {})[item.value]
: "N/A"
}}
</el-table-column>
</el-table>
<div class="label">{{ t("recordsTTL") }}</div>
@ -31,7 +37,13 @@ limitations under the License. -->
:row-style="{ backgroundColor: 'var(--layout-background)' }"
>
<el-table-column v-for="item in RecordsTTLRow" :prop="item.value" :label="item.label" :key="item.value">
<template #default="scope">{{ scope.row[item.value] < 0 ? "N/A" : scope.row[item.value] }}</template>
{{
settingsStore.configTTL?.records
? settingsStore.configTTL?.records[item.value] < 0
? "N/A"
: (settingsStore.configTTL?.records || {})[item.value]
: "N/A"
}}
</el-table-column>
</el-table>
</div>