mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 19:01:56 +00:00
70ff5c3c4a0c30f15cc0d115011f5d9ac6146ef6
The ucode-mod-lua library provides an ucode-to-Lua bridge and a set of
functions to instantiate Lua VMs, invoke Lua functions as well as
exchanging data structures between ucode and Lua.
Example usage:
#!/usr/bin/ucode
'use strict';
const lua = require("lua");
let vm = lua.create();
vm.set({
hello: function(...args) {
print(`A ucode "Hello world" function called from Lua! Got arguments: ${args}\n`);
},
data_from_ucode: {
bool: true,
float: 1.3,
int: 0x11223344,
string: "Hello from ucode!",
array: [ 1, 2, 3, null, 5 ],
object: {
apple: "green",
banana: "yellow",
[5]: "foo",
[-1]: null,
nested: {
a: [ 5, 6 ],
b: { c: NaN }
}
},
regexp: /foo/
}
});
vm.invoke("hello", true, 123, "Foo");
vm.eval('print("Print from Lua!", data_from_ucode.int * data_from_ucode.float);');
try {
vm.invoke("error", "Throwing a Lua exception...");
}
catch (e) {
print(`Caught exception: ${e}\n`);
}
print(`Lua VM version is: ${vm.get('_G', '_VERSION').value()}\n`);
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
OpenWrt luci feed
Description
This is the OpenWrt "luci"-feed containing LuCI - OpenWrt Configuration Interface.
Usage
This feed is enabled by default. Your feeds.conf.default (or feeds.conf) should contain a line like:
src-git luci https://github.com/openwrt/luci.git
To install all its package definitions, run:
./scripts/feeds update luci
./scripts/feeds install -a -p luci
API Reference
You can browse the generated API documentation directly on Github.
Development
Documentation for developing and extending LuCI can be found in the Wiki
License
See LICENSE file.
Package Guidelines
See CONTRIBUTING.md file.
Translation status
Description
Languages
JavaScript
65.1%
C
17.3%
Lua
6.6%
CSS
3.7%
UnrealScript
3%
Other
4.2%