mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-30 06:41:26 +00:00
Update all npm dependencies and fix discovered issues. Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 lines
467 B
TypeScript
16 lines
467 B
TypeScript
import type {FrontendRenderFunc} from '../plugin.ts';
|
|
import {initSwaggerUI} from '../swagger.ts';
|
|
|
|
// HINT: SWAGGER-CSS-IMPORT: these styles are for the render only.
|
|
import '../../../css/swagger-render.css';
|
|
|
|
export const frontendRender: FrontendRenderFunc = async (opts): Promise<boolean> => {
|
|
try {
|
|
await initSwaggerUI(opts.container, {specText: opts.contentString()});
|
|
return true;
|
|
} catch (error) {
|
|
console.error(error);
|
|
return false;
|
|
}
|
|
};
|