804bfe4205f63be27074c6296b07b38bf33ad1f3
[openocd.git] / src / server / httpd / guiupload.tcl
1 # converted to .tcl by html2tcl.tcl
2 set buffer ""
3 append buffer {
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 <html xmlns="http://www.w3.org/TR/REC-html40">
48 <head>
49 <title>OpenOCD debugger</title>
50 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>
51 <link type="text/css" rel="stylesheet" href="menuweb.css"/>
52 </head>
53 }
54
55 set console ""
56 set upload_filename /ram/upload
57
58 append buffer {
59 <body style="margin:0px;">
60 <div style="width:974px;height:85px;">
61 <div style="float:left;position:relative;left:32px;width:478px;">
62 <a href="/">
63 OpenOCD
64 </a>
65 </div>
66 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">
67 <div style="position:relative;left:15px;top:4px;" class="textlight">
68 }
69 append buffer [capture version]
70 append buffer {
71 </div>
72 </div>
73 </div>
74 <table style="padding:0px;border-collapse:collapse;">
75 <tr>
76 <td style="width:33px;">
77 <div style="width:20px;height:510px;">
78 &nbsp;
79 </div>
80 </td>
81 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">
82 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">
83 <tr style="height:59px;">
84 <td/>
85 </tr>
86 <tr>
87 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
88 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
89 <a href="openocd.tcl" style="">Run Command</a>
90 </div>
91 </td>
92 </tr>
93 <tr>
94 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;">
95 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
96 <a href="guiupload.tcl" style="font-weight: bold;">Upload File</a>
97 </div>
98 </td>
99 </tr>
100 <tr>
101 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>
102 </tr>
103 <tr>
104 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>
105 </tr>
106 <tr>
107 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>
108 </tr>
109 </table>
110 </td>
111 <td style="vertical-align:top;padding:0px;height:100%">
112 <table style="padding:0px;border-collapse:collapse;height:100%;">
113 <tr>
114 <td>
115 <table style="padding:0px;border-collapse:collapse;">
116 <tr>
117 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
118 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
119 <a href="index.tcl">Config Target</a>
120 </div>
121 </td>
122 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
123 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
124 <a href="flashinfo.tcl">Flash</a>
125 </div>
126 </td>
127 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
128 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
129 <a href="browsemem.tcl">Memory</a>
130 </div>
131 </td>
132 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">
133 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
134 <a href="openocd.tcl" style="font-weight: bold;">OpenOCD</a>
135 </div>
136 </td>
137 </tr>
138 </table>
139 </td>
140 </tr>
141 <tr>
142 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
143 <div style="width:500px;background-color:#ffffff;height:100%;">
144 &nbsp;
145 </div>
146 </td>
147 </tr>
148 <tr>
149 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">
150 <H1>Upload File</H1>
151 </td>
152 </tr>
153 <tr style="height:100%;">
154 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">
155
156 }
157
158 set form_filename [formfetch form_filename];
159 set form_action [formfetch form_action];
160 #set form_filecontent [formfetch form_filecontent];
161
162 append buffer {<form enctype="multipart/form-data" action="guiupload.tcl" method="post">}
163 append buffer <br>
164 if {[string compare $form_action "Upload"]==0} {
165 if {[catch {writeform form_filecontent $form_filename} result]==0} {
166 append buffer [encode $result]
167 } else {
168 append buffer Wrote $form_filename
169 }
170 }
171
172 append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on OpenOCD machine</td><td><input type="text" name="form_filename"></td></tr>}
173 append buffer {<td class="formtext">File to upload</td><td><input type="file" name="form_filecontent"></td></tr></table>}
174 append buffer {<table><tr><td style="height:15px;width:535px;">&nbsp</td></tr><tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr><tr><td style="height:15px;width:535px;">&nbsp</td></tr></table>}
175 append buffer {<input type="submit" name="form_action" value="Upload" ><br> }
176 append buffer {</form>}
177
178
179 append buffer {
180
181 </td>
182 </tr>
183 }
184
185
186 set toggle_details [formfetch toggle_details]
187 if {[string length $toggle_details]==0} {
188 set toggle_details 0
189 }
190 set show_details [load_var show_details]
191 if {[string length $show_details]==0} {
192 set show_details 0
193 }
194 if {$toggle_details==1} {
195 set show_details [expr 1-$show_details]
196 save_var show_details $show_details
197 }
198
199 if {[string length $console]!=0} {
200
201 append buffer {
202 <tr style="height:100%;">
203 <td style="height:100%;background-color:red;" colspan="6">
204 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">
205 <td style="width:25px;">&nbsp;</td>
206 }
207
208 if {$show_details==1} {
209 append buffer <
210 append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}
211 append buffer >
212 } else {
213 append buffer <
214 append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"}
215 append buffer >
216 }
217
218 append buffer {
219 <a class="openocd" href="guiupload.tcl?toggle_details=1">
220 }
221
222 if {$show_details==1} {
223 append buffer "Hide details"
224 append buffer <br/>
225 } else {
226 append buffer {<div style="position:relative;top:7px;text-align:center;">}
227 append buffer "Show details"
228 append buffer {</div>}
229 }
230
231 append buffer {
232 </a>
233 }
234
235 if {$show_details==1} {
236 append buffer $console
237 }
238
239 append buffer {</td>}
240
241 if {$show_details!=1} {
242 append buffer {<td>&nbsp;</td>}
243 }
244
245 append buffer {
246 <td style="width:25px;">&nbsp;</td>
247 </table>
248 </td>
249 </tr>
250 }
251
252 }
253
254 append buffer {
255 <tr>
256 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
257 <div style="width:500px;background-color:#ffffff;height:100%;">
258 &nbsp;
259 </div>
260 </td>
261 </tr>
262 </table>
263 </td>
264 <td style="width:6px;"/>
265 <td style="width:245px;height:100%">
266 <table style="padding:0px;border-collapse:collapse;height:100%;">
267 <tr>
268 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">
269 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">
270 Documentation
271 </div>
272 </td>
273 <td width="40px">
274 &nbsp;
275 </td>
276 <td/>
277 </tr>
278 <tr>
279 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>
280 </tr>
281 <tr>
282 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">
283 <a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a>
284 <br/>
285 </td>
286 </tr>
287 <tr>
288 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
289 </tr>
290 <tr>
291 <td colspan="3">
292 <table style="padding:0px;border-collapse:collapse;">
293 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
294 <td style="background-color:#999999;width:225px; height:1px;"/>
295 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
296 </table>
297 </td>
298 </tr>
299 <tr>
300 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
301 </tr>
302 <tr style="height:100%;">
303 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray"/>
304 </tr>
305 <tr>
306 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">
307 &nbsp;
308 </td>
309 </tr>
310 </table>
311 </td>
312 </tr>
313 </table>
314 </body>
315 </html>
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331 }
332
333 start_chunked "html"
334 write_chunked $buffer
335 end_chunked
336