Skip to content

Configuration#

Root directory file configuration#

In the root directory of the plugin,Need Config.Toml file,The basic content of this file is as follows:

config.toml
package='com.longgui.case'
name="Sample plugin"
version='1.0'
labels='case'
homepage='https://www.company.com'
logo=''
author='case@company.com'

This file is with extension.__init__ The same role of the function.

When uploading the plug -in to the plug -in store,The plug -in store will also obtain the basic information of the plug -in through this configuration file。

Database configuration#

The kernel is for the convenience of the plug -in,Customized the configuration form of three plug -in。

And to generate the corresponding SCHEMA for these configurations to enable each plug -in API to dynamically adapt to the addition and deletion of the plugin。

Plug -in configuration (Profile)#

Define arkid.extension.models.Extension middle

One -to -one configuration with the plug -in itself,json format

use arkid.core.extension.Extension.register_profile_schema Register its schema

profileAdding, deletion, change inspection self.model Complete completion

Considuous configuration (Settings)#

Define arkid.extension.models.TenantExtension middle

There is only one settings configuration for each plugin under each tenant,json format

use arkid.core.extension.Extension.register_settings_schema Register its schema

settingsAdding, deletion, change inspection:

Configuration (config) during runtime#

Define arkid.extension.models.TenantExtensionConfig middle

Each plugin under each tenant has multiple configs,json format

use arkid.core.extension.Extension.register_config_schema Register its schema

use arkid.core.extension.Extension.register_composite_config_schema Register a type of SCHEMA

configAdding, deletion, change inspection:

Notice

The schema of the plug -in should be called arkid.core.extension.create_extension_schema Methods to complete

Exemplary
...

package = 'com.longgui.case'

Profile = create_extension_schema(
    'Profile', package,
    fields = [
        ('name', str, Field())
    ]
)

Settings = create_extension_schema(
    'Settings', package,
    fields = [
        ('name', str, Field())
    ]
)

Config = create_extension_schema(
    'Config', package,
    fields = [
        ('name', str, Field())
    ]
)

class CaseExtension(extension.Extension):
    def load(self):
        super().load()
        self.register_profile_schema(Profile)
        self.register_settings_schema(Settings)
        self.register_config_schema(Config)
        self.register_composite_config_schema(Config, 'type_name')

...

arkid.extension.models #

ArkStoreCategory (BaseModel) django-model #

ArkStoreCategory(id, is_del, is_active, updated, created, arkstore_id, arkstore_name, arkstore_parent_id, arkstore_type)

arkstore_id: IntegerField django-field nullable #

ArkStoreID

arkstore_name: CharField blank django-field nullable #

ArkStore名称

arkstore_parent_id: IntegerField django-field nullable #

ArkStoreParentID

arkstore_type: CharField django-field #

类别

created: DateTimeField blank django-field nullable #

创建时间

id: UUIDField django-field #

ID

is_active: BooleanField django-field #

是否可用

is_del: BooleanField django-field #

是否删除

updated: DateTimeField blank django-field nullable #

更新时间

Extension (BaseModel) django-model #

Extension(id, is_del, updated, created, type, labels, package, ext_dir, name, version, author, logo, homepage, is_active, expired, profile, is_allow_use_platform_config, category_id)

author: CharField blank django-field nullable #

Author

category_id: IntegerField django-field nullable #

ArkStore分类ID

created: DateTimeField blank django-field nullable #

创建时间

expired: BooleanField django-field #

expired

ext_dir: CharField django-field #

完整路径名

homepage: CharField blank django-field nullable #

Homepage

id: UUIDField django-field #

ID

is_active: BooleanField django-field #

是否启动

is_allow_use_platform_config: BooleanField django-field #

是否允许租户使用平台配置

is_del: BooleanField django-field #

是否删除

labels: JSONField blank django-field #

Labels

Logo

name: CharField django-field #

名称

package: CharField django-field #

标识

profile: JSONField blank django-field #

Setup Profile

type: CharField django-field #

类型

updated: DateTimeField blank django-field nullable #

更新时间

version: CharField django-field #

版本

TenantExtension (BaseModel) django-model #

TenantExtension(id, is_del, updated, created, tenant, extension, settings, is_active, is_rented, use_platform_config)

created: DateTimeField blank django-field nullable #

创建时间

extension: ForeignKey django-field #

插件

id: UUIDField django-field #

ID

is_active: BooleanField django-field #

是否使用

is_del: BooleanField django-field #

是否删除

is_rented: BooleanField django-field #

是否已租赁

settings: JSONField blank django-field #

Tenant Settings

tenant: ForeignKey django-field #

租户

updated: DateTimeField blank django-field nullable #

更新时间

use_platform_config: BooleanField django-field #

是否使用平台配置

TenantExtensionConfig (BaseModel) django-model #

TenantExtensionConfig(id, is_del, is_active, updated, created, tenant, extension, config, name, type)

config: JSONField blank django-field #

Runtime Config

created: DateTimeField blank django-field nullable #

创建时间

extension: ForeignKey django-field #

插件

id: UUIDField django-field #

ID

is_active: BooleanField django-field #

是否可用

is_del: BooleanField django-field #

是否删除

name: CharField django-field #

名称

tenant: ForeignKey django-field #

租户

type: CharField django-field #

类型

updated: DateTimeField blank django-field nullable #

更新时间

评论