Skip to content

Commit

Permalink
Merge pull request #2615 from skyanth/bugfix/2614-relative-assets-and…
Browse files Browse the repository at this point in the history
…-stats-links

Bugfix/2614 relative assets and stats links
  • Loading branch information
cyberw committed Feb 29, 2024
2 parents baf007f + b11bffb commit 8d639d9
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ __pycache__
yarn-error.log
.venv
.DS_Store
.python-version
2 changes: 1 addition & 1 deletion locust/webui/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

Expand Down
2 changes: 1 addition & 1 deletion locust/webui/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions locust/webui/dist/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="/assets/index-207c29ed.js"></script>
<script type="module" crossorigin src="./assets/index-0d6d578a.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
6 changes: 3 additions & 3 deletions locust/webui/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="/assets/index-207c29ed.js"></script>
<script type="module" crossorigin src="./assets/index-0d6d578a.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/dist/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

Expand Down
4 changes: 2 additions & 2 deletions locust/webui/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

Expand Down
2 changes: 1 addition & 1 deletion locust/webui/public/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/favicon.ico" />
<link rel="icon" href="./assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

Expand Down
17 changes: 12 additions & 5 deletions locust/webui/src/components/Layout/Footer/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Box, Button, Link, Typography } from '@mui/material';
import Modal from 'components/Modal/Modal';
import { useSelector } from 'redux/hooks';


export default function About() {
const [open, setOpen] = useState(false);
const version = useSelector(({ swarm }) => swarm.version);
Expand All @@ -22,13 +21,21 @@ export default function About() {
About
</Typography>
<Typography component='p' variant='subtitle1'>
Locust is free and open source software released under the <Link href={`https://github.com/locustio/locust/blob/master/LICENSE`}>MIT License</Link>
Locust is free and open source software released under the{' '}
<Link href={`https://github.com/locustio/locust/blob/master/LICENSE`}>MIT License</Link>
</Typography>
<Typography component='p' sx={{ mt: 2 }} variant='subtitle1'>
It was originally developed by Carl Byström and <Link href={`https://twitter.com/jonatanheyman/`}>Jonatan Heyman</Link>. Since 2019, it is primarily maintained by <Link href={`https://github.com/cyberw`}>Lars Holmberg</Link>.
It was originally developed by Carl Byström and{' '}
<Link href={`https://twitter.com/jonatanheyman/`}>Jonatan Heyman</Link>. Since 2019, it
is primarily maintained by <Link href={`https://github.com/cyberw`}>Lars Holmberg</Link>
.
</Typography>
<Typography component='p' sx={{ mt: 2 }} variant='subtitle1'>
Many thanks to all our wonderful <Link href={`https://github.com/locustio/locust/graphs/contributors`}>contributors</Link>!
Many thanks to all our wonderful{' '}
<Link href={`https://github.com/locustio/locust/graphs/contributors`}>
contributors
</Link>
!
</Typography>
</div>

Expand All @@ -46,7 +53,7 @@ export default function About() {
<Typography component='p' variant='subtitle1'>
<Link href='https://github.com/locustio/locust'>GitHub</Link>
</Typography>
<Typography component='p' variant='subtitle1'>
<Typography component='p' variant='subtitle1'>
<Link href='https://docs.locust.io/en/stable/'>Documentation</Link>
</Typography>
</div>
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/src/components/Layout/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Navbar() {
sx={{ display: 'flex', alignItems: 'center', columnGap: 2 }}
underline='none'
>
<img height='52' src='/assets/logo.png' width='52' />
<img height='52' src='./assets/logo.png' width='52' />
<Typography
component='h1'
noWrap
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/src/pages/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function Auth({ authProviders, error, usernamePasswordCallback }:
}}
>
<Box sx={{ display: 'flex', justifyContent: 'center', columnGap: 2 }}>
<img height='52' src='/assets/logo.png' width='52' />
<img height='52' src='./assets/logo.png' width='52' />
<Typography
component='h1'
noWrap
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/src/pages/tests/Dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Dashboard', () => {
expect(heading).toBeTruthy();
expect(heading.getAttribute('href')).toEqual('/');
expect(logo).toBeTruthy();
expect(logo.getAttribute('src')).toEqual('/assets/logo.png');
expect(logo.getAttribute('src')).toEqual('./assets/logo.png');
});

test('renders the swarm form by default', () => {
Expand Down
16 changes: 8 additions & 8 deletions locust/webui/src/test/mocks/statsRequest.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const statsResponseMock = {
method: 'GET',
min_response_time: 0.0,
name: '/',
"response_time_percentile_0.9": 0,
"response_time_percentile_0.99": 1,
'response_time_percentile_0.9': 0,
'response_time_percentile_0.99': 1,
num_failures: 12652,
num_requests: 12652,
safe_name: '/',
Expand All @@ -40,8 +40,8 @@ export const statsResponseMock = {
method: '',
min_response_time: 0.0,
name: 'Aggregated',
"response_time_percentile_0.9": 0,
"response_time_percentile_0.99": 1,
'response_time_percentile_0.9': 0,
'response_time_percentile_0.99': 1,
num_failures: 12652,
num_requests: 12652,
safe_name: 'Aggregated',
Expand Down Expand Up @@ -113,8 +113,8 @@ export const statsResponseTransformed = {
method: 'GET',
minResponseTime: 0,
name: '/',
"responseTimePercentile0.9": 0,
"responseTimePercentile0.99": 1,
'responseTimePercentile0.9': 0,
'responseTimePercentile0.99': 1,
numFailures: 12652,
numRequests: 12652,
safeName: '/',
Expand All @@ -129,8 +129,8 @@ export const statsResponseTransformed = {
method: '',
minResponseTime: 0,
name: 'Aggregated',
"responseTimePercentile0.9": 0,
"responseTimePercentile0.99": 1,
'responseTimePercentile0.9': 0,
'responseTimePercentile0.99': 1,
numFailures: 12652,
numRequests: 12652,
safeName: 'Aggregated',
Expand Down
1 change: 1 addition & 0 deletions locust/webui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default defineConfig((config: UserConfig) => ({
},
}),
],
base: './',
build: {
chunkSizeWarningLimit: 2000,
rollupOptions: {
Expand Down

0 comments on commit 8d639d9

Please sign in to comment.