Skip to content

Commit

Permalink
use dedicated path label names for different location types
Browse files Browse the repository at this point in the history
  • Loading branch information
emuell committed Dec 30, 2024
1 parent b22edb4 commit 242b357
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/components/location-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,33 @@ export class ResticBrowserLocationProperties extends MobxLitElement {
></vaadin-select>`
;

let pathLabel;
switch (this._location.prefix) {
default:
case "local":
pathLabel = "Path";
break;
case "rclone":
pathLabel = "Remote";
break;
case "sftp":
case "rest":
pathLabel = "URL";
break;
case "s3":
case "b2":
case "azure":
pathLabel = "Bucket";
break;
case "gs":
pathLabel = "Container";
break;
}

const locationPath = html`
<vaadin-horizontal-layout style="width: 24rem">
<vaadin-text-field style="width: 100%; margin-right: 4px;"
label=${this._location.type === "local" ? "Path"
: (["sftp", "rest"].includes(this._location.type)) ? "URL" : "Bucket"}
label=${pathLabel}
required
.disabled=${! this.allowEditing}
value=${this._location.path}
Expand Down

0 comments on commit 242b357

Please sign in to comment.