diff --git a/src/store/modules/selectors.ts b/src/store/modules/selectors.ts index 44a3ec64..3445275b 100644 --- a/src/store/modules/selectors.ts +++ b/src/store/modules/selectors.ts @@ -83,10 +83,13 @@ export const selectorStore = defineStore({ } return res.data; }, - async getEndpoints(params: { - keyword: string; + async getEndpoints(params?: { + keyword?: string; serviceId?: string; }): Promise { + if (!params) { + params = {}; + } if (!params.keyword) { params.keyword = ""; } diff --git a/src/views/dashboard/configuration/ConfigEdit.vue b/src/views/dashboard/configuration/ConfigEdit.vue index 9cb0cd54..d4b6078b 100644 --- a/src/views/dashboard/configuration/ConfigEdit.vue +++ b/src/views/dashboard/configuration/ConfigEdit.vue @@ -169,12 +169,12 @@ export default defineComponent({ queryMetricType(states.metrics[0]); } - if (PodsChartTypes.includes(String(params.entity))) { + if (params.entity === "service") { + states.visType = ChartTypes; + } else { states.visType = ChartTypes.filter( (d: Option) => !PodsChartTypes.includes(d.value) ); - } else { - states.visType = ChartTypes; } async function changeMetrics(arr: Option[]) { diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index d6d47bd2..b52fb4a6 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -49,14 +49,19 @@ export const DefaultGraphConfig: { [key: string]: any } = { showUint: true, }, Table: { - type: "Card", + type: "Table", showTableValues: true, tableHeaderCol1: "", tableHeaderCol2: "", }, TopList: { type: "TopList", - topN: 10, + }, + InstanceList: { + type: "InstanceList", + }, + EndpointList: { + type: "EndpointList", }, }; diff --git a/src/views/dashboard/graphs/EndpointList.vue b/src/views/dashboard/graphs/EndpointList.vue index 3f14aa94..4529e8d3 100644 --- a/src/views/dashboard/graphs/EndpointList.vue +++ b/src/views/dashboard/graphs/EndpointList.vue @@ -13,22 +13,34 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> diff --git a/src/views/dashboard/graphs/InstanceList.vue b/src/views/dashboard/graphs/InstanceList.vue index 0287f52e..52505196 100644 --- a/src/views/dashboard/graphs/InstanceList.vue +++ b/src/views/dashboard/graphs/InstanceList.vue @@ -13,22 +13,34 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> diff --git a/src/views/dashboard/graphs/index.ts b/src/views/dashboard/graphs/index.ts index f676f686..d84aae03 100644 --- a/src/views/dashboard/graphs/index.ts +++ b/src/views/dashboard/graphs/index.ts @@ -23,6 +23,8 @@ import TopList from "./TopList.vue"; import Table from "./Table.vue"; import Pie from "./Pie.vue"; import Card from "./Card.vue"; +import InstanceList from "./InstanceList.vue"; +import EndpointList from "./EndpointList.vue"; export default { Line, @@ -33,4 +35,6 @@ export default { Table, Pie, Card, + EndpointList, + InstanceList, }; diff --git a/src/views/dashboard/panel/Tool.vue b/src/views/dashboard/panel/Tool.vue index f33e3c76..7e0f2f5a 100644 --- a/src/views/dashboard/panel/Tool.vue +++ b/src/views/dashboard/panel/Tool.vue @@ -165,10 +165,11 @@ async function fetchPods(type: string) { case "serviceInstance": resp = await selectorStore.getServiceInstances(); break; + default: + resp = {}; } if (resp.errors) { ElMessage.error(resp.errors); - return []; } }