Skip to content

Commit

Permalink
Improve GetCertByDomain(), improve web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Oct 14, 2023
1 parent b120ab0 commit 4ed8c6f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
4 changes: 4 additions & 0 deletions object/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ func getCertMap() (map[string]*Cert, error) {
}

func GetCertByDomain(domain string) (*Cert, error) {
if domain == "" {
return nil, fmt.Errorf("GetCertByDomain() error: domain should not be empty")
}

cert, ok := certMap[domain]
if ok {
return cert, nil
Expand Down
24 changes: 12 additions & 12 deletions web/src/CertListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ class CertListPage extends React.Component {
);
},
},
// {
// title: i18next.t("general:Create time"),
// dataIndex: "createdTime",
// key: "createdTime",
// width: "150px",
// sorter: (a, b) => a.createdTime.localeCompare(b.createdTime),
// render: (text, record, index) => {
// return Setting.getFormattedDate(text);
// },
// },
{
title: i18next.t("general:Create time"),
dataIndex: "createdTime",
key: "createdTime",
width: "150px",
sorter: (a, b) => a.createdTime.localeCompare(b.createdTime),
render: (text, record, index) => {
return Setting.getFormattedDate(text);
},
},
// {
// title: i18next.t("general:Display name"),
// dataIndex: "displayName",
Expand Down Expand Up @@ -200,7 +200,7 @@ class CertListPage extends React.Component {
width: "180px",
sorter: (a, b) => a.certificate.localeCompare(b.certificate),
render: (text, record, index) => {
return Setting.getShortText(text, 70);
return Setting.getShortText(text);
},
},
{
Expand All @@ -210,7 +210,7 @@ class CertListPage extends React.Component {
width: "180px",
sorter: (a, b) => a.privateKey.localeCompare(b.privateKey),
render: (text, record, index) => {
return Setting.getShortText(text, 70);
return Setting.getShortText(text);
},
},
{
Expand Down
9 changes: 6 additions & 3 deletions web/src/SiteListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SiteListPage extends React.Component {
challenges: [],
host: "",
port: 8000,
sslMode: "HTTP",
sslMode: "HTTPS Only",
sslCert: "",
publicIp: "",
node: "",
Expand Down Expand Up @@ -202,6 +202,9 @@ class SiteListPage extends React.Component {
}

if (!record.isSelf) {
if (text.includes(":/")) {
return Setting.getShortText(text, 10);
}
return text;
}

Expand Down Expand Up @@ -292,14 +295,14 @@ class SiteListPage extends React.Component {
title: i18next.t("site:Mode"),
dataIndex: "sslMode",
key: "sslMode",
width: "120px",
width: "100px",
sorter: (a, b) => a.sslMode.localeCompare(b.sslMode),
},
{
title: i18next.t("site:SSL cert"),
dataIndex: "sslCert",
key: "sslCert",
width: "150px",
width: "130px",
sorter: (a, b) => a.sslCert.localeCompare(b.sslCert),
render: (text, record, index) => {
return (
Expand Down

0 comments on commit 4ed8c6f

Please sign in to comment.