hardware_information 1.0.83 → 1.0.84

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.
@@ -1,498 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # Encoding: UTF-8
3
- # frozen_string_literal: true
4
- # =========================================================================== #
5
- # This page should be kept in german.
6
- # =========================================================================== #
7
- # http://localhost/programming/ruby/src/hardware_information/lib/hardware_information/www/my_hardware.cgi
8
- # =========================================================================== #
9
- # rffhware
10
- # =========================================================================== #
11
- require 'hardware_information/misc/purchased_hardware/purchased_hardware.rb'
12
-
13
- # =========================================================================== #
14
- # Note that the main hardware-related dataset is stored in this file:
15
- #
16
- # bl /home/x/data/personal/yaml/my_hardware/my_hardware.yml
17
- #
18
- # =========================================================================== #
19
- german(HardwareInformation::PurchasedHardware.title?) {
20
- autoextend
21
- favicon 'PC/HARDWARE/HWARE_FAVICON.png'
22
- default_template '
23
-
24
- pre {
25
- font-size: 1.4em;
26
- color:green;
27
- }
28
- body {
29
- padding-left: 8px;
30
- padding-right: 8px;
31
- font-weight: normal;
32
- color: white;
33
- }
34
- div {
35
- font-weight: normal;
36
- }
37
- h1,h2,h3,h4,h5,h6 {
38
- margin-top: 2px;
39
- padding: 2px;
40
- }
41
-
42
- a,
43
- a:active,
44
- a:link { color: steelblue; text-decoration: none; }
45
- a:visited { color: steelblue; }
46
- a:hover { color: mediumspringgreen; text-decoration: none; }
47
- i { font-size: bigger; font-weight:500}
48
- img { margin-right: 2px;}
49
-
50
- /*
51
- * The following min-width is important to prevent our <td>
52
- * tags from breaking into a newline too early.
53
- */
54
- td {
55
- min-width: 320px;
56
- }
57
-
58
- '
59
- body_css_class HardwareInformation::PurchasedHardware.body_css_class
60
- body_css_style HardwareInformation::PurchasedHardware.body_css_style
61
-
62
- font_size '1.2em'
63
-
64
- EURO_IMAGE = sg(:euro, 'mar1px mars5px').dup
65
- MARGIN_RIGHT = 'marr8px'
66
- S_CHAOS = sg :square_chaos, MARGIN_RIGHT
67
- S_DARKGOLDENROD = sg :square_darkgoldenrod, MARGIN_RIGHT
68
- GREEN_SQUARE = sg(:green_square, "bblack1 #{MARGIN_RIGHT}")
69
-
70
- # =========================================================================== #
71
- # === external_link
72
- #
73
- # This method is used in particular by the trailing part of the webpage,
74
- # to display the remote links.
75
- # =========================================================================== #
76
- def external_link(
77
- remote,
78
- name,
79
- optional_use_this_id = nil
80
- )
81
- br
82
- abr(
83
- remote,
84
- content: S_CHAOS+name, # This is actually the green dot.
85
- css_class: 's1em',
86
- id: optional_use_this_id
87
- )
88
- end
89
-
90
- # =========================================================================== #
91
- # === show_local_sitemap
92
- # =========================================================================== #
93
- def show_local_sitemap
94
- h2 'Sitemap','yel martb1px'
95
- p('marr1em FS1em mart0_1em'){
96
- sitemap_link '#Laptop1_Fujitsu_Siemens_Computers',
97
- 'Laptop FSC Amilo Pro V2030'
98
- sitemap_link '#USB_Netgear_108_WG111T',
99
- 'USB Netgear 108 WG111T Sticks '
100
- sitemap_link '#Maxtor_OneTouch_III_750',
101
- 'Maxtor External USB HDD 750 GIG'
102
- sitemap_link '#Imation_clip_Flash_Drive',
103
- 'Imitation 4 GIG USB Stick'
104
- sitemap_link '#Buffalo_Wireless_G_125',
105
- 'Buffalo Wireless Router'
106
- sitemap_link '#computer3',
107
- 'Rechner Computer3' # Mit K8M890
108
- sitemap_link '#Rechner_Miraculix_mit_xxxxx',
109
- 'Rechner Miraculix'
110
- sitemap_link '#Benq_G2000WA_LCD_Monitor',
111
- 'Benq LCD Monitor'
112
- sitemap_link '#Pinnacle_PCTV_Hybrid_Pro',
113
- 'Pinnacle PCTV Hybrid Pro Stick 330E'
114
- sitemap_link '#LCD_TV_19LG3000',
115
- 'LCD TV 19LG3000'
116
- sitemap_link '#FREECOM_EXTERNAL_HARD_DRIVE_3TB',
117
- 'FREECOM_EXTERNAL_HARD_DRIVE_3TB'
118
- }
119
- end
120
-
121
- # =========================================================================== #
122
- # === discarded_on_this_day
123
- # =========================================================================== #
124
- def discarded_on_this_day(i = nil)
125
- if i
126
- s2 sg(:rip,'marr8px').dup+
127
- '<span class="cyan">Entsorgt am: </span>','padl2_5em'
128
- s2 i.to_s, 'BO green'
129
- end
130
- end
131
-
132
- # =========================================================================== #
133
- # === sitemap_link
134
- # =========================================================================== #
135
- def sitemap_link(intralink, desc)
136
- unless intralink.start_with? '#'
137
- intralink[0, 0] = '#'
138
- end
139
- abr(
140
- intralink,
141
- {
142
- content: S_DARKGOLDENROD+desc,
143
- css_class: 'slateblue'
144
- }
145
- )
146
- end
147
-
148
- # =========================================================================== #
149
- # === show_external_links (links tag)
150
- #
151
- # This method will display all external links.
152
- # =========================================================================== #
153
- def show_external_links
154
- # ========================================================================= #
155
- # LINKS ZU HARDWARE
156
- # ========================================================================= #
157
- div(HardwareInformation::PurchasedHardware::MAIN_DIV+' float_container',
158
- '',
159
- 'margin-left: 1em;
160
- margin-right: 1em;
161
- border:1px ridge lightblue;
162
- min-height: 800px'){
163
- h2 sg(:big_star,'marr5px','drag_the_big_star')+
164
- 'Links',
165
- 'marl0_5em mart10px mar2px pad4px darkkhaki marb1em'
166
- # ========================================================================= #
167
- # Add the CSS rules for the following side-by-sid divs next:
168
- # ========================================================================= #
169
- add_this_css_style '
170
-
171
- .float_container {
172
- padding: 10px;
173
- margin-left: 1em;
174
- margin-right: 1em;
175
- }
176
-
177
- .float_child {
178
- width: 43%;
179
- float: left;
180
- padding: 20px;
181
- margin: 5px;
182
- min-height: 320px;
183
- border: 1px dotted gold;
184
- margin-left: 0.5em;
185
- margin-right: 0.5em;
186
- }
187
- '
188
- div('float_child') {
189
- div('mar0px pad0px') {
190
- external_link 'https://www.motherboards.org/',
191
- 'Motherboards'
192
- external_link 'https://kmuto.jp/debian/hcl/index.cgi',
193
- 'Debian Hardware Page'
194
- external_link 'https://geizhals.at/?m=1',
195
- 'Geizhals'
196
- external_link 'https://www.hardwareschrott.de/',
197
- 'Hardware Schrott','Hardware_Schrott'
198
- external_link 'https://www.rudiratz.de/index.php?m=2',
199
- 'Computer Lexikon'
200
- external_link 'https://www.alleseineuro.de/article_info.php/articles_id/1',
201
- 'Richtiges Löten'
202
- external_link 'https://www.tomshardware.com/',
203
- 'Toms Hardware Tips'
204
- external_link 'https://www.pcmasters.de/',
205
- 'Hardware News'
206
- external_link 'https://de.wikipedia.org/wiki/Liste_der_BIOS-Signalt%C3%B6ne',
207
- 'Biep Fehlercodes (Wikipedia)'
208
- external_link 'https://www.website-go.com/artikel/beepcodes.php',
209
- 'Gute Biep Fehlercodes mit Hilfestellung'
210
- external_link 'https://www.website-go.com/artikel/beepcodes.php',
211
- 'Deutschprachige Biep Fehlercodes'
212
- external_link 'https://www.alltests.de/index.php?sel=php/news/shortnews.php',
213
- 'Gute Hardware Tips'
214
- external_link 'https://www.digiwelt.at/officewelt-at/cf/frameset.cfm?bid=D3D9446802A44259755D38E6D163E820&fuseaction=Artikel.detail&artikel_id=1468',
215
- 'Hardware bei InterSpar'
216
- }
217
- }
218
- div('float_child') {
219
- div('mar0px pad0px') {
220
- external_link :local_hardware_assembly,
221
- 'Lokaler Link zu Hardware Assembly'
222
- external_link :wlan,
223
- 'Lokaler Link zu WLAN'
224
- external_link :local_ram,
225
- 'Lokaler Link zu RAM'
226
- external_link :local_scanner,
227
- 'Lokaler Link zu SCANNERS'
228
- external_link :local_sitemap,
229
- 'Lokaler Link zur SITEMAP'
230
- external_link :local_kabel,
231
- 'Lokaler Link zu KABEL und ADAPTOREN'
232
- external_link :local_computersystem,
233
- 'Lokaler Link zu Computersystemen'
234
- external_link :local_waschmaschinen,
235
- 'Lokaler Link zu Waschmaschinen'
236
- }
237
- }
238
- }
239
- end
240
-
241
- # =========================================================================== #
242
- # === display_the_total_costs
243
- #
244
- # This method will show the sum of the total purchase cost; the module
245
- # PurchasedHardware will keep track of this, so here we only display
246
- # that value.
247
- # =========================================================================== #
248
- def display_the_total_costs(
249
- i = HardwareInformation::PurchasedHardware.total_cost?
250
- )
251
- i = i.to_f
252
- # ========================================================================= #
253
- # === REGISTRIERTE GESAMTKOSTEN
254
- # ========================================================================= #
255
- div('mart1em s1em') {
256
- e sg(:dot102, 'marr8px')+
257
- '<b class="marl0_3em bigger"> Registrierte Gesamtkosten:</b> '
258
- br
259
- s2 i.round(3).to_s,
260
- 'yel marl2em BOLD bigger'
261
- s2 ' ('+(i * 13.7603).round(2).to_s+' Schilling)','teal'
262
- s2 EURO_IMAGE+
263
- ' <b>Euro</b> <span class="smaller">(seit 27.05.2004)</span>'
264
- br
265
- br
266
- }
267
- end
268
-
269
- doc(HardwareInformation::PurchasedHardware::MAIN_DIV,'','min-height:32em') {
270
- img 'PC/HARDWARE/HARDWARE.png','FLR BG_White',
271
- 'drag_hardware',
272
- 'margin-right:2%; top: 3em; opacity: 0.4;'
273
- # ========================================================================= #
274
- # Show a little heart-image next.
275
- # ========================================================================= #
276
- h2 sg(:herz, 'marr8px')+
277
- 'Meine Hardware - ausgelesen aus der Datei <br><br><b>'+
278
- HardwareInformation::PurchasedHardware.file_computer_hardware?+"</b> \n"+
279
- return_copy_to_clipboard_button(
280
- 'bluefish '+HardwareInformation::PurchasedHardware.file_computer_hardware?, # use_this_value
281
- 'clipboard_button_for_purchased_hardware', # use_this_id
282
- true, # true for "yes, hide the input field
283
- '😼', # This is the text that will be shown on the button.
284
- 'bblack2 pad8px' # CSS rules for the button.
285
- ),
286
- 'BO s0_2em BLOCK mart1px marb1em',
287
- '','padding-top:0.05em'
288
- ehtml_comment('Start of MyHardware')
289
- # ========================================================================= #
290
- # Iterate over our main hash next.
291
- # ========================================================================= #
292
- HardwareInformation::PurchasedHardware.my_hardware.each_pair {|name_of_the_hardware_in_question, hash|
293
- _ = hash
294
- # ======================================================================= #
295
- # Get the id to store onto the coming <div> tag.
296
- # ======================================================================= #
297
- the_id_to_store = Cyberweb.remove_html(
298
- name_of_the_hardware_in_question.tr(' ', '_')
299
- ).to_s.strip.tr('-','_')
300
- # ======================================================================= #
301
- # If we find a newline then we ignore all up to that newline.
302
- # ======================================================================= #
303
- if the_id_to_store.include? "\n"
304
- the_id_to_store = the_id_to_store[0, the_id_to_store.index("\n")]
305
- end
306
- if the_id_to_store.include? '"'
307
- the_id_to_store.delete! '"'
308
- end
309
- if the_id_to_store.count('_') > 3 # Only keep the first 3 '_'
310
- the_id_to_store = the_id_to_store.split('_')[0..3].join('_')
311
- end
312
- the_id_to_store.chop! if the_id_to_store.end_with? '_'
313
- the_id_to_store.delete!('()') if the_id_to_store.include?('(')
314
- # ======================================================================= #
315
- # Display a green square. Since as of September 2022 this is now a
316
- # clickable link. When clicking on that icon it will "redirect" to
317
- # the main ID of the segment at hand.
318
- # ======================================================================= #
319
- s2 '<a href="#'+the_id_to_store.to_s+'">'+
320
- GREEN_SQUARE+
321
- '</a>'+
322
- name_of_the_hardware_in_question
323
- # ======================================================================= #
324
- # The respective <div> for the Hardware in question comes next,
325
- # along with the correct ID.
326
- # ======================================================================= #
327
- div('mart1em mars1em pad4px pad1em', id: the_id_to_store) {
328
- # Next a Hash will be used:
329
- # ===================================================================== #
330
- # === description
331
- # ===================================================================== #
332
- if _.has_key? 'description'
333
- e _['description']
334
- end
335
- # ===================================================================== #
336
- # === image
337
- # ===================================================================== #
338
- if _.has_key? 'image'
339
- this_image = _['image']
340
- e sg(
341
- this_image[0].to_s,
342
- this_image[1].to_s,
343
- this_image[2].to_s,
344
- this_image[3].to_s
345
- )
346
- # ===================================================================== #
347
- # === draggable_image
348
- # ===================================================================== #
349
- elsif _.has_key? 'draggable_image'
350
- array = [_['draggable_image']].flatten
351
- array.each_slice(2) { |a, b|
352
- dimg(a.to_s, b.to_s)
353
- }
354
- br
355
- # ===================================================================== #
356
- # === draggable_images
357
- # ===================================================================== #
358
- elsif _.has_key? 'draggable_images'
359
- these_images = _['draggable_images']
360
- these_images.each {|this_image|
361
- dimg(this_image[0].to_s, this_image[1].to_s)
362
- br
363
- }
364
- end
365
- # ===================================================================== #
366
- # === bought_at
367
- #
368
- # When did we buy a specific hardware - the date of purchase. Will
369
- # be displayed right here.
370
- # ======================================================================= #
371
- if _.has_key?('bought_at') and !_['bought_at'].empty?
372
- bought_at_that_date_specifically = _['bought_at'].to_s.dup
373
- einkaufswagen = sg(:einkaufswagen, 'marl1em wid25px').dup
374
- # =================================================================== #
375
- # Next show when this hardware was purchased.
376
- # =================================================================== #
377
- s2 'Gekauft am:',
378
- 'padl2_5em marl1em'
379
- s2 bought_at_that_date_specifically+
380
- einkaufswagen,
381
- 'BOLD '+
382
- HardwareInformation::PurchasedHardware::COLOUR_PURCHASED_AT_THIS_DATE
383
- # =================================================================== #
384
- # And register it onto the main module that handles this.
385
- # =================================================================== #
386
- HardwareInformation::PurchasedHardware.add_bought_at(
387
- bought_at_that_date_specifically
388
- )
389
- end
390
- # ===================================================================== #
391
- # === cost
392
- # ===================================================================== #
393
- if _.has_key? 'cost'
394
- cost = _['cost'].to_s.to_f
395
- case cost
396
- when 0
397
- e '<b class="BO yel larger">Kosten unbekannt</b>'
398
- else
399
- HardwareInformation::PurchasedHardware.add_to_the_total_cost(cost)
400
- e 'um <b class="BO larger yellow">'+
401
- _['cost'].to_s+'</b>'+
402
- EURO_IMAGE.to_s
403
- "\n"' Euro</b> erworben'
404
- end
405
- end
406
- # ===================================================================== #
407
- # === died_at
408
- # ===================================================================== #
409
- if _.has_key? 'died_at'
410
- discarded_on_this_day(_['died_at'])
411
- end
412
- # ===================================================================== #
413
- # === link
414
- # ===================================================================== #
415
- if _.has_key? 'link'
416
- br
417
- a(
418
- _['link'][0].to_s,
419
- content: '→ '+_['link'][0].to_s,
420
- css_class: _['link'][1].to_s
421
- )
422
- # ===================================================================== #
423
- # === links
424
- # ===================================================================== #
425
- elsif _.has_key? 'links'
426
- _['links'].each {|entry, inner_array|
427
- br
428
- a(
429
- inner_array[0].to_s,
430
- content: '→ '+inner_array[0].to_s,
431
- css_class: inner_array[1].to_s
432
- )
433
- }
434
- end
435
- # ===================================================================== #
436
- # === images
437
- #
438
- # For reference, an entry matching the following clause may look
439
- # like this:
440
- #
441
- # - PC/HARDWARE/TV/XORO_TV_HTC1546_OUTLETS.jpg
442
- # - mar0_3em
443
- # - drag_xoro_tv_rückseite
444
- #
445
- # ===================================================================== #
446
- if _.has_key? 'images'
447
- _['images'].each {|entry_array, inner_array|
448
- img(
449
- inner_array[0].to_s,
450
- content: inner_array[0].to_s,
451
- css_class: inner_array[1].to_s,
452
- the_id: inner_array[2].to_s,
453
- css_style: inner_array[3].to_s
454
- )
455
- }
456
- end
457
- } # this ends the <p> tag.
458
- spacer(:middle) # Added this spacer as of August 2014.
459
- hr
460
- }
461
- # ========================================================================= #
462
- # === Display the final total costs next, close to the end of the web-app
463
- # ========================================================================= #
464
- display_the_total_costs
465
- show_external_links
466
- # ========================================================================= #
467
- # bl $LINUX/YAML/Computer_hardware.yml
468
- # ========================================================================= #
469
- # ========================================================================= #
470
- # Sitemap Tag. Hier nur Sachen sammeln die halbwegs wichtig sind!
471
- # Sonst läppert sich das wie verrückt zusammen.
472
- # ========================================================================= #
473
- div('wid30 posab pad1em padt0_5em BG_BLACK White','',
474
- 'right:0.5em; top:1em; border:1px dotted slateblue;'){
475
- show_local_sitemap
476
- }
477
- # sandisk USB fehlt noch hmmm.
478
- # Siehe hier: https://www.amazon.de/SanDisk-Cruzer-32GB-USB-Stick-Schwarz/dp/B00812F7O8
479
- # ========================================================================= #
480
- # Eventuell mini-pc kaufen:
481
- #
482
- # https://liliputing.com/2020/07/asus-pn50-is-a-mini-pc-with-up-to-an-amd-ryzen-7-4800u-processor.html
483
- # https://geizhals.at/asus-mini-pc-pn50-v26823.html
484
- # https://geizhals.at/asus-mini-pc-pn50-bbr343md-90mr00e1-m00150-a2314947.html
485
- # ^^^ 331 Euro am 12.12.2020
486
- # ^^^ 328 Euro am 22.01.2021
487
- # ^^^ 316 Euro am 31.03.2021
488
- # ========================================================================= #
489
- # Oder:
490
- #
491
- # https://geizhals.at/shuttle-xpc-slim-pos-ds100-pec-ds10u001-a2221818.html?hloc=at
492
- # 4 GIG RAM, 299 Euro.
493
- # ========================================================================= #
494
- # Last but not least we will enable some draggable images:
495
- # ========================================================================= #
496
- enable_drag_for(:drag_aerocool_cylon_tower)
497
- enable_drag_for(:drag_ASUS_TUF_MOTHERBOARD_Gaming_rear_panel_connectors)
498
- }}