root/luci2/cbi2/widgets/file.c @ 5709

Revision 5709, 500 bytes (checked in by blogic, 3 years ago)

cleanup widgets

Line 
1#include "../cbi.h"
2
3json_object* file_json(struct cbi_ctx *ctx, struct cbi_element *e)
4{
5    json_object *j = json_object_new_object();
6    const char *type = cbi_find_prop(e, "type");
7    json_object_object_add(j, "type", json_object_new_string((type)?(type):("package")));
8    return j;
9}
10
11struct cbi_widget_property file_props[] = {
12    { "src", PROP_REQUIRED },
13    { "id", PROP_REQUIRED },
14};
15
16struct cbi_widget file = {
17    .caps = CAP_DATA | CAP_PACKAGE,
18    .json = file_json,
19    WPROPS(file_props),
20};
21
22WIDGET(file)
Note: See TracBrowser for help on using the browser.