* 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>
31 lines
701 B
TypeScript
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;
|