Git Product home page Git Product logo

Comments (2)

pdxadp avatar pdxadp commented on July 25, 2024

参考宝塔官方的解决方法:

Linux安装包文件:panel\class\panelPlugin.py

2459行

  #获取配置模板
    def getConfigHtml(self,get):
        filename = self.__install_path + '/' + get.name + '/index.html'
        if not os.path.exists(filename): return public.returnMsg(False,'PLUGIN_GET_HTML')
        mimetype = 'text/html'
        cache_time = 0 if public.is_debug() else 86400
        self.plugin_open_total(get.name)
        return send_file(filename,
                    mimetype = mimetype,
                    as_attachment = True,
                    add_etags = True,
                    conditional = True,
                    cache_timeout = cache_time)

加个版本判断:

#获取配置模板
    def getConfigHtml(self,get):
        filename = self.__install_path + '/' + get.name + '/index.html'
        if not os.path.exists(filename): return public.returnMsg(False,'PLUGIN_GET_HTML')
        mimetype = 'text/html'
        cache_time = 0 if public.is_debug() else 86400
        self.plugin_open_total(get.name)
        import flask
        if flask.__version__ < "2.1.0":
            return send_file(filename,
                        mimetype = mimetype,
                        as_attachment = True,
                        add_etags = True,
                        conditional = True,
                        cache_timeout = cache_time)
        else:
            return send_file(filename,
                        mimetype = mimetype,
                        as_attachment = True,
                        etag = True,
                        conditional = True,
                        max_age = cache_time)

from btcloud.

duiaic avatar duiaic commented on July 25, 2024

我用了你的1.1.4版本。也修改了这个报错源码,在下载文件的时候无法下载还是报错TypeError: send_file() got an unexpected keyword argument 'add_etags'

from btcloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.