Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo. #777

Merged
merged 2 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/dashboard/src/explorer/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
let url = `${window.configs.APP_GRIDPROXY_URL}/nodes?ret_count=true`;
url += `&size=${state.nodesTablePageSize}`;
url += `&page=${state.nodesTablePageNumber}`;
url += `&status=${state.nodeStatusFilter}`;
url += `&status=${state.nodeStatusFilter.toLocaleLowerCase()}`;

if (state.nodesGatewayFilter) url += "&ipv4=true&domain=true";
if (state.nodesGPUFilter) url += "&has_gpu=true";
Expand Down
4 changes: 2 additions & 2 deletions packages/dashboard/src/explorer/store/mutations.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { byInternet } from "country-code-lookup";

import { GetDataQueryType } from "../graphql/api";
import { NodeSatusFilter } from "../types/FilterOptions";
import { NodeStatusFilter } from "../types/FilterOptions";
import { INode } from "./../graphql/api";
import { IState } from "./state";

Expand Down Expand Up @@ -126,7 +126,7 @@ export default {
setGPUFilter(state: IState, payload: boolean) {
state.nodesGPUFilter = payload;
},
setNodeStatusFilter(state: IState, status: NodeSatusFilter) {
setNodeStatusFilter(state: IState, status: NodeStatusFilter) {
state.nodeStatusFilter = status;
},
setNodesFilter(state: IState, payload: { key: string; value: any }) {
Expand Down
6 changes: 3 additions & 3 deletions packages/dashboard/src/explorer/store/state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GetDataQueryType, IFarm, INode } from "../graphql/api";
import { NodeSatusFilter } from "../types/FilterOptions";
import { NodeStatusFilter } from "../types/FilterOptions";

interface IInFilter {
enabled: boolean;
Expand Down Expand Up @@ -92,7 +92,7 @@ export interface IState {
nodesTablePageNumber: number;
nodesTablePageSize: number;
nodesGatewayFilter: boolean;
nodeStatusFilter: NodeSatusFilter;
nodeStatusFilter: NodeStatusFilter;
nodesGPUFilter: boolean;

/* Refactored Data */
Expand Down Expand Up @@ -158,7 +158,7 @@ export default {
nodesCount: 0,
nodesTablePageNumber: 1,
nodesTablePageSize: 10,
nodeStatusFilter: NodeSatusFilter.up,
nodeStatusFilter: NodeStatusFilter.up,
nodesGatewayFilter: false,
nodesGPUFilter: false,
/* Refactored data */
Expand Down
8 changes: 4 additions & 4 deletions packages/dashboard/src/explorer/types/FilterOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default interface IFilterOptions {
getValue?: (filter: IFilterOptions) => any;
}

export enum NodeSatusFilter {
up = "up",
down = "down",
standBy = "standby",
export enum NodeStatusFilter {
up = "Up",
down = "Down",
standBy = "Standby",
}
14 changes: 7 additions & 7 deletions packages/dashboard/src/explorer/views/Nodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ import NodeFilter from "../components/NodeFilter.vue";
import { INode } from "../graphql/api";
import { ActionTypes } from "../store/actions";
import { MutationTypes } from "../store/mutations";
import { NodeSatusFilter } from "../types/FilterOptions";
import { NodeStatusFilter } from "../types/FilterOptions";

@Component({
components: {
Expand All @@ -169,7 +169,7 @@ export default class Nodes extends Vue {
{ text: "Status", value: "status", align: "center", customAlign: "text-center" },
];

statusFilter = NodeSatusFilter;
statusFilter = NodeStatusFilter;
filters = [
{
label: "Node ID",
Expand Down Expand Up @@ -291,12 +291,12 @@ export default class Nodes extends Vue {
}

getStatus(node: { status: string }) {
if (node.status === NodeSatusFilter.up) {
return { color: "green", status: NodeSatusFilter.up };
} else if (node.status === NodeSatusFilter.standBy) {
return { color: "#dc9123", status: NodeSatusFilter.standBy };
if (node.status === NodeStatusFilter.up.toLocaleLowerCase()) {
return { color: "green", status: NodeStatusFilter.up };
} else if (node.status === NodeStatusFilter.standBy.toLocaleLowerCase()) {
return { color: "#dc9123", status: NodeStatusFilter.standBy };
} else {
return { color: "red", status: NodeSatusFilter.down };
return { color: "red", status: NodeStatusFilter.down };
}
}

Expand Down