PyWebIO icon indicating copy to clipboard operation
PyWebIO copied to clipboard

静态资源托管不是所有资源都生效

Open xiaohuanshu opened this issue 1 year ago • 5 comments
trafficstars

BUG描述 根据https://pywebio.readthedocs.io/zh-cn/latest/advanced.html#notes 的描述进行自托管静态文件后,plotly和ag-grid依然使用cdn文件。看了下代码是因为使用了requireJs,这几个库没有放入仓库中有什么license上的原因吗?

xiaohuanshu avatar Dec 25 '23 02:12 xiaohuanshu

你可以通过 pywebio.session.run_js() 来手动设置这两个库的请求地址,设置的语法参见

https://github.com/pywebio/PyWebIO/blob/f534f4bee085d7aa1e9dedd1cb210498723cb7d0/pywebio/platform/tpl/index.html#L79-L85

wang0618 avatar Dec 27 '23 13:12 wang0618

多谢,我已经手动指定了,不过不知道为啥不能放到仓库里呢?

xiaohuanshu avatar Dec 28 '23 06:12 xiaohuanshu

多谢,我已经手动指定了,不过不知道为啥不能放到仓库里呢?

请问如何指定的,我能看看你怎么写的吗?

demaxiya avatar Jan 17 '24 08:01 demaxiya

多谢,我已经手动指定了,不过不知道为啥不能放到仓库里呢?

请问如何指定的,我能看看你怎么写的吗?

放到config.js_code里

require.config({
            paths: {
                "ag-grid": "/static/own/ag-grid-community.min",
                "ag-grid-enterprise": "/static/own/ag-grid-enterprise.min",
            },
       });

xiaohuanshu avatar Jan 17 '24 08:01 xiaohuanshu

多谢,我已经手动指定了,不过不知道为啥不能放到仓库里呢?

请问如何指定的,我能看看你怎么写的吗?

放到config.js_code里

require.config({
            paths: {
                "ag-grid": "/static/own/ag-grid-community.min",
                "ag-grid-enterprise": "/static/own/ag-grid-enterprise.min",
            },
       });

谢谢

demaxiya avatar Jan 17 '24 08:01 demaxiya