OpenAuth_server/src/views/admin.ts

22 lines
554 B
TypeScript
Raw Normal View History

2020-08-07 14:16:39 +00:00
import * as handlebars from "handlebars";
2019-12-16 13:02:51 +00:00
import { readFileSync } from "fs";
2020-08-07 14:16:39 +00:00
import { __ as i__ } from "i18n";
2019-12-16 13:02:51 +00:00
import config from "../config";
let template: handlebars.TemplateDelegate<any>;
function loadStatic() {
let html = readFileSync("./views/out/admin/admin.html").toString();
template = handlebars.compile(html);
}
export default function GetAdminPage(__: typeof i__): string {
if (config.core.dev) {
2020-08-07 14:16:39 +00:00
loadStatic();
2019-12-16 13:02:51 +00:00
}
2020-08-07 14:16:39 +00:00
let data = {};
return template(data, { helpers: { i18n: __ } });
2019-12-16 13:02:51 +00:00
}
2020-08-07 14:16:39 +00:00
loadStatic();