feat: fix the order of Method and Name in System Info (#1797)

* fix: fixed the order of Method and Name in System Info

* fix: add i18n for System Info
This commit is contained in:
OutOfEastGate 2023-04-28 22:11:10 +08:00 committed by GitHub
parent f272be67ab
commit 66c15578b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 67 additions and 26 deletions

View File

@ -189,7 +189,7 @@ func (c *ApiController) Finish() {
startTime := c.Ctx.Input.GetData("startTime")
if startTime != nil {
latency := time.Since(startTime.(time.Time)).Milliseconds()
object.ApiLatency.WithLabelValues(c.Ctx.Input.Method(), c.Ctx.Input.URL()).Observe(float64(latency))
object.ApiLatency.WithLabelValues(c.Ctx.Input.URL(), c.Ctx.Input.Method()).Observe(float64(latency))
}
}
c.Controller.Finish()

View File

@ -36,8 +36,8 @@ type GaugeVecInfo struct {
}
type HistogramVecInfo struct {
Name string `json:"name"`
Method string `json:"method"`
Name string `json:"name"`
Count uint64 `json:"count"`
Latency string `json:"latency"`
}

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "Primärschlüssel in einer Tabelle, wie beispielsweise eine ID"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "API Latenz",
"API Throughput": "API-Durchsatz",
"About Casdoor": "Über Casdoor",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "Eine Identitäts- und Zugriffsverwaltung (IAM) / Single-Sign-On (SSO) Plattform mit Web-UI, die OAuth 2.0, OIDC, SAML und CAS unterstützt",
"CPU Usage": "CPU-Auslastung",
"Community": "Community",
"Count": "Zählen",
"Failed to get CPU usage": "Konnte CPU-Auslastung nicht abrufen",
"Failed to get memory usage": "Fehler beim Abrufen der Speichernutzung",
"Latency": "Latenz",
"Memory Usage": "Speichernutzung",
"Official website": "Offizielle Webseite",
"Throughput": "Durchsatz",
"Total Throughput": "Gesamtdurchsatz",
"Unknown version": "Unbekannte Version",
"Version": "Version"
},

View File

@ -709,10 +709,14 @@
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS",
"CPU Usage": "CPU Usage",
"Community": "Community",
"Count": "Count",
"Failed to get CPU usage": "Failed to get CPU usage",
"Failed to get memory usage": "Failed to get memory usage",
"Latency": "Latency",
"Memory Usage": "Memory Usage",
"Official website": "Official website",
"Throughput": "Throughput",
"Total Throughput": "Total Throughput",
"Unknown version": "Unknown version",
"Version": "Version"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "Clave primaria de la tabla, como id"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "Retraso API",
"API Throughput": "Rendimiento API",
"About Casdoor": "Sobre Casdoor",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "Una plataforma de Gestión de Identidades y Accesos (IAM) / Single-Sign-On (SSO) con una interfaz web que admite OAuth 2.0, OIDC, SAML y CAS",
"CPU Usage": "Uso de la CPU",
"Community": "Comunidad",
"Count": "Contar",
"Failed to get CPU usage": "No se pudo obtener el uso de la CPU",
"Failed to get memory usage": "No se pudo obtener el uso de la memoria",
"Latency": "Retraso",
"Memory Usage": "Uso de memoria",
"Official website": "Sitio web oficial",
"Throughput": "Rendimiento",
"Total Throughput": "Rendimiento total",
"Unknown version": "Versión desconocida",
"Version": "Versión"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "Clé primaire de la table, telle que l'id"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "Retard API",
"API Throughput": "Débit API",
"About Casdoor": "À propos de Casdoor",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "Une plateforme de gestion d'identité et d'accès (IAM) / d'authentification unique (SSO) avec une interface utilisateur web prenant en charge OAuth 2.0, OIDC, SAML et CAS",
"CPU Usage": "Utilisation du processeur",
"Community": "Communauté",
"Count": "Comptage",
"Failed to get CPU usage": "Echec de récupération de l'utilisation du processeur (CPU)",
"Failed to get memory usage": "Échec de l'obtention de l'utilisation de la mémoire",
"Latency": "Retard",
"Memory Usage": "Utilisation de la mémoire",
"Official website": "Site web officiel",
"Throughput": "Débit",
"Total Throughput": "Débit total",
"Unknown version": "Version inconnue",
"Version": " Version"
},

View File

@ -709,10 +709,14 @@
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "Platform Identitas dan Akses Manajemen (IAM) / Single-Sign-On (SSO) dengan antarmuka web yang mendukung OAuth 2.0, OIDC, SAML, dan CAS",
"CPU Usage": "Penggunaan CPU",
"Community": "Komunitas",
"Count": "Kiraan",
"Failed to get CPU usage": "Gagal mendapatkan penggunaan CPU",
"Failed to get memory usage": "Gagal mendapatkan penggunaan memori",
"Latency": "Latency",
"Memory Usage": "Penggunaan Memori",
"Official website": "Situs web resmi",
"Throughput": "Melalui",
"Total Throughput": "Jumlah Keluaran",
"Unknown version": "Versi tidak diketahui",
"Version": "Versi"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "テーブルのプライマリキー、例えばid"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "API遅延",
"API Throughput": "APIスループット",
"About Casdoor": "Casdoorについて",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "ウェブUIを備えたアイデンティティおよびアクセス管理IAM/シングルサインオンSSOプラットフォームで、OAuth 2.0、OIDC、SAML、およびCASをサポートしています",
"CPU Usage": "CPU使用率",
"Community": "コミュニティ",
"Count": "カウント",
"Failed to get CPU usage": "CPU使用率を取得できませんでした",
"Failed to get memory usage": "メモリ使用量を取得できませんでした",
"Latency": "遅延",
"Memory Usage": "メモリ使用量",
"Official website": "公式ウェブサイト",
"Throughput": "スループット",
"Total Throughput": "総スループット",
"Unknown version": "不明なバージョン",
"Version": "バージョン"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "테이블의 기본 키, 예를 들어 id"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "API 지연",
"API Throughput": "API 처리량",
"About Casdoor": "카스도어에 대해",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "웹 UI를 지원하는 ID 및 액세스 관리 (IAM) / 단일 사인온 (SSO) 플랫폼으로 OAuth 2.0, OIDC, SAML 및 CAS를 지원합니다",
"CPU Usage": "CPU 사용량",
"Community": "커뮤니티",
"Count": "카운트",
"Failed to get CPU usage": "CPU 사용률을 얻지 못했습니다",
"Failed to get memory usage": "메모리 사용률을 가져오는 데 실패했습니다",
"Latency": "지연",
"Memory Usage": "메모리 사용량",
"Official website": "공식 웹사이트",
"Throughput": "처리량",
"Total Throughput": "총 처리량",
"Unknown version": "알 수 없는 버전",
"Version": "버전"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "Идентификатор (id) - основной ключ таблицы"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "Задержка API",
"API Throughput": "Пропускная способность API",
"About Casdoor": "Об Casdoor",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "Платформа управления идентификацией и доступом (IAM) / единый вход в систему (SSO) с веб-интерфейсом, поддерживающая OAuth 2.0, OIDC, SAML и CAS",
"CPU Usage": "Использование ЦПУ",
"Community": "Сообщество",
"Count": "Количество",
"Failed to get CPU usage": "Не удалось получить использование процессора",
"Failed to get memory usage": "Не удалось получить использование памяти",
"Latency": "Задержка",
"Memory Usage": "Использование памяти",
"Official website": "Официальный веб-сайт",
"Throughput": "Пропускная способность",
"Total Throughput": "Общая пропускная способность",
"Unknown version": "Неизвестная версия",
"Version": "Версия"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "Khóa chính của bảng, ví dụ như id"
},
"system": {
"API Latency": "API Latency",
"API Throughput": "API Throughput",
"API Latency": "Độ trễ API",
"API Throughput": "Thông lượng API",
"About Casdoor": "Về Casdoor",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "Một nền tảng Quản lý Danh tính và Truy cập (IAM) / Đăng nhập Một lần (SSO) với giao diện người dùng web hỗ trợ OAuth 2.0, OIDC, SAML và CAS",
"CPU Usage": "Sử dụng CPU",
"Community": "Cộng đồng",
"Count": "Đếm",
"Failed to get CPU usage": "Không thể lấy được thông tin sử dụng CPU",
"Failed to get memory usage": "Không thể lấy được thông tin về sử dụng bộ nhớ",
"Latency": "Trì hoãn",
"Memory Usage": "Sử dụng bộ nhớ",
"Official website": "Trang web chính thức",
"Throughput": "Thông lượng",
"Total Throughput": "Tổng thông lượng",
"Unknown version": "Phiên bản không rõ",
"Version": "Phiên bản"
},

View File

@ -703,16 +703,20 @@
"Table primary key - Tooltip": "表主键如id等"
},
"system": {
"API Latency": "API延迟",
"API Throughput": "API吞吐量",
"API Latency": "API 延迟",
"API Throughput": "API 吞吐量",
"About Casdoor": "关于Casdoor",
"An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS": "一个支持OAuth 2.0、OIDC、SAML和CAS的Web UI优先的身份和访问管理IAM/单点登录SSO平台",
"CPU Usage": "CPU使用率",
"Community": "社区",
"Count": "次数",
"Failed to get CPU usage": "获取CPU使用率失败",
"Failed to get memory usage": "获取内存使用率失败",
"Latency": "延迟",
"Memory Usage": "内存使用率",
"Official website": "官方网站",
"Throughput": "吞吐量",
"Total Throughput": "总吞吐量",
"Unknown version": "未知版本",
"Version": "版本"
},

View File

@ -14,6 +14,7 @@
import React from "react";
import {Table} from "antd";
import i18next from "i18next";
class PrometheusInfoTable extends React.Component {
constructor(props) {
@ -25,39 +26,39 @@ class PrometheusInfoTable extends React.Component {
render() {
const latencyColumns = [
{
title: "Name",
title: i18next.t("general:Name"),
dataIndex: "name",
key: "name",
},
{
title: "Method",
title: i18next.t("general:Method"),
dataIndex: "method",
key: "method",
},
{
title: "Count",
title: i18next.t("system:Count"),
dataIndex: "count",
key: "count",
},
{
title: "Latency(ms)",
title: i18next.t("system:Latency") + "(ms)",
dataIndex: "latency",
key: "latency",
},
];
const throughputColumns = [
{
title: "Name",
title: i18next.t("general:Name"),
dataIndex: "name",
key: "name",
},
{
title: "Method",
title: i18next.t("general:Method"),
dataIndex: "method",
key: "method",
},
{
title: "Throughput",
title: i18next.t("system:Throughput"),
dataIndex: "throughput",
key: "throughput",
},
@ -71,7 +72,7 @@ class PrometheusInfoTable extends React.Component {
} else if (this.state.table === "throughput") {
return (
<div style={{height: "300px", overflow: "auto"}}>
Total Throughput: {this.props.prometheusInfo.totalThroughput}
{i18next.t("system:Total Throughput")}: {this.props.prometheusInfo.totalThroughput}
<Table columns={throughputColumns} dataSource={this.props.prometheusInfo.apiThroughput} pagination={false} />
</div>
);