fix(my-joy-beta): adapt to cloudapi-gql breaking changes
This commit is contained in:
parent
d3baebd25f
commit
77540223ab
@ -16,18 +16,12 @@ import {
|
||||
const { SmallOnly, Small } = QueryBreakpoints;
|
||||
|
||||
const stateColor = {
|
||||
provisioning: 'blue',
|
||||
ready: 'blue',
|
||||
active: 'green',
|
||||
running: 'green',
|
||||
stopping: 'grey',
|
||||
stopped: 'grey',
|
||||
offline: 'red',
|
||||
destroyed: 'red',
|
||||
failed: 'red',
|
||||
deleted: 'secondaryActive',
|
||||
incomplete: 'secondaryActive',
|
||||
unknown: 'secondaryActive'
|
||||
PROVISIONING: 'blue',
|
||||
RUNNING: 'green',
|
||||
STOPPING: 'grey',
|
||||
STOPPED: 'grey',
|
||||
DELETED: 'secondaryActive',
|
||||
FAILED: 'red'
|
||||
};
|
||||
|
||||
export default ({ name, state, primaryIp, last, first }) => (
|
||||
|
@ -11,6 +11,7 @@ import GetFirewallRules from '@graphql/list-firewall-rules.gql';
|
||||
import { FirewallRule as InstanceFirewallRule } from '@components/instances';
|
||||
|
||||
const Firewall = ({
|
||||
// eslint-disable-next-line camelcase
|
||||
firewallEnabled = false,
|
||||
firewallRules = [],
|
||||
loading,
|
||||
@ -63,9 +64,11 @@ export default compose(
|
||||
}),
|
||||
props: ({ data: { loading, error, variables, ...rest } }) => {
|
||||
const machine = find(get(rest, 'machines', []), ['name', variables.name]);
|
||||
const firewallEnabled = get(machine, 'firewallEnabled', false);
|
||||
const firewallRules = get(machine, 'firewallRules', []);
|
||||
// eslint-disable-next-line camelcase
|
||||
const firewallEnabled = get(machine, 'firewall_enabled', false);
|
||||
const firewallRules = get(machine, 'firewall_rules', []);
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
return { firewallEnabled, firewallRules, loading, error };
|
||||
}
|
||||
})
|
||||
|
@ -81,7 +81,7 @@ export default compose(
|
||||
[]
|
||||
);
|
||||
|
||||
const metadata = Object.keys(values).reduce((all, name) => {
|
||||
const metadata = values.reduce((all, { name, value }) => {
|
||||
const key = paramCase(name);
|
||||
|
||||
return {
|
||||
@ -90,7 +90,7 @@ export default compose(
|
||||
key,
|
||||
formName: `${key}-name`,
|
||||
formValue: `${key}-value`,
|
||||
value: values[name],
|
||||
value,
|
||||
name
|
||||
}
|
||||
};
|
||||
|
@ -15,6 +15,8 @@ const Networks = ({ networks = [], loading, error }) => {
|
||||
const _title = <Title>Networks</Title>;
|
||||
const _loading = !(loading && !values.length) ? null : <StatusLoader />;
|
||||
|
||||
console.log(values);
|
||||
|
||||
const _networks =
|
||||
!_loading &&
|
||||
values.map((network, i, all) => (
|
||||
|
@ -81,7 +81,7 @@ export default compose(
|
||||
[]
|
||||
);
|
||||
|
||||
const tags = Object.keys(values).reduce((all, name) => {
|
||||
const tags = values.reduce((all, { name, value }) => {
|
||||
const key = paramCase(name);
|
||||
|
||||
return {
|
||||
@ -90,7 +90,7 @@ export default compose(
|
||||
key,
|
||||
formName: `${key}-name`,
|
||||
formValue: `${key}-value`,
|
||||
value: values[name],
|
||||
value,
|
||||
name
|
||||
}
|
||||
};
|
||||
|
@ -2,14 +2,11 @@ query Instance($name: String!) {
|
||||
machines(name: $name) {
|
||||
id
|
||||
name
|
||||
brand
|
||||
state
|
||||
image
|
||||
memory
|
||||
disk
|
||||
created
|
||||
updated
|
||||
firewallEnabled
|
||||
package
|
||||
firewall_enabled
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ query Instance($name: String!) {
|
||||
machines(name: $name) {
|
||||
id
|
||||
name
|
||||
firewallEnabled
|
||||
firewallRules {
|
||||
firewall_enabled
|
||||
firewall_rules {
|
||||
id
|
||||
enabled
|
||||
global
|
||||
|
@ -2,13 +2,9 @@ query Instances {
|
||||
machines {
|
||||
id
|
||||
name
|
||||
brand
|
||||
state
|
||||
image
|
||||
metadata
|
||||
tags
|
||||
firewallEnabled
|
||||
primaryIp
|
||||
firewall_enabled
|
||||
primary_ip
|
||||
docker
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,10 @@ query Instance($name: String!) {
|
||||
machines(name: $name) {
|
||||
id
|
||||
name
|
||||
metadata
|
||||
metadata {
|
||||
id
|
||||
name
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,12 +9,11 @@ query Instance($name: String!) {
|
||||
fabric
|
||||
description
|
||||
subnet
|
||||
provisionStartIp
|
||||
provisionEndIp
|
||||
provision_start_ip
|
||||
provision_end_ip
|
||||
gateway
|
||||
resolvers
|
||||
routes
|
||||
internetNat
|
||||
internet_nat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,10 @@ query Instance($name: String!) {
|
||||
machines(name: $name) {
|
||||
id
|
||||
name
|
||||
tags
|
||||
tags {
|
||||
id
|
||||
name
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user