Beispiel #1
0
def render_saved_views_progress():
    valid_checks = [
        x for x in sorted(get_valid_checks())
        if not is_tile_only(x) and has_logs(x)
    ]
    total_checks = len(valid_checks)
    checks_with_sv = 0

    lines = [
        '## Default saved views (for integrations with logs)', '', None, '',
        '??? check "Completed"'
    ]

    for check in valid_checks:
        if has_saved_views(check):
            checks_with_sv += 1
            status = 'X'
        else:
            status = ' '

        lines.append(f'    - [{status}] {check}')

    percent = checks_with_sv / total_checks * 100
    formatted_percent = f'{percent:.2f}'
    lines[2] = f'[={formatted_percent}% "{formatted_percent}%"]'
    lines[4] = f'??? check "Completed {checks_with_sv}/{total_checks}"'
    return lines
def render_saved_views_progress():
    valid_checks = get_available_logs_integrations()
    total_checks = len(valid_checks)
    checks_with_sv = 0

    lines = ['## Default saved views', '', None, '', '??? check "Completed"']

    for check in valid_checks:
        if has_saved_views(check):
            checks_with_sv += 1
            status = 'X'
        else:
            status = ' '

        lines.append(f'    - [{status}] {check}')

    percent = checks_with_sv / total_checks * 100
    formatted_percent = f'{percent:.2f}'
    lines[2] = f'[={formatted_percent}% "{formatted_percent}%"]'
    return lines