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} [text]
*/
const AppLink = ({ config, wrn, text }) => {
const fullURL = getAppUrl(config, { wrn });
return <Link href={fullURL} target={wrn}>{text || wrn}</Link>;
const AppLink = ({ config, crn, text }) => {
const fullURL = getAppUrl(config, { crn });
return <Link href={fullURL} target={crn}>{text || crn}</Link>;
};
export default AppLink;

View File

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

View File

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

View File

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

View File

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