const moment = require('vendor/moment/v2.21');
const metaResult = ChartEditor.getLoadedData().lunapark_api;
var params = ChartEditor.getParams()

function imbalance (imb) {
    if (imb != null) {
        return "Разладка: **" + imb + " RPS**"
    } else {
        return "Разладка не найдена"
    }
}

const markdown = `
## ${params.job_id[0]} ${metaResult.meta.name} \n
${moment.unix(metaResult.meta.start).format("DD/MM/YYYY HH:mm:ss")}
${imbalance(metaResult.meta.imbalance)}\n

${metaResult.meta.dsc}`;

module.exports = { 
    markdown
}
