You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
467 B
19 lines
467 B
![]()
4 years ago
|
import { exportPanel } from '../services/export_service';
|
||
|
|
||
|
import * as Router from 'koa-router';
|
||
|
|
||
|
|
||
|
async function getPanelTemplate(ctx: Router.IRouterContext) {
|
||
|
let panelId = ctx.request.query.panelId;
|
||
|
if(panelId === undefined) {
|
||
|
throw new Error('Cannot export analytic units with undefined panelId');
|
||
|
}
|
||
|
|
||
|
const json = await exportPanel(panelId);
|
||
|
ctx.response.body = json;
|
||
|
}
|
||
|
|
||
|
export var router = new Router();
|
||
|
|
||
|
router.get('/template', getPanelTemplate);
|