Changes to run console-app with laconicd #2

Merged
nikugogoi merged 2 commits from ng-laconic-integrate into main 2022-12-02 08:20:32 +00:00
5 changed files with 24 additions and 24 deletions
Showing only changes of commit 1ce5ea52e1 - Show all commits

View File

@ -31,9 +31,9 @@ const getAppUrl = (config, { wrn }) => {
* @param {string} name * @param {string} name
* @param {string} [text] * @param {string} [text]
*/ */
const AppLink = ({ config, wrn, text }) => { const AppLink = ({ config, crn, text }) => {
const fullURL = getAppUrl(config, { wrn }); const fullURL = getAppUrl(config, { crn });
return <Link href={fullURL} target={wrn}>{text || wrn}</Link>; return <Link href={fullURL} target={crn}>{text || crn}</Link>;
}; };
export default AppLink; export default AppLink;

View File

@ -37,7 +37,7 @@ const useStyles = makeStyles(theme => ({
const types = [ const types = [
{ key: 'authority', label: 'Authority' }, { key: 'authority', label: 'Authority' },
{ key: 'wrn', label: 'WRN' } { key: 'crn', label: 'CRN' }
]; ];
export const LookupType = ({ scope = types[0].key, onChange }) => { export const LookupType = ({ scope = types[0].key, onChange }) => {
@ -87,9 +87,9 @@ const RegistryLookup = ({ scope }) => {
const getNames = () => { const getNames = () => {
let ret; let ret;
switch (scope) { switch (scope) {
case 'wrn': { case 'crn': {
ret = []; ret = [];
records.forEach(item => ret.push(...item.names)); records.forEach(item => ret.push(...(item.names || [])));
break; break;
} }
@ -98,9 +98,9 @@ const RegistryLookup = ({ scope }) => {
// TODO(telackey): Should we be able to query WNS for a list of authorities? // TODO(telackey): Should we be able to query WNS for a list of authorities?
const names = new Set(); const names = new Set();
for (const record of records) { for (const record of records) {
for (const name of record.names) { for (const name of (record.names || [])) {
// TODO(telackey): We need a general purpose WRN handling library. // TODO(telackey): We need a general purpose CRN handling library.
names.add(name.replace('wrn://', '').split('/')[0]); names.add(name.replace('crn://', '').split('/')[0]);
} }
} }
ret = Array.from(names.values()); ret = Array.from(names.values());
@ -120,7 +120,7 @@ const RegistryLookup = ({ scope }) => {
let result; let result;
switch (scope) { switch (scope) {
case 'wrn': case 'crn':
result = await registry.lookupNames([newInputValue], true); result = await registry.lookupNames([newInputValue], true);
break; break;

View File

@ -31,13 +31,13 @@ const useStyles = makeStyles(theme => ({
const types = [ const types = [
{ key: null, label: 'ALL' }, { key: null, label: 'ALL' },
{ key: 'wrn:kube', label: 'Kube' }, { key: 'crn:kube', label: 'Kube' },
{ key: 'wrn:service', label: 'Service' }, { key: 'crn:service', label: 'Service' },
{ key: 'wrn:app', label: 'App' }, { key: 'crn:app', label: 'App' },
{ key: 'wrn:bot', label: 'Bot' }, { key: 'crn:bot', label: 'Bot' },
{ key: 'wrn:bot-factory', label: 'Bot Factory' }, { key: 'crn:bot-factory', label: 'Bot Factory' },
{ key: 'wrn:file', label: 'File' }, { key: 'crn:file', label: 'File' },
{ key: 'wrn:type', label: 'Type' } { key: 'crn:type', label: 'Type' }
]; ];
export const RecordType = ({ type = types[0].key, onChange }) => { export const RecordType = ({ type = types[0].key, onChange }) => {
@ -104,12 +104,12 @@ const RegistryRecords = ({ type }) => {
pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />); pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />);
} }
if (type === 'wrn:app') { if (type === 'crn:app') {
appLinks = ( appLinks = (
<> <>
{names.map(wrn => {(names || []).map(crn =>
<div key={wrn}> <div key={crn}>
<AppLink config={config} wrn={wrn} /> <AppLink config={config} crn={crn} />
</div> </div>
)} )}
</> </>
@ -120,7 +120,7 @@ const RegistryRecords = ({ type }) => {
<TableRow key={id} size='small'> <TableRow key={id} size='small'>
<TableCell monospace>{type}</TableCell> <TableCell monospace>{type}</TableCell>
<TableCell monospace> <TableCell monospace>
{appLinks || names.map(name => <div key={name}>{name}</div>)} {appLinks || (names || []).map(name => <div key={name}>{name}</div>)}
</TableCell> </TableCell>
<TableCell monospace> <TableCell monospace>
{version} {version}

View File

@ -2,7 +2,7 @@
// Copyright 2020 DXOS.org // Copyright 2020 DXOS.org
// //
import { Registry } from '@wirelineio/registry-client'; import { Registry } from 'laconic-sdk';
import { getServiceUrl } from '../util/config'; import { getServiceUrl } from '../util/config';

View File

@ -4,7 +4,7 @@
import debug from 'debug'; import debug from 'debug';
import { Registry } from '@wirelineio/registry-client'; import { Registry } from 'laconic-sdk';
import { getServiceUrl } from './util/config'; import { getServiceUrl } from './util/config';