dvStudioServerSections function

List<DVStudioSection> dvStudioServerSections(
  1. DVStudioClient client
)

The sections Studio has on a server, named for someone who has never written code: the app's data, its site map, its backend logic, background tasks and their queue, the modules it mounts, the cache, and the team who may open Studio.

Implementation

List<DVStudioSection> dvStudioServerSections(DVStudioClient client) =>
    <DVStudioSection>[
      dvStudioDataSection(client),
      dvStudioSiteMapSection(client),
      // The builders, not a list: a page is of little use if a button
      // cannot be made to do anything. A backend function written in code
      // is in the site map's own listing.
      ...dvFunctionStudioSections(
        store: DVStudioRemoteFunctionStore(client),
        written: () async {
          final Map<String, Object?> graph = await client.manifest();
          return <Map<String, Object?>>[
            for (final Object? entry
                in (graph['functions'] as List?) ?? const <Object?>[])
              if (entry is Map) entry.cast<String, Object?>(),
          ];
        },
      ),
      DVStudioSection(
        id: 'modules',
        label: 'Modules',
        icon: Icons.extension_outlined,
        build: (BuildContext context) =>
            DVStudioModulesSection(manifest: client.manifest),
      ),
      DVStudioSection(
        id: 'jobs',
        label: 'Tasks',
        icon: Icons.work_history_outlined,
        build: (BuildContext context) => _DVStudioManifestSection(
          client: client,
          kind: 'jobs',
          title: 'Background tasks',
          columns: const <List<String>>[
            <String>['name', 'Task'],
            <String>['queue', 'Queue'],
            <String>['source', 'File'],
          ],
        ),
      ),
      DVStudioSection(
        id: 'queues',
        label: 'Queue',
        icon: Icons.inbox_outlined,
        build: (BuildContext context) => _DVStudioQueuesSection(client: client),
      ),
      DVStudioSection(
        id: 'cache',
        label: 'Cache',
        icon: Icons.bolt_outlined,
        build: (BuildContext context) => _DVStudioCacheSection(client: client),
      ),
      DVStudioSection(
        id: 'access',
        label: 'Team',
        icon: Icons.admin_panel_settings_outlined,
        build: (BuildContext context) => _DVStudioAccessSection(client: client),
      ),
    ];