Stick to one window
This commit is contained in:
parent
7a2122089e
commit
974096bc56
|
@ -59,6 +59,19 @@ export default function ScreenshotGenerator({
|
||||||
return response as screenshotTask;
|
return response as screenshotTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function downloadFiles() {
|
||||||
|
const urls = images.map((el) => `http://65.108.60.135:3000/static/${taskId}/${el}`);
|
||||||
|
|
||||||
|
for (const url of urls) {
|
||||||
|
let a = document.createElement('a');
|
||||||
|
a.setAttribute('href', url);
|
||||||
|
a.setAttribute('download', '');
|
||||||
|
a.setAttribute('target', '_blank');
|
||||||
|
a.click();
|
||||||
|
}
|
||||||
|
setReportWindowMode('preview');
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="generator-container">
|
<div className="generator-container">
|
||||||
{mode === 'idle' ? (
|
{mode === 'idle' ? (
|
||||||
|
@ -103,11 +116,18 @@ export default function ScreenshotGenerator({
|
||||||
{mode === 'in_progress' || mode === 'finished' ? (
|
{mode === 'in_progress' || mode === 'finished' ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<h1>Przygotowujemy zrzuty ekranów</h1>
|
<h1>Przygotowujemy zrzuty ekranów</h1>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore sint
|
||||||
|
laudantium blanditiis aperiam quos expedita voluptatem iure, nam aliquam vel
|
||||||
|
minus aliquid incidunt consequatur illo velit dolorem error exercitationem
|
||||||
|
tempora?
|
||||||
|
</p>
|
||||||
|
|
||||||
<div className="images">
|
<div className="images">
|
||||||
{images.map((filename: string) => {
|
{images.map((filename: string) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
key={`${taskId}_${filename}`}
|
||||||
className="browser browser--filled"
|
className="browser browser--filled"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(http://65.108.60.135:3000/static/${taskId}/${filename})`,
|
backgroundImage: `url(http://65.108.60.135:3000/static/${taskId}/${filename})`,
|
||||||
|
@ -135,7 +155,9 @@ export default function ScreenshotGenerator({
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{mode === 'finished' ? (
|
{mode === 'finished' ? (
|
||||||
<button className="sv_next_btn">Pobierz zrzuty ekranów</button>
|
<button className="sv_next_btn" onClick={() => downloadFiles()}>
|
||||||
|
Pobierz zrzuty ekranów
|
||||||
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
|
@ -79,15 +79,9 @@ const Sidebar = () => {
|
||||||
<button
|
<button
|
||||||
className="button button--report"
|
className="button button--report"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const params = [
|
|
||||||
'height=' + screen.height,
|
|
||||||
'width=' + screen.width,
|
|
||||||
'fullscreen=yes',
|
|
||||||
].join(',');
|
|
||||||
window.open(
|
window.open(
|
||||||
`/components/report-window/report-window.html?origin=${origin}`,
|
`/components/report-window/report-window.html?origin=${origin}`,
|
||||||
'new_window',
|
'new_tab'
|
||||||
params
|
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -217,17 +217,12 @@ const Toolbar = () => {
|
||||||
<button
|
<button
|
||||||
className="button button--report"
|
className="button button--report"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const params = [
|
|
||||||
'height=' + screen.height,
|
|
||||||
'width=' + screen.width,
|
|
||||||
'fullscreen=yes',
|
|
||||||
].join(',');
|
|
||||||
autoMark();
|
autoMark();
|
||||||
window.open(
|
window.open(
|
||||||
`/components/sidebar/sidebar.html?origin=${origin}`,
|
`/components/sidebar/sidebar.html?origin=${origin}`,
|
||||||
'new_window',
|
'new_tab'
|
||||||
params
|
|
||||||
);
|
);
|
||||||
|
window.close(); // close toolbar popup
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Generuj raport
|
Generuj raport
|
||||||
|
|
Loading…
Reference in New Issue
Block a user