star-whale / starwhale

an MLOps/LLMOps platform
https://starwhale.ai
Apache License 2.0
208 stars 35 forks source link

fix(client): the online evaluation is accessible behind the proxy sub-path #3083

Closed jialeicui closed 10 months ago

jialeicui commented 10 months ago

Description

demo: http://jialei.pre.intra.starwhale.ai/projects/1/jobs/8/servings

Bug reason: the front end can not access the assets and the APIs if the server is behind the proxy sub-path

I have implemented a simple string replacement on the client side to achieve the effects of injecting global variables and modifying asset paths. I did not use templates like Jinja2 because once templates are used, the client/index.html file can no longer be used for debugging and packaging with Vite.

Modules

Checklist

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (0273514) 82.69% compared to head (4bc12eb) 91.58%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3083 +/- ## ============================================ + Coverage 82.69% 91.58% +8.88% ============================================ Files 571 138 -433 Lines 31789 16141 -15648 Branches 1873 61 -1812 ============================================ - Hits 26287 14782 -11505 + Misses 4681 1357 -3324 + Partials 821 2 -819 ``` | [Flag](https://app.codecov.io/gh/star-whale/starwhale/pull/3083/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=star-whale) | Coverage Δ | | |---|---|---| | [console](https://app.codecov.io/gh/star-whale/starwhale/pull/3083/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=star-whale) | `72.09% <ø> (ø)` | | | [controller](https://app.codecov.io/gh/star-whale/starwhale/pull/3083/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=star-whale) | `?` | | | [standalone](https://app.codecov.io/gh/star-whale/starwhale/pull/3083/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=star-whale) | `91.84% <100.00%> (+0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/star-whale/starwhale/pull/3083/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=star-whale) | `91.58% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=star-whale#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.