Server switcher modal

This commit is contained in:
James Barnsley
2021-10-11 09:21:41 +13:00
parent e96344d4f2
commit d6a2c6263d
13 changed files with 317 additions and 132 deletions

View File

@ -10,33 +10,8 @@ import * as mopidyActions from '../services/mopidy/actions';
import { iconFromKeyword } from '../util/helpers';
import { I18n } from '../locale';
import LinksSentence from './LinksSentence';
import {
digestMopidyImages,
formatImages,
} from '../util/format';
import Thumbnail from './Thumbnail';
const callServer = ({ server, method, params }) => new Promise((resolve, reject) => {
const body = {
jsonrpc: '2.0',
id: 1,
host: server.host,
port: server.port,
method,
params,
};
fetch(
`http://192.168.1.201:6680/iris/http/get_from_peer`,
{
method: 'POST',
body: JSON.stringify(body),
},
)
.then((response) => response.json())
.then(({ result }) => resolve(result))
.catch(() => reject());
});
const Server = ({
server,
current_server,