mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
new login design (#4442)
* new login design * remove effects file (wrong direction) * add Known Hosts dropdown component Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
6f360374cc
commit
d684a9c5fc
25 changed files with 675 additions and 212 deletions
|
|
@ -3,6 +3,7 @@ export enum FormKey {
|
|||
ADD_TO_IGNORE = "ADD_TO_IGNORE",
|
||||
CARD_IMPORT = "CARD_IMPORT",
|
||||
CONNECT = "CONNECT",
|
||||
LOGIN = "LOGIN",
|
||||
REGISTER = "REGISTER",
|
||||
SEARCH_LOGS = "SEARCH_LOGS",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
export enum RouteEnum {
|
||||
PLAYER = "/player/:name",
|
||||
SERVER = "/server",
|
||||
ROOM = "/room/:roomId",
|
||||
LOGS = "/logs",
|
||||
GAME = "/game",
|
||||
DECKS = "/decks",
|
||||
DECK = "/deck",
|
||||
ACCOUNT = "/account",
|
||||
PLAYER = '/player/:name',
|
||||
SERVER = '/server',
|
||||
ROOM = '/room/:roomId',
|
||||
LOGIN = '/',
|
||||
LOGS = '/logs',
|
||||
GAME = '/game',
|
||||
DECKS = '/decks',
|
||||
DECK = '/deck',
|
||||
ACCOUNT = '/account',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,48 @@ export enum StatusEnumLabel {
|
|||
"Disconnecting" = 99
|
||||
}
|
||||
|
||||
export class Host {
|
||||
id?: number;
|
||||
name: string;
|
||||
host: string;
|
||||
port: string;
|
||||
localHost?: string;
|
||||
localPort?: string;
|
||||
editable: boolean;
|
||||
}
|
||||
|
||||
export const DefaultHosts: Host[] = [
|
||||
{
|
||||
name: 'Rooster',
|
||||
host: 'server.cockatrice.us/servatrice',
|
||||
port: '4748',
|
||||
localHost: 'server.cockatrice.us',
|
||||
editable: false,
|
||||
},
|
||||
{
|
||||
name: 'Tetrarch',
|
||||
host: 'mtg.tetrarch.co/servatrice',
|
||||
port: '4748',
|
||||
editable: false,
|
||||
},
|
||||
];
|
||||
|
||||
export const getHostPort = (host: Host): { host: string, port: string } => {
|
||||
const isLocal = window.location.hostname === 'localhost';
|
||||
|
||||
if (!host) {
|
||||
return {
|
||||
host: '',
|
||||
port: ''
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
host: !isLocal ? host.host : host.localHost || host.host,
|
||||
port: !isLocal ? host.port : host.localPort || host.port,
|
||||
}
|
||||
};
|
||||
|
||||
export enum KnownHost {
|
||||
ROOSTER = 'Rooster',
|
||||
TETRARCH = 'Tetrarch',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue