diff --git a/client/src/index.css b/client/src/index.css index 4ddf7cd..ab822a3 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -69,4 +69,8 @@ .MuiAlert-icon { align-items: center; +} + +.loading-image { + background: url('/assets/images/icons/cosmos_gray.png') no-repeat center center; } \ No newline at end of file diff --git a/client/src/pages/config/routes/routeoverview.jsx b/client/src/pages/config/routes/routeoverview.jsx index 925b5ed..8f971d2 100644 --- a/client/src/pages/config/routes/routeoverview.jsx +++ b/client/src/pages/config/routes/routeoverview.jsx @@ -38,7 +38,7 @@ const RouteOverview = ({ routeConfig }) => { }>
- +
Description diff --git a/client/src/pages/config/users/proxyman.jsx b/client/src/pages/config/users/proxyman.jsx index b6c40c9..0f4ec6e 100644 --- a/client/src/pages/config/users/proxyman.jsx +++ b/client/src/pages/config/users/proxyman.jsx @@ -154,7 +154,7 @@ const ProxyManagement = () => { columns={[ { title: '', - field: (r) => , + field: (r) => , style: { textAlign: 'center', }, diff --git a/client/src/pages/home/index.jsx b/client/src/pages/home/index.jsx index c8cdf70..f7231af 100644 --- a/client/src/pages/home/index.jsx +++ b/client/src/pages/home/index.jsx @@ -147,7 +147,7 @@ const HomePage = () => { - +

{route.Name}

diff --git a/client/src/pages/servapps/containers/overview.jsx b/client/src/pages/servapps/containers/overview.jsx index 230a435..34998fd 100644 --- a/client/src/pages/servapps/containers/overview.jsx +++ b/client/src/pages/servapps/containers/overview.jsx @@ -66,7 +66,7 @@ const ContainerOverview = ({ containerInfo, config, refresh }) => {
- + {isUpdating ? ( { } - + {app.Names[0].replace('/', '')}  diff --git a/package.json b/package.json index fbb4845..46d9edc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.5.0-unstable21", + "version": "0.5.0-unstable22", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/icons.go b/src/icons.go index 04eda0d..d0560df 100644 --- a/src/icons.go +++ b/src/icons.go @@ -8,7 +8,6 @@ import ( "os" "io/ioutil" "encoding/json" - "strconv" "path" "go.deanishe.net/favicon" @@ -81,41 +80,34 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) { return } + var icons []*favicon.Icon + // follow siteurl and check if any redirect. respNew, err := http.Get(siteurl) + if err != nil { utils.Error("FaviconFetch", err) - sendFallback(w) - return + icons = []*favicon.Icon{ + &favicon.Icon{URL: "favicon.png", Width: 0}, + &favicon.Icon{URL: "/favicon.png", Width: 0}, + &favicon.Icon{URL: "favicon.ico", Width: 0}, + &favicon.Icon{URL: "/favicon.ico", Width: 0}, + } + } else { + siteurl = respNew.Request.URL.String() + icons, err = favicon.Find(siteurl) + + if err != nil || len(icons) == 0 { + icons = []*favicon.Icon{ + &favicon.Icon{URL: "favicon.png", Width: 0}, + &favicon.Icon{URL: "/favicon.png", Width: 0}, + &favicon.Icon{URL: "favicon.ico", Width: 0}, + &favicon.Icon{URL: "/favicon.ico", Width: 0}, + } + } } - newsiteurl := respNew.Request.URL.String() - - icons, err := favicon.Find(newsiteurl) - - utils.Debug("Found Favicon: " + strconv.Itoa(len(icons))) - if err != nil { - utils.Error("FaviconFetch", err) - sendFallback(w) - return - } - - if len(icons) == 0 { - utils.Error("FaviconFetch", err) - sendFallback(w) - return - } - - // if !strings.Contains(icons[iconIndex].URL, "favicon.ico") { - // icons = append(icons, favicon.Icon{URL: "favicon.ico", Width: 0}) - // } - - // if !strings.Contains(icons[iconIndex].URL, "/favicon.ico") { - // icons = append(icons, favicon.Icon{URL: "/favicon.ico", Width: 0}) - // } - for _, icon := range icons { - utils.Debug("Favicon Width: " + icon.URL + " " + strconv.Itoa(icon.Width)) if icon.Width <= 256 { iconURL := icon.URL @@ -145,6 +137,7 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) { } utils.Log("Favicon Trying to fetch " + iconURL) + // Fetch the favicon resp, err := http.Get(iconURL) if err != nil { @@ -165,9 +158,8 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) { // Cache the response body, err := ioutil.ReadAll(resp.Body) if err != nil { - utils.Error("FaviconFetch", err) - sendFallback(w) - return + utils.Error("FaviconFetch - cant read ", err) + continue } finalImage := CachedImage{ @@ -181,12 +173,11 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) { sendImage(w, cache[siteurl]) return } - - utils.Log("Favicon final fallback ") - sendFallback(w) - return } } + utils.Log("Favicon final fallback") + sendFallback(w) + return } else { utils.Error("Favicon: Method not allowed" + req.Method, nil)