Bug 27778 - Speicherangabe wird nicht validiert
Speicherangabe wird nicht validiert
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Virtual machines (UVMM)
UCS 3.0
All Linux
: P3 enhancement (vote)
: UCS 3.2
Assigned To: Philipp Hahn
Florian Best
: interim-1
Depends on: 27747
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-29 16:08 CEST by Philipp Hahn
Modified: 2013-11-19 06:44 CET (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:
klaeser: Patch_Available+


Attachments
ByteBox widget (5.02 KB, text/plain)
2012-06-29 16:08 CEST, Philipp Hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2012-06-29 16:08:09 CEST
Created attachment 4488 [details]
ByteBox widget

+++ This bug was initially created as a clone of Bug #27747 comment 2 +++

Langfristig sollte das Textfeld in
UMC für die Eingabe der RAM- und Festplattengröße durch ein eigenes Widget
ersetzt werden, was die komfortable Eingabe von KiB-TiB-Werten erlaubt, die
entsprechenden Limits für RAM (>= 4 MiB, derzeit <x GiB, Schrittweite 1 MiB)
und Festplatte (eher >= 1 GiB, <X TiB, Schrittweite 1 GiB). Zudem sollte
zwischen UMC-Frontend und UMC-Backend kein String der Form "X.Y [KMGT]B"
ausgetauscht werden, sondern wie zwischen UMC-Backend und UVMMd direkt die
Größe in Bytes, was die Validierung (u.a. für Bug #26645) vereinfacht.

branches/ucs-3.0/ucs/management/univention-management-console-frontend/umc/widgets/ByteBox.js

<script type="text/javascript">
var dojoConfig = {
  parseOnLoad: true,
  isDebug: false,
  debugAtAllCosts: false,
};
</script>
<script type="text/javascript" src="js/dojo/dojo.js"></script>
<script type="text/javascript">
dojo.require("umc.widgets.ByteBox");
dojo.addOnLoad(function() {
  bb = new umc.widgets.ByteBox({id: 'bb', value: '1234567'});
  dojo.place(bb.domNode, dojo.body());
});
</script>
Comment 1 Philipp Hahn univentionstaff 2013-07-25 20:12:52 CEST
Replaced by MappedTextBox:
<http://livedocs.dojotoolkit.org/dijit/form/MappedTextBox>
<https://dojotoolkit.org/api/1.8/dijit/form/MappedTextBox>

The value is now always converted to .2f, that is 2 decimals after the decimal separator. This might be a problem when the exact value of 1_234_567 is then converted to 1.23 MiB, which is 1_289_748

svn2783,42782
univention-virtual-machine-manager-daemon_3.0.6-1.458.201307252006

ChangeLog:
The value for the meory size and storage volumes is now validated in the frontend
Comment 2 Florian Best univentionstaff 2013-07-26 10:14:56 CEST
typo in Changelog
s/meory/memory/
Comment 3 Florian Best univentionstaff 2013-07-26 10:26:16 CEST
The value "20.00 GiBa" is not detected as invalid, a exception is raised then.
Comment 4 Philipp Hahn univentionstaff 2013-07-26 12:32:03 CEST
(In reply to Florian Best from comment #2)
> typo in Changelog
svn42810: fixed

(In reply to Florian Best from comment #3)
> The value "20.00 GiBa" is not detected as invalid, a exception is raised
> then.
fixed: prettyFormat() needs to pass on the original displayedValue unmodified, if the new value is invalid <http://livedocs.dojotoolkit.org/dijit/form/MappedTextBox#simple-programmatic-example>

univention-virtual-machine-manager-daemon_3.0.6-2.459.201307261228
Comment 5 Florian Best univentionstaff 2013-07-26 13:03:59 CEST
(In reply to Philipp Hahn from comment #4)
> (In reply to Florian Best from comment #2)
> > typo in Changelog
> svn42810: fixed
OK

> (In reply to Florian Best from comment #3)
> > The value "20.00 GiBa" is not detected as invalid, a exception is raised
> > then.
> fixed: prettyFormat() needs to pass on the original displayedValue
> unmodified, if the new value is invalid
> <http://livedocs.dojotoolkit.org/dijit/form/MappedTextBox#simple-
> programmatic-example>
> 
> univention-virtual-machine-manager-daemon_3.0.6-2.459.201307261228
OK
Comment 6 Stefan Gohmann univentionstaff 2013-11-19 06:44:00 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".