Menu

How to hide a field / dashlet ? Configuration managment

Boleyno
2022-12-13
2022-12-15
  • Boleyno

    Boleyno - 2022-12-13

    Hello !

    I'm searching to hide a field / dashlet like "Rack" in the attachments. I don't want to delete the Rack's class but i don't want to see the Rack's dashlet on the page too.

    I found this XML in "datamodel.itop-datacenter-mgmt" :

        <menu id="ConfigManagementOverview" xsi:type="DashboardMenuNode" _delta="must_exist">
          <definition>
            <cells>
              <cell id="0" _delta="must_exist">
                <dashlets>
                  <dashlet id="21" xsi:type="DashletBadge" _delta="define">
                    <rank>1</rank>
                    <class>Rack</class>
                  </dashlet>
                </dashlets>
              </cell>
            </cells>
          </definition>
        </menu>
    

    I don't know what parameter I can use to hide the dashlet.

    Thank you !

     

    Last edit: Boleyno 2022-12-13
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-12-13

    You should create an extension to delete (_delta="delete") that specific node if you want to be a bit mure future-proof.

    Then, re-run the setup.

     
  • Boleyno

    Boleyno - 2022-12-14

    Thank you so much ! That work

    But i have another question !
    How to delete an item when this item is on a "category".

    Exemple <item id="rack_id"> on this code : </item>

    <presentation>
                    <details>
                        <items>
                            <item id="softwares_list">
                                <rank>10</rank>
                            </item>
                            <item id="contacts_list">
                                <rank>20</rank>
                            </item>
                            <item id="documents_list">
                                <rank>30</rank>
                            </item>
                            <item id="applicationsolution_list">
                                <rank>45</rank>
                            </item>
                            <item id="physicalinterface_list">
                                <rank>50</rank>
                            </item>
                            <item id="fiberinterfacelist_list">
                                <rank>60</rank>
                            </item>
                            <item id="networkdevice_list">
                                <rank>70</rank>
                            </item>
                            <item id="san_list">
                                <rank>80</rank>
                            </item>
                            <item id="logicalvolumes_list">
                                <rank>90</rank>
                            </item>
                            <item id="col:col1">
                                <rank>120</rank>
                                <items>
                                    <item id="fieldset:Server:baseinfo">
                                        <rank>10</rank>
                                        <items>
                                            <item id="name">
                                                <rank>10</rank>
                                            </item>
                                            <item id="org_id">
                                                <rank>20</rank>
                                            </item>
                                            <item id="status">
                                                <rank>30</rank>
                                            </item>
                                            <item id="business_criticity">
                                                <rank>40</rank>
                                            </item>
                                            <item id="location_id">
                                                <rank>50</rank>
                                            </item>
                                            <item id="rack_id">
                                                <rank>60</rank>
                                            </item>
                                            <item id="enclosure_id">
                                                <rank>70</rank>
                                            </item>
                                        </items>
                                    </item>
    

    In this code, if I do the next xml code (with the good tab) , I have an error.

          <presentation>
                    <details>
                        <items>
                <item id="col:col1">
                                <rank>120</rank>
                                <items>
                                    <item id="fieldset:Server:baseinfo">
                                        <rank>10</rank>
                                        <items>
                                            <item id="rack_id" _delta"delete">
                                                <rank>60</rank>
                                            </item>
                      </items>
                    </item>
                  </items>
                <item>                    
              </items>
            </details>
          </presentation>
    
    An error occured while processing the PHP files of the data model:
    
    Error loading module "hidden-server": Data model source file (file:/C:/Serveur%20iTop/iTop-3.0.1/web/extensions/hidden-server/datamodel.hidden-server.xml) could not be loaded : Opening and ending tag mismatch: item line 21 and items Opening and ending tag mismatch: item line 21 and details Opening and ending tag mismatch: items line 21 and presentation Opening and ending tag mismatch: details line 21 and class Opening and ending tag mismatch: presentation line 21 and classes Opening and ending tag mismatch: class line 21 and itop_design EndTag: '
    Check the PHP files describing the data model before running the toolkit again !
    
     

    Last edit: Boleyno 2022-12-14
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2022-12-15

    As the error message explains, mind to close each "items" tag. Try some XML formatting to see more easily where it goes wrong.

    Try to paste your code here: https://www.freeformatter.com/xml-formatter.html

    You'll see two mistakes: an <item> tag which should actually be a closing tag </item>; and also that the attribute _delta is missing an equal sign: _delta="define"

     
    • Boleyno

      Boleyno - 2022-12-15

      Thank you so mutch for giving me this tool ! That help me !

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.