【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

新增缓存系统

key

dec.constant.intelligence.cluster.state.server

示例

新增缓存系统的配置
BI.config("dec.constant.intelligence.cluster.state.server", function (items) {
    items.unshift({
        value: "ehcache",
        text: BI.i18nText("内置Ehcache"),
        cardType: "dec.plugin.intelligence.cluster.state.ehcache"
    });
    return items;
});
页面实现
!(function () {
    var Plugin = BI.inherit(BI.Widget, {
 
        props: {
            baseCls: ""
        },
 
        render: function () {
            return {
                type: "bi.label",
                text: "新增的缓存系统"
            };
        },
 
        /**
         * 校验函数,可选
         * 只有返回值为ture的情况下才会测试连接保存
         * @returns {boolean}
         */
        validation: function () {
            return true;
        },
 
        /**
         * 取值函数,必选
         * 返回的值会与{open: Boolean, system: String}合并
         * @returns {{}}
         */
        getValue: function () {
            return {};
        }
    });
    BI.shortcut("dec.schedule.task.plugin", Plugin);
})();

新增文件服务器

key

dec.constant.intelligence.cluster.file.server

示例

新增文件服务器的配置
BI.config("dec.constant.intelligence.cluster.file.server", function (items) {
    items.push({
        value: "xx",
        text: "XX文件协议",
        cardType: "dec.plugin.intelligence.cluster.file.xx"
    });
    return items;
});

页面实现和上面的状态服务器类似,区别在于插件定义的页面不是整体,而且其中的一部分,并且返回的value值是传递到名为config的属性当中。

  • No labels