From 5e04b8c72653bc43fcd97bcc420d55fc69f708ce Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sat, 6 Mar 2021 21:50:48 +0800 Subject: [PATCH] Add HomepageUrl and Description to app. --- object/application.go | 2 ++ web/src/ApplicationEditPage.js | 20 ++++++++++++++++++++ web/src/auth/Face.js | 18 +++++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/object/application.go b/object/application.go index 96f5e88c..83010fa7 100644 --- a/object/application.go +++ b/object/application.go @@ -26,6 +26,8 @@ type Application struct { DisplayName string `xorm:"varchar(100)" json:"displayName"` Logo string `xorm:"varchar(100)" json:"logo"` + HomepageUrl string `xorm:"varchar(100)" json:"homepageUrl"` + Description string `xorm:"varchar(100)" json:"description"` Organization string `xorm:"varchar(100)" json:"organization"` EnablePassword bool `json:"enablePassword"` Providers []string `xorm:"varchar(100)" json:"providers"` diff --git a/web/src/ApplicationEditPage.js b/web/src/ApplicationEditPage.js index 38fd97f1..d4f88695 100644 --- a/web/src/ApplicationEditPage.js +++ b/web/src/ApplicationEditPage.js @@ -142,6 +142,26 @@ class ApplicationEditPage extends React.Component { + + + {i18next.t("general:Homepage URL")}: + + + } value={this.state.application.homepageUrl} onChange={e => { + this.updateApplicationField('homepageUrl', e.target.value); + }} /> + + + + + {i18next.t("general:Description")}: + + + { + this.updateApplicationField('description', e.target.value); + }} /> + + {i18next.t("general:Organization")}: diff --git a/web/src/auth/Face.js b/web/src/auth/Face.js index 2a18f70e..b0181a12 100644 --- a/web/src/auth/Face.js +++ b/web/src/auth/Face.js @@ -149,6 +149,20 @@ class Face extends React.Component { ); } + renderLogo(application) { + if (application.homepageUrl !== "") { + return ( + + {application.displayName} + + ) + } else { + return ( + {application.displayName} + ); + } + } + render() { const application = this.getApplicationObj(); if (application === null) { @@ -159,7 +173,9 @@ class Face extends React.Component {
- {application.displayName} + { + this.renderLogo(application) + } { this.renderForm(application) }