mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
feat: refine GUI setup progress
This commit is contained in:
6 files changed
+31
-30
No files matched your search
@@ -64,12 +64,9 @@ function DownloadIndicator({ progress }: { progress: number | null }) {
|
||||
return (
|
||||
<div className="update-status" data-tauri-drag-region>
|
||||
<h1 className="update-title" data-tauri-drag-region>
|
||||
Downloading GPGUI
|
||||
Getting GP Connect ready
|
||||
</h1>
|
||||
<p className="update-description" data-tauri-drag-region>
|
||||
This may take a moment.
|
||||
</p>
|
||||
<ProgressWithLabel value={progress} />
|
||||
<DownloadProgress value={progress} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -79,7 +76,7 @@ function DownloadFailed({ onRetry }: { onRetry: () => void }) {
|
||||
<div className="update-status error-status" data-tauri-drag-region>
|
||||
<div className="error-copy" role="alert" data-tauri-drag-region>
|
||||
<h1 className="update-title" data-tauri-drag-region>
|
||||
GPGUI update failed
|
||||
Couldn’t get GP Connect ready
|
||||
</h1>
|
||||
<p className="update-description" data-tauri-drag-region>
|
||||
Please try again.
|
||||
@@ -92,11 +89,19 @@ function DownloadFailed({ onRetry }: { onRetry: () => void }) {
|
||||
);
|
||||
}
|
||||
|
||||
function ProgressWithLabel({ value }: { value: number | null }) {
|
||||
function DownloadProgress({ value }: { value: number | null }) {
|
||||
const isDeterminate = value !== null;
|
||||
|
||||
return (
|
||||
<div className="progress-row">
|
||||
<>
|
||||
<div className="progress-summary" data-tauri-drag-region>
|
||||
<p className="update-description" data-tauri-drag-region>
|
||||
This should only take a moment.
|
||||
</p>
|
||||
<span className="progress-label" aria-hidden="true">
|
||||
{isDeterminate ? `${Math.round(value)}%` : "In progress"}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
className={`progress-bar${isDeterminate ? "" : " progress-bar-indeterminate"}`}
|
||||
role="progressbar"
|
||||
@@ -107,12 +112,6 @@ function ProgressWithLabel({ value }: { value: number | null }) {
|
||||
>
|
||||
<div className="progress-fill" style={isDeterminate ? { width: `${value}%` } : undefined} />
|
||||
</div>
|
||||
<span
|
||||
className={`progress-label${value === null ? " progress-label-hidden" : ""}`}
|
||||
aria-hidden={value === null}
|
||||
>
|
||||
{value === null ? "100%" : `${Math.round(value)}%`}
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -66,18 +66,23 @@ button {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.progress-row {
|
||||
.progress-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-top: 9px;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.progress-summary .update-description {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
margin-top: 9px;
|
||||
overflow: hidden;
|
||||
border-radius: 3px;
|
||||
background-color: #d5d3d1;
|
||||
@@ -117,16 +122,13 @@ button {
|
||||
}
|
||||
|
||||
.progress-label {
|
||||
min-width: 36px;
|
||||
flex: 0 0 auto;
|
||||
color: #3d3846;
|
||||
font-size: 12px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 500;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.progress-label-hidden {
|
||||
visibility: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.error-status {
|
||||
|
||||
Reference in new issue
Block a user