diff --git a/pilot/openapi/api_v1/api_v1.py b/pilot/openapi/api_v1/api_v1.py index c6bd08ad0..2f1641619 100644 --- a/pilot/openapi/api_v1/api_v1.py +++ b/pilot/openapi/api_v1/api_v1.py @@ -97,9 +97,9 @@ def knowledge_list(): return params -@router.get("/") -async def read_main(): - return FileResponse(f"{static_file_path}/index.html") +# @router.get("/") +# async def read_main(): +# return FileResponse(f"{static_file_path}/index.html") @router.get("/v1/chat/dialogue/list", response_model=Result[ConversationVo]) diff --git a/pilot/server/dbgpt_server.py b/pilot/server/dbgpt_server.py index 9f2c0d5da..b6e4f443d 100644 --- a/pilot/server/dbgpt_server.py +++ b/pilot/server/dbgpt_server.py @@ -65,11 +65,19 @@ app.add_middleware( allow_headers=["*"], ) -app.mount("/_next/static", StaticFiles(directory=static_file_path + "/_next/static", html=True)) -app.mount("/static", StaticFiles(directory=static_file_path), name="static2") -app.include_router(knowledge_router) +# app.include_router(api_v1, prefix="/api") +# app.include_router(knowledge_router, prefix="/api") + app.include_router(api_v1) +app.include_router(knowledge_router) + +app.mount("/static", StaticFiles(directory=static_file_path), name="static") +# app.mount("/_next/static", StaticFiles(directory=static_file_path + "/_next/static")) +# app.mount("/", StaticFiles(directory=static_file_path, html=True), name="static") + + + app.add_exception_handler(RequestValidationError, validation_exception_handler) if __name__ == "__main__": diff --git a/pilot/server/static/404.html b/pilot/server/static/404.html deleted file mode 100644 index b099846b9..000000000 --- a/pilot/server/static/404.html +++ /dev/null @@ -1 +0,0 @@ -
1){for(var f=n.addGroup(),d=0;d h&&(h=u),(g=Math.max(h/(m=d*d*y),m/p))>v){d-=u;break}v=g}b.push(l={value:d,dice:c h&&(h=e))});var g=e(s(u,c,f,d),2),v=g[0],y=g[1],m=function(t){return y*t+v},b=[[p,m(p)],[h,m(h)]];return b.a=y,b.b=v,b.predict=m,b.rSquared=i(o,n,a,c,m),b}return o.domain=function(e){return arguments.length?(t=e,o):t},o.x=function(t){return arguments.length?(n=t,o):n},o.y=function(t){return arguments.length?(a=t,o):a},o}function u(){var t,a=function(t){return t[0]},s=function(t){return t[1]};function l(l){var u,c,f,d,p=e(n(l,a,s),4),h=p[0],g=p[1],v=p[2],y=p[3],m=h.length,b=0,x=0,_=0,O=0,P=0;for(u=0;ul&&(a=l),i===l&&a===l)return null;var u=t.invert(i),c=t.invert(a);if(!t.isCategory)return function(t){return t>=u&&t<=c};var f=t.values.indexOf(u),d=t.values.indexOf(c),p=t.values.slice(f,d+1);return function(t){return p.includes(t)}}(r=i||(i={})).FILTER="brush-filter-processing",r.RESET="brush-filter-reset",r.BEFORE_FILTER="brush-filter:beforefilter",r.AFTER_FILTER="brush-filter:afterfilter",r.BEFORE_RESET="brush-filter:beforereset",r.AFTER_RESET="brush-filter:afterreset",e.BRUSH_FILTER_EVENTS=i;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.startPoint=null,e.isStarted=!1,e}return(0,a.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){if((0,l.isMask)(this.context)){var t,e,n=this.context.event.target.getCanvasBBox();t={x:n.x,y:n.y},e={x:n.maxX,y:n.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(5>Math.abs(t.x-e.x)||5>Math.abs(t.x-e.y))){var r=this.context,a=r.view,s={view:a,event:r.event,dims:this.dims};a.emit(i.BEFORE_FILTER,o.Event.fromData(a,i.BEFORE_FILTER,s));var c=a.getCoordinate(),f=c.invert(e),d=c.invert(t);if(this.hasDim("x")){var p=a.getXScale(),h=u(p,"x",f,d);this.filterView(a,p.field,h)}if(this.hasDim("y")){var g=a.getYScales()[0],h=u(g,"y",f,d);this.filterView(a,g.field,h)}this.reRender(a,{source:i.FILTER}),a.emit(i.AFTER_FILTER,o.Event.fromData(a,i.AFTER_FILTER,s))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(i.BEFORE_RESET,o.Event.fromData(t,i.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var n=t.getYScales()[0];this.filterView(t,n.field,null)}this.reRender(t,{source:i.RESET}),t.emit(i.AFTER_RESET,o.Event.fromData(t,i.AFTER_RESET,{}))},e.prototype.filterView=function(t,e,n){t.filter(e,n)},e.prototype.reRender=function(t,e){t.render(!0,e)},e}(s.default);e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.cfgFields=["dims"],e.cacheScaleDefs={},e}return(0,r.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var e=this.context.view;return"x"===t?e.getXScale():e.getYScales()[0]},e.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var n=this.getScale(t);e.scale(n.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim("x"),this.resetDim("y"),this.context.view.render(!0)},e}(n(185).Action);e.default=i},function(t,e,n){"use strict";var r=n(482);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nr&&(t.splice(s+1,0,d),i=!0)}return i}(i)&&o<1e4;);return i}function s(t,e,n,r){var i=r-t*t,a=1e-24>Math.abs(i)?0:(n-t*e)/i;return[e-a*t,a]}function l(){var t,n=function(t){return t[0]},a=function(t){return t[1]};function o(o){var l=0,u=0,c=0,f=0,d=0,p=t?+t[0]:1/0,h=t?+t[1]:-1/0;r(o,n,a,function(e,n){++l,u+=(e-u)/l,c+=(n-c)/l,f+=(e*n-f)/l,d+=(e*e-d)/l,!t&&(e