feat: update data

This commit is contained in:
Fine 2024-07-30 20:31:54 +08:00
parent a5b1092968
commit c196e38e30
2 changed files with 4 additions and 3 deletions

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
export const MaximumEntities = 20;
export enum sizeEnum { export enum sizeEnum {
XS = "XS", XS = "XS",

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { RespFields } from "./data"; import { RespFields, MaximumEntities } from "./data";
import { EntityType, ExpressionResultType } from "@/views/dashboard/data"; import { EntityType, ExpressionResultType } from "@/views/dashboard/data";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
@ -323,8 +323,8 @@ export async function useExpressionsQueryPodsMetrics(
} }
const result = []; const result = [];
for (let i = 0; i < allPods.length; i += 20) { for (let i = 0; i < allPods.length; i += MaximumEntities) {
result.push(allPods.slice(i, i + 20)); result.push(allPods.slice(i, i + MaximumEntities));
} }
const promiseArr = result.map((d: Array<(Instance | Endpoint | Service) & Indexable>) => const promiseArr = result.map((d: Array<(Instance | Endpoint | Service) & Indexable>) =>
fetchPodsExpressionValues(d), fetchPodsExpressionValues(d),