Skip to content

Commit c36e6a9

Browse files
committed
[#87242] frontend: components: devices: Device: Added showing download button only when user has permissions
Signed-off-by: Grzegorz Latosinski <glatosinski@antmicro.com>
1 parent f45da05 commit c36e6a9

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

frontend/src/components/devices/Device.vue

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,25 +130,29 @@ Component wraps functionality for displaying and working with a single rdfm devi
130130
</BlurPanel>
131131
</Transition>
132132

133-
<div class="download-container">
134-
<div class="drdn-wrapper">
135-
<button id="main-button" class="action-button gray">
136-
Download file
137-
<span class="caret-down"> <CaretDown /> </span>
138-
<span class="caret-up"> <CaretUp /> </span>
139-
</button>
140-
<div class="drdn">
141-
<div class="entry">
142-
<p>Path to file on device</p>
143-
<input type="text" ref="fileToDownload" />
144-
<div v-if="emptyPathError" class="errors">
145-
<p>Please enter file path</p>
133+
<template v-if="device?.capabilities.filesystem && allowedTo('read', 'device', device?.id)">
134+
<div class="download-container">
135+
<div class="drdn-wrapper">
136+
<button id="main-button" class="action-button gray">
137+
Download file
138+
<span class="caret-down"> <CaretDown /> </span>
139+
<span class="caret-up"> <CaretUp /> </span>
140+
</button>
141+
<div class="drdn">
142+
<div class="entry">
143+
<p>Path to file on device</p>
144+
<input type="text" ref="fileToDownload" />
145+
<div v-if="emptyPathError" class="errors">
146+
<p>Please enter file path</p>
147+
</div>
146148
</div>
149+
<button class="action-button blue white" @click="downloadFile">
150+
Download
151+
</button>
147152
</div>
148-
<button class="action-button blue white" @click="downloadFile">Download</button>
149153
</div>
150154
</div>
151-
</div>
155+
</template>
152156

153157
<template v-if="device?.capabilities.shell && allowedTo('shell', 'device', device?.id)">
154158
<div :class="['terminal-container', { fullscreen: isFullscreen }]">

0 commit comments

Comments
 (0)