Commit c2591714 authored by loiclau's avatar loiclau

fix(broker) use final input name. (#6042)

parent 84ac457e
......@@ -445,7 +445,7 @@ INSERT INTO `cb_module` (`cb_module_id`, `name`, `libname`, `loading_pos`, `is_b
(18, 'Graphite', 'graphite.so', 21, 0, 1),
(19, 'InfluxDB', 'influxdb.so', 22, 0, 1),
(20, 'Correlation', 'correlation.so', 30, 0, 1),
(21, 'Lua', 'lua.so', 40, 0, 1);
(21, 'Generic', 'lua.so', 40, 0, 1);
--
......@@ -470,7 +470,7 @@ INSERT INTO `cb_type` (`cb_type_id`, `type_name`, `type_shortname`, `cb_module_i
(30, 'Storage - Graphite', 'graphite', 18),
(31, 'Storage - InfluxDB', 'influxdb', 19),
(32, 'Correlation', 'correlation', 20),
(33, 'Lua script', 'custom', 21);
(33, 'Stream connector', 'lua', 21);
--
-- Contenu de la table `cb_field`
......@@ -542,7 +542,7 @@ INSERT INTO `cb_fieldgroup` (`cb_fieldgroup_id`, `groupname`, `displayname`, `mu
(1, 'filters', '', 0, NULL),
(2, 'metrics_column', 'Metrics column', 1, NULL),
(3, 'status_column', 'Status column', 1, NULL),
(4, 'metrics_lua', 'metrics Lua', 1, NULL);
(4, 'lua_parameters', 'lua parameters', 1, NULL);
INSERT INTO `cb_field` (`cb_field_id`, `fieldname`, `displayname`, `description`, `fieldtype`, `external`, `cb_fieldgroup_id`) VALUES
(47, "category", "Filter category", "Category filter for flux in output", "multiselect", NULL, 1),
......@@ -811,7 +811,7 @@ INSERT INTO `cb_type_field_relation` (`cb_type_id`, `cb_field_id`, `is_required`
-- Contenu de la table `cb_type_field_relation`
--
INSERT INTO `cb_type_field_relation` (`cb_type_id`, `cb_field_id`, `is_required`, `order_display`, `jshook_name`, `jshook_arguments`) VALUES
(33, 73, 0, 5, 'luaArguments', '{"target": "metrics_lua__value_%d"}');
(33, 73, 0, 5, 'luaArguments', '{"target": "lua_parameters__value_%d"}');
--
-- Contenu de la table `widget_parameters_field_type`
......
......@@ -7,36 +7,36 @@ ALTER TABLE `cb_type_field_relation` ADD COLUMN `jshook_name` VARCHAR(255) DEFAU
ALTER TABLE `cb_type_field_relation` ADD COLUMN `jshook_arguments` VARCHAR(255) DEFAULT NULL;
INSERT INTO `cb_module` (`name`, `libname`, `loading_pos`, `is_activated`) VALUES ('Lua', 'lua.so', 40,1);
INSERT INTO `cb_module` (`name`, `libname`, `loading_pos`, `is_activated`) VALUES ('Generic', 'lua.so', 40,1);
INSERT INTO `cb_type` (`type_name`, `type_shortname`, `cb_module_id`)
VALUES ('Lua script', 'custom', (SELECT `cb_module_id` FROM `cb_module` WHERE `libname` = 'Lua.so'));
VALUES ('Stream connector', 'lua', (SELECT `cb_module_id` FROM `cb_module` WHERE `libname` = 'lua.so'));
INSERT INTO `cb_fieldgroup` (`groupname`, `displayname`, `multiple`, `group_parent_id`)
VALUES ('metrics_lua', 'metrics Lua', 1, NULL);
VALUES ('lua_parameters', 'lua parameters', 1, NULL);
INSERT INTO `cb_field` (`fieldname`, `displayname`, `description`, `fieldtype`, `external`, `cb_fieldgroup_id`)
VALUES
('path', 'Path', 'Path of the lua script.', 'text', NULL, NULL),
('type', 'Type', 'Type of the metric.', 'select', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'metrics_lua')),
('name', 'Name', 'Name of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'metrics_lua')),
('value', 'Value', 'Value of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'metrics_lua'));
('type', 'Type', 'Type of the metric.', 'select', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'lua_parameters')),
('name', 'Name', 'Name of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'lua_parameters')),
('value', 'Value', 'Value of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'lua_parameters'));
INSERT INTO `cb_type_field_relation` (`cb_type_id`, `cb_field_id`, `is_required`, `order_display`, `jshook_name`, `jshook_arguments`)
VALUES (
(SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
(SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Path of the lua script.'),
1, 1, NULL, NULL),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Category filter for flux in output'),
0, 2, NULL, NULL),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Type of the metric.'),
0, 5, 'luaArguments', '{"target": "metrics_lua__value_%d"}'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
0, 5, 'luaArguments', '{"target": "lua_parameters__value_%d"}'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Name of the metric.'),
0, 4, NULL, NULL),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Value of the metric.'),
0, 3, NULL, NULL);
......@@ -56,4 +56,4 @@ VALUES
);
INSERT INTO `cb_tag_type_relation` (`cb_tag_id`, `cb_type_id`, `cb_type_uniq`)
VALUES (1, (SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'), 0);
VALUES (1, (SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'), 0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment