@eclipse-docks/core 0.7.137 → 0.7.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +3 -3
- package/dist/{api-3h__hDci.js → api-BZXW896G.js} +122 -49
- package/dist/api-BZXW896G.js.map +1 -0
- package/dist/components/filebrowser.d.ts +12 -1
- package/dist/components/filebrowser.d.ts.map +1 -1
- package/dist/components/tasks.d.ts.map +1 -1
- package/dist/core/filesys/common.d.ts +1 -0
- package/dist/core/filesys/common.d.ts.map +1 -1
- package/dist/{filebrowser.de-LWsrI9xj.js → filebrowser.de-BfFcNr19.js} +13 -3
- package/dist/{filebrowser.de-LWsrI9xj.js.map → filebrowser.de-BfFcNr19.js.map} +1 -1
- package/dist/{filebrowser.en-C02vpzAs.js → filebrowser.en-CLd5Mccb.js} +13 -3
- package/dist/{filebrowser.en-C02vpzAs.js.map → filebrowser.en-CLd5Mccb.js.map} +1 -1
- package/dist/fs-access-B1bmJ5U0.js +2 -0
- package/dist/{fs-access-Cjcg0_Me.js → fs-access-CrktZo-_.js} +2 -1
- package/dist/fs-access-CrktZo-_.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/parts/index.js +1 -1
- package/dist/{parts-DMjNqL4o.js → parts-KvjEFJ7v.js} +4 -4
- package/dist/parts-KvjEFJ7v.js.map +1 -0
- package/dist/webawesome-C0Da7hPu.js.map +1 -1
- package/dist/widget-DUR6wxME.js.map +1 -1
- package/package.json +2 -2
- package/src/components/filebrowser.de.json +6 -1
- package/src/components/filebrowser.en.json +6 -1
- package/src/components/filebrowser.ts +120 -28
- package/src/components/tasks.ts +16 -15
- package/src/core/filesys/common.ts +2 -1
- package/dist/api-3h__hDci.js.map +0 -1
- package/dist/fs-access-Cjcg0_Me.js.map +0 -1
- package/dist/fs-access-Dp9Fwsxk.js +0 -2
- package/dist/parts-DMjNqL4o.js.map +0 -1
package/src/components/tasks.ts
CHANGED
|
@@ -19,6 +19,19 @@ contributionRegistry.registerContribution(TOOLBAR_BOTTOM_CENTER, {
|
|
|
19
19
|
// Singleton dialog container for progress dialog
|
|
20
20
|
let progressDialogContainer: HTMLElement | null = null;
|
|
21
21
|
|
|
22
|
+
/** Percentage (0-100) of a task, or `undefined` when its progress is indefinite. */
|
|
23
|
+
function taskPercent(task: ProgressMonitor): number | undefined {
|
|
24
|
+
if (task.progress >= 0) return task.progress;
|
|
25
|
+
if (task.totalSteps > 0) return Math.round((task.currentStep / task.totalSteps) * 100);
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function renderProgressBar(task: ProgressMonitor | undefined, label = '') {
|
|
30
|
+
const percent = task && taskPercent(task);
|
|
31
|
+
if (percent === undefined) return html`<wa-progress-bar indeterminate></wa-progress-bar>`;
|
|
32
|
+
return html`<wa-progress-bar value="${percent}">${label}</wa-progress-bar>`;
|
|
33
|
+
}
|
|
34
|
+
|
|
22
35
|
function getProgressDialogContainer(): HTMLElement {
|
|
23
36
|
if (!progressDialogContainer) {
|
|
24
37
|
progressDialogContainer = document.createElement('div');
|
|
@@ -153,14 +166,8 @@ function updateProgressDialog(forceOpen = false) {
|
|
|
153
166
|
|
|
154
167
|
<div class="progress-dialog-content">
|
|
155
168
|
${tasks.map((taskProgress: ProgressMonitor) => {
|
|
156
|
-
const hasProgress = taskProgress.progress >= 0 || taskProgress.totalSteps > 0
|
|
157
|
-
const progress = taskProgress.progress >= 0
|
|
158
|
-
? taskProgress.progress
|
|
159
|
-
: (taskProgress.totalSteps > 0
|
|
160
|
-
? Math.round((taskProgress.currentStep / taskProgress.totalSteps) * 100)
|
|
161
|
-
: 0)
|
|
162
|
-
|
|
163
169
|
const showSteps = taskProgress.progress < 0 && taskProgress.totalSteps > 0
|
|
170
|
+
const steps = showSteps ? `${taskProgress.currentStep}/${taskProgress.totalSteps} - ` : ''
|
|
164
171
|
|
|
165
172
|
return html`
|
|
166
173
|
<div class="tasitem">
|
|
@@ -174,13 +181,7 @@ function updateProgressDialog(forceOpen = false) {
|
|
|
174
181
|
</div>
|
|
175
182
|
</div>
|
|
176
183
|
<div class="tasprogress">
|
|
177
|
-
${
|
|
178
|
-
<wa-progress-bar value="${progress}">
|
|
179
|
-
${showSteps ? `${taskProgress.currentStep}/${taskProgress.totalSteps} - ` : ''}${progress}%
|
|
180
|
-
</wa-progress-bar>
|
|
181
|
-
` : html`
|
|
182
|
-
<wa-progress-bar indeterminate></wa-progress-bar>
|
|
183
|
-
`}
|
|
184
|
+
${renderProgressBar(taskProgress, `${steps}${taskPercent(taskProgress)}%`)}
|
|
184
185
|
</div>
|
|
185
186
|
</div>
|
|
186
187
|
`
|
|
@@ -264,7 +265,7 @@ export class DocksTasks extends DocksElement {
|
|
|
264
265
|
label="${t.ACTIVE_TASKS}"
|
|
265
266
|
></wa-spinner>
|
|
266
267
|
<wa-badge appearance="outlined" variant="neutral" pill>${taskCount}</wa-badge>
|
|
267
|
-
<div class="tasbar-wrap"
|
|
268
|
+
<div class="tasbar-wrap">${renderProgressBar(taskCount === 1 ? tasks[0] : undefined)}</div>
|
|
268
269
|
</div>
|
|
269
270
|
`;
|
|
270
271
|
}
|
|
@@ -784,7 +784,7 @@ export class WorkspaceService {
|
|
|
784
784
|
public async copyResource(
|
|
785
785
|
src: Resource,
|
|
786
786
|
destDir: Directory,
|
|
787
|
-
options?: { move?: boolean; newName?: string }
|
|
787
|
+
options?: { move?: boolean; newName?: string; onFile?: (targetPath: string) => void }
|
|
788
788
|
): Promise<void> {
|
|
789
789
|
await this.initPromise;
|
|
790
790
|
const workspace = this._currentWorkspace;
|
|
@@ -797,6 +797,7 @@ export class WorkspaceService {
|
|
|
797
797
|
const targetBasePath = destDirPath ? `${destDirPath}/${targetName}` : targetName;
|
|
798
798
|
|
|
799
799
|
const copyFileToPath = async (file: File, targetPath: string): Promise<void> => {
|
|
800
|
+
options?.onFile?.(targetPath);
|
|
800
801
|
const contents = await file.getContents({ blob: true });
|
|
801
802
|
const targetFile = await workspace.getResource(targetPath, { create: true }) as File | null;
|
|
802
803
|
if (!targetFile) {
|