| 77 | @template('operations.html') |
| 78 | async def _section_operations(self, request): |
| 79 | def load_usage_markdown(header): |
| 80 | f = open('plugins/fieldmanual/sphinx-docs/Basic-Usage.md', 'r') |
| 81 | markdown = [] |
| 82 | seen_header = False |
| 83 | for x in f: |
| 84 | if (not seen_header and "## Operations" in x): |
| 85 | markdown = [] |
| 86 | seen_header = True |
| 87 | elif (seen_header and "## " in x): |
| 88 | break |
| 89 | elif (seen_header): |
| 90 | if "*" in x: |
| 91 | key, val = x.split(': ') |
| 92 | if (key and val): |
| 93 | key = key.split("*")[3] |
| 94 | val = val.strip("\n") |
| 95 | markdown.append({key: val}) |
| 96 | f.close() |
| 97 | return markdown |
| 98 | access = dict(access=tuple(await self.auth_svc.get_permissions(request))) |
| 99 | hosts = [h.display for h in await self.data_svc.locate('agents', match=access)] |
| 100 | groups = sorted(list(set(([h['group'] for h in hosts])))) |