tachybase_todo/packages/plugins/iframe-block/src/server/plugin.ts
SemmyWong 6d1a4425f2
feat: add iframe-block plugin (#1281)
* feat: iframe-block plugin done

* refactor: iframe html filed type changed

* refactor: remove built-in actions in the ACL

* refactor: use built-in resource action

* fix: add iframe-block in built-in plugins

* refactor: remove id collection schema

* fix: fix iframe-block permission

* fix: fix iframe-block permission

* fix: improve code

* fix: src

* fix: bug

Co-authored-by: chenos <chenlinxh@gmail.com>
2022-12-24 16:29:20 +08:00

31 lines
701 B
TypeScript

import { InstallOptions, Plugin } from '@nocobase/server';
import path from 'path';
import { getHtml } from './actions';
export class IframeBlockPlugin extends Plugin {
afterAdd() {}
beforeLoad() {}
async load() {
await this.db.import({
directory: path.resolve(__dirname, 'collections'),
});
this.app.acl.allow('iframeHtml', ['get', 'create', 'update', 'destroy'], 'allowConfigure');
this.app.acl.allow('iframeHtml', 'getHtml', 'loggedIn');
this.app.actions({
'iframeHtml:getHtml': getHtml,
});
}
async install(options?: InstallOptions) {}
async afterEnable() {}
async afterDisable() {}
async remove() {}
}
export default IframeBlockPlugin;