UNPKG

4.35 kBPlain TextView Raw
1<!--The fly in options drawer for a guacamole connection-->
2<!--Enables the end user to adjust scaling and to inject content on the remote clipboard-->
3
4<template>
5 <div id="options-drawer-wrapper">
6 <div class="btn btn-xs btn-default" id='toggle-options-drawer' @click="toggleOptionsDrawer"> Options</div>
7
8 <div class="options-drawer" :class="{open: showNav, closed: !showNav}">
9
10 <div class="content">
11
12 <div v-if="viewState=='fullscreen'" >
13 <br>
14 <div>
15 <div class="btn btn-sm btn-default exit-fullscreen pull-right" @click="$emit('exitFullscreen')"><span class="glyphicon glyphicon-resize-small"/></div>
16
17 <h5 style="display:inline"> Exit Fullscreen </h5>
18 </div>
19
20 <hr>
21
22 </div>
23
24 <h4> Connection Status</h4>
25 <div>Tunnel State: {{ options.tunnelState }}</div>
26 <div>Client State: {{ options.clientState }}</div>
27
28 <hr>
29
30 <div class="form-group">
31 <label> Clipboard</label>
32 <textarea id='clipboard-area' class="form-control" rows="5" v-model="options.clipboard" />
33 <div class="btn btn-default" @click="$emit('setClipboard')">Set Clipboard</div>
34 </div>
35
36 <hr>
37
38 <div v-if='control' class="form-group">
39 <label> Display Resolution</label>
40 <select @change='resolutionChange' class='form-control' v-model="displayResolution">
41 <option v-for="resolution in resolutions" v-bind:value="resolution">
42 {{ resolution}}
43 </option>
44 </select>
45
46 <br>
47 <label v-if="!options.autoScale">
48 Scale
49 <input type="range" min="0.01" max="3" step='0.01' value="1" class="slider" v-model="options.scale">
50 </label>
51
52 </div>
53
54 <!--<hr>-->
55 <!--<div class="form-group">-->
56 <!--<label> Disconnect </label>-->
57 <!--<div class="btn btn-default" @click="$emit('disconnect')">Disconnect</div>-->
58 <!--</div>-->
59
60 </div>
61 </div>
62 </div>
63</template>
64
65<script>
66 import Vue from 'vue'
67 import Dragged from 'v-dragged'
68
69 Vue.use(Dragged)
70
71 export default {
72 name: 'OptionsDrawer',
73 props: ['options', 'viewState', 'client', 'resolution', 'control'],
74 data(){
75 return{
76 uploadedFiles: [],
77 displayResolution: this.resolution || '1920x1080',
78 resolutions: ['1920x1080', '1600x900', '1440x900', '1366x768', '1280x800', '1024x768']
79 }
80 },
81 methods: {
82
83 resolutionChange (data) {
84 this.$emit('resolutionChange', this.displayResolution)
85 },
86
87 onDragged (event) {
88 // Don't drag move element on mousedown and mouseup
89 if (event.first || event.last) return false
90 event.el.style.top = Math.max(event.clientY, 30) + 'px'
91 },
92
93 toggleOptionsDrawer () {
94 Vue.set(this.options, 'showOptionsDrawer', !this.options.showOptionsDrawer)
95 }
96 },
97 computed: {
98
99 showNav () {
100 return this.options.showOptionsDrawer
101 }
102 }
103 }
104</script>
105
106<style scoped>
107
108 #clipboard-area{
109 width: 100%;
110 rows: 5;
111 wrap: soft;
112 }
113
114 #options-drawer-wrapper{
115 position: absolute;
116 height: 100%;
117 top: 0;
118 right: 0;
119 z-index: 9;
120 }
121
122 .guacamoleClient.thumbnail #options-drawer-wrapper{
123 display: none;
124 }
125
126 hr{
127 border-color: grey;
128 }
129
130 .options-drawer .content{
131 margin-left: 20px;
132 margin-right: 20px;
133 }
134
135 .options-drawer.closed .content{
136 opacity: 0;
137 transition: opacity 0.25s linear ;
138
139 }
140
141 .options-drawer.open .content{
142 opacity: 1;
143 transition: opacity 0.25s linear 0.25s;
144 }
145
146 .options-drawer{
147 text-align: left;
148 height: 100%;
149 background-color: #e8e8e8;
150 overflow-x: hidden;
151 }
152
153 .options-drawer.open {
154 width: 250px;
155 transition: width 0.25s linear;
156 }
157
158 .options-drawer.closed {
159 width: 0px;
160 transition: opacity 0.25s linear;
161 transition: width 0.25s linear 0.25s;
162 }
163
164 .exit-fullscreen{
165 padding: 1px 5px;
166 font-size: 12px;
167 }
168
169 #toggle-options-drawer{
170 height: 20px;
171 border-radius: 3px;
172 position: absolute;
173 left: 0px;
174 top: 400px;
175 padding: 1px 5px;
176 font-size: 12px;
177
178 /* Safari */
179 -webkit-transform: rotate(-90deg);
180 transform: rotate(-90deg);
181 transform-origin: 0% 100%;
182 }
183</style>