I'm writing my plugin / patch. Need help

  • Hello. There was a problem with saving data in xml.
    Created all the necessary files.
    usr/share/openmediavault/datamodels/conf.mydev.devinputs.json




    usr/share/openmediavault/engined/rpc/devinputs.inc



    var/www/openmediavault/js/omv/module/admin/mydev/mydev.js


    JavaScript: mydev.js
    OMV.WorkspaceManager.registerNode({
    	id: "mydev",
    	path: "/",
    	text: _("DEV"),
    	position: 11
    });

    var/www/openmediavault/js/omv/module/admin/mydev/dev_inputs/Dev_inputs.js


    config.xml


    Console command:


    source /usr/share/openmediavault/scripts/helper-functions && omv_purge_internal_cache


    service openmediavault-engined restart


    I get a list, but when saving the change to xml, the entry of idved > 1 elements is duplicated
    Only iddev 1 is overwritten.
    Please tell me how to fix my error.
    Thanks.

    • Offizieller Beitrag

    You are missing a lot of code necessary. The biggest issue is you aren't referencing an ID anywhere and you are trying to save the entire grid without iterating through it. Have you looked at the other plugins? The minidlna plugin would be a good reference - https://github.com/OpenMediaVa…s/openmediavault-minidlna

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!