Compare commits

..

1 Commits

Author SHA1 Message Date
hsluoyz
fa01aa99fa Revert "feat: fix UI in IE11 (#1878)"
This reverts commit 44cd55e55f.
2023-05-22 22:20:35 +08:00
2 changed files with 3 additions and 42 deletions

View File

@@ -15,8 +15,6 @@
package routers
import (
"compress/gzip"
"io"
"net/http"
"os"
"strings"
@@ -30,7 +28,6 @@ import (
var (
oldStaticBaseUrl = "https://cdn.casbin.org"
newStaticBaseUrl = conf.GetConfigString("staticBaseUrl")
enableGzip, _ = conf.GetConfigBool("enableGzip")
)
func StaticFilter(ctx *context.Context) {
@@ -56,7 +53,7 @@ func StaticFilter(ctx *context.Context) {
path2 := strings.TrimLeft(path, "web/build/images/")
if util.FileExist(path2) {
makeGzipResponse(ctx.ResponseWriter, ctx.Request, path2)
http.ServeFile(ctx.ResponseWriter, ctx.Request, path2)
return
}
@@ -65,7 +62,7 @@ func StaticFilter(ctx *context.Context) {
}
if oldStaticBaseUrl == newStaticBaseUrl {
makeGzipResponse(ctx.ResponseWriter, ctx.Request, path)
http.ServeFile(ctx.ResponseWriter, ctx.Request, path)
} else {
serveFileWithReplace(ctx.ResponseWriter, ctx.Request, path, oldStaticBaseUrl, newStaticBaseUrl)
}
@@ -92,24 +89,3 @@ func serveFileWithReplace(w http.ResponseWriter, r *http.Request, name string, o
panic(err)
}
}
type gzipResponseWriter struct {
io.Writer
http.ResponseWriter
}
func (w gzipResponseWriter) Write(b []byte) (int, error) {
return w.Writer.Write(b)
}
func makeGzipResponse(w http.ResponseWriter, r *http.Request, path string) {
if !enableGzip || !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
http.ServeFile(w, r, path)
return
}
w.Header().Set("Content-Encoding", "gzip")
gz := gzip.NewWriter(w)
defer gz.Close()
gzw := gzipResponseWriter{Writer: gz, ResponseWriter: w}
http.ServeFile(gzw, r, path)
}

View File

@@ -99,21 +99,6 @@ class ResourceListPage extends BaseListPage {
);
},
},
{
title: i18next.t("general:Organization"),
dataIndex: "owner",
key: "owner",
width: "120px",
sorter: true,
...this.getColumnSearchProps("owner"),
render: (text, record, index) => {
return (
<Link to={`/organizations/${text}`}>
{text}
</Link>
);
},
},
{
title: i18next.t("general:Application"),
dataIndex: "application",
@@ -303,7 +288,7 @@ class ResourceListPage extends BaseListPage {
const field = params.searchedColumn, value = params.searchText;
const sortField = params.sortField, sortOrder = params.sortOrder;
this.setState({loading: true});
ResourceBackend.getResources(Setting.isAdminUser(this.props.account) ? "" : this.props.account.owner, this.props.account.name, params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
ResourceBackend.getResources("admin", this.props.account.name, params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
.then((res) => {
if (res.status === "ok") {
this.setState({