Skip to content

Commit

Permalink
Merge pull request #1106 from kl7sn/main
Browse files Browse the repository at this point in the history
  • Loading branch information
kl7sn committed Nov 21, 2023
2 parents 3a30496 + df9fe53 commit 32af262
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: |
export PATH=$(go env GOPATH)/bin:$PATH
go version
go install github.com/gotomicro/eapi/cmd/eapi@main
go install github.com/gotomicro/eapi/cmd/eapi@v0.4.6
eapi --config eapi.yaml
- name: install redoc
run: npm i -g redoc-cli
Expand Down
6 changes: 4 additions & 2 deletions api/internal/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"net/http"
"strings"
"time"

"github.com/gotomicro/ego/core/econf"
"github.com/gotomicro/ego/server/egin"
Expand Down Expand Up @@ -38,9 +39,10 @@ func GetServerRouter() *egin.Component {
}
maxAge := econf.GetInt("server.http.maxAge")
if maxAge == 0 {
maxAge = 86400
maxAge = 31536000
}
c.Header("Cache-Control", fmt.Sprintf("public, max-age=%d", maxAge))
c.Header("Cache-Control", fmt.Sprintf("public, max-age=%d, public", maxAge))
c.Header("Expires", time.Now().AddDate(1, 0, 0).Format("Mon, 01 Jan 2006 00:00:00 GMT"))
path := strings.Replace(c.Request.URL.Path, appSubUrl, "", 1)
c.FileFromFS(path, invoker.Gin.HTTPEmbedFs())
}))
Expand Down
5 changes: 4 additions & 1 deletion ui/src/components/JsonView/JsonStringValue/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import jsonViewStyles from "@/components/JsonView/index.less";
import classNames from "classnames";
import { LOGMAXTEXTLENGTH } from "@/config/config";
import {LOGMAXTEXTLENGTH, LOGMAXTEXTLENGTHUnParse} from "@/config/config";
import { Button, message } from "antd";
import { useState } from "react";
import { useIntl } from "umi";
Expand Down Expand Up @@ -205,6 +205,9 @@ const JsonStringValue = ({
};

const splitRawLogString = (str: string): string[] => {
if(str.length>LOGMAXTEXTLENGTHUnParse){
return [str]
}
const result: string[] = [];
const strLen = str.length;

Expand Down
1 change: 1 addition & 0 deletions ui/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const LANG_CN = "zh-CN";

// 不展开日志最大长度
export const LOGMAXTEXTLENGTH = 500;
export const LOGMAXTEXTLENGTHUnParse = 5120;

// // 默认链路日志查询条数
export const LINKLOGS_PAGESIZE = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ const DatabaseItem = (props: { databasesItem: any; onGetList: any }) => {
</div>
</div>
);

let nameDesc = databasesItem.databaseName;
if (databasesItem.desc) {
// 只取desc前7个字符
nameDesc += " (" + databasesItem.desc.substring(0, 7) + ")";
}
return (
<Dropdown menu={{ items: items }} trigger={["contextMenu"]}>
<Tooltip
Expand All @@ -148,7 +152,7 @@ const DatabaseItem = (props: { databasesItem: any; onGetList: any }) => {
}}
>
<IconFont type="icon-database" style={{ marginRight: "4px" }} />
{databasesItem.databaseName}
{nameDesc}
</div>
</Tooltip>
</Dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ const InstanceItem = (props: { instanceItem: any }) => {
},
];

let nameDesc = instanceItem.instanceName;
if (instanceItem.desc) {
// 只取desc前7个字符
nameDesc += " (" + instanceItem.desc.substring(0, 7) + ")";
}
return (
<Dropdown menu={{ items: menuList }} trigger={["contextMenu"]}>
<Tooltip
Expand All @@ -76,7 +81,7 @@ const InstanceItem = (props: { instanceItem: any }) => {
}}
>
<IconFont type="icon-instance" style={{ marginRight: "4px" }} />
{instanceItem.instanceName} {instanceItem.desc}
{nameDesc}
</div>
</Tooltip>
</Dropdown>
Expand Down

0 comments on commit 32af262

Please sign in to comment.