Compare commits

...

2 Commits

Author SHA1 Message Date
xiao-kong-long
2cb6ff69ae fix: show selected organizations' statistics in dashboard page (#2805)
* fix: show selected organizations' statistics in dashboard page

* Update get-dashboard.go

* Update saml_idp.go

---------

Co-authored-by: Eric Luo <hsluoyz@qq.com>
2024-03-15 19:36:39 +08:00
leon.zhao
e1e5943a3e fix: fix the issue of adding xmlns="" when generating XML (#2799)
* fix:solve the problem of adding xmlns="" when generating XML

* fix:remove fmt.Println

* Update saml_idp.go

---------

Co-authored-by: zhaoxianfei <zhaoxianfei@meiqia.cn>
Co-authored-by: Eric Luo <hsluoyz@qq.com>
2024-03-13 23:59:05 +08:00
2 changed files with 24 additions and 3 deletions

View File

@@ -179,8 +179,8 @@ type IdpSSODescriptor struct {
}
type NameIDFormat struct {
XMLName xml.Name
Value string `xml:",innerxml"`
// XMLName xml.Name
Value string `xml:",innerxml"`
}
type SingleSignOnService struct {
@@ -190,7 +190,7 @@ type SingleSignOnService struct {
}
type Attribute struct {
XMLName xml.Name
// XMLName xml.Name
Name string `xml:"Name,attr"`
NameFormat string `xml:"NameFormat,attr"`
FriendlyName string `xml:"FriendlyName,attr"`

View File

@@ -31,6 +31,11 @@ const Dashboard = (props) => {
return () => window.removeEventListener("storageTourChanged", handleTourChange);
}, []);
React.useEffect(() => {
window.addEventListener("storageOrganizationChanged", handleOrganizationChange);
return () => window.removeEventListener("storageOrganizationChanged", handleOrganizationChange);
}, [props.owner]);
React.useEffect(() => {
if (!Setting.isLocalAdminUser(props.account)) {
props.history.push("/apps");
@@ -54,6 +59,22 @@ const Dashboard = (props) => {
setIsTourVisible(TourConfig.getTourVisible());
};
const handleOrganizationChange = () => {
if (!Setting.isLocalAdminUser(props.account)) {
return;
}
const newOrganization = localStorage.getItem("organization") === "All" ? "" : localStorage.getItem("organization");
DashboardBackend.getDashboard(newOrganization).then((res) => {
if (res.status === "ok") {
setDashboardData(res.data);
} else {
Setting.showMessage("error", res.msg);
}
});
};
const setIsTourToLocal = () => {
TourConfig.setIsTourVisible(false);
setIsTourVisible(false);