diff --git a/backend/init/router/router.go b/backend/init/router/router.go index d980ef6f4..b83726d67 100644 --- a/backend/init/router/router.go +++ b/backend/init/router/router.go @@ -1,11 +1,10 @@ package router import ( + "fmt" + "github.com/gin-contrib/gzip" "html/template" "net/http" - "strings" - - "github.com/gin-contrib/gzip" "github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/i18n" @@ -22,12 +21,10 @@ import ( func setWebStatic(rootRouter *gin.RouterGroup) { rootRouter.StaticFS("/public", http.FS(web.Favicon)) rootRouter.Use(func(c *gin.Context) { - if strings.HasPrefix(c.Request.URL.Path, "/assets/") { - c.Header("Cache-Control", "max-age=31536000") - } c.Next() }) rootRouter.GET("/assets/*filepath", func(c *gin.Context) { + c.Writer.Header().Set("Cache-Control", fmt.Sprintf("private, max-age=%d", 3600)) staticServer := http.FileServer(http.FS(web.Assets)) staticServer.ServeHTTP(c.Writer, c.Request) }) diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue index a0a130e15..ebc077feb 100644 --- a/frontend/src/views/app-store/apps/index.vue +++ b/frontend/src/views/app-store/apps/index.vue @@ -256,7 +256,7 @@ const openInstall = (app: App.App) => { }; const openDetail = (key: string) => { - detailRef.value.acceptParams(key); + detailRef.value.acceptParams(key, 'install'); }; const sync = () => { diff --git a/frontend/src/views/app-store/detail/index.vue b/frontend/src/views/app-store/detail/index.vue index 15919c7d0..5e48fb3a5 100644 --- a/frontend/src/views/app-store/detail/index.vue +++ b/frontend/src/views/app-store/detail/index.vue @@ -28,7 +28,12 @@ :closable="false" /> - + {{ $t('app.install') }} @@ -92,9 +97,11 @@ const loadingApp = ref(false); const installRef = ref(); const open = ref(false); const appKey = ref(); +const operate = ref(); -const acceptParams = async (key: string) => { +const acceptParams = async (key: string, op: string) => { appKey.value = key; + operate.value = op; open.value = true; getApp(); }; diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 1f8cf6732..ad525d0e7 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -108,7 +108,7 @@ -
+
+