import AttentionList from './AttentionList.vue';
import type { AttentionItem } from './overview.logic.ts';
// å››é¡¹çš„å›ºå®šéª¨æž¶ï¼ˆæ ‡é¢˜ã€è·³è½¬é¡µç¾ã€æŒ‰é’®æ–‡æ¡ˆä¸Ž buildAttention ä¸€è‡´ï¼‰ï¼Œå„ story åªæ¢è¯æ°”与详情
const versions = { key: 'versions', title: '节点版本', tab: 'nodes', actionLabel: '去节点' } as const;
const pipeline = { key: 'pipeline', title: 'æµæ°´çº¿', tab: 'pipeline', actionLabel: 'çœ‹æµæ°´çº¿' } as const;
const history = { key: 'history', title: '部署下å‘', tab: 'history', actionLabel: '看部署历å²' } as const;
const instances = { key: 'instances', title: '在线实例', tab: 'instances', actionLabel: '看实例' } as const;
const MIXED: AttentionItem[] = [
{ ...versions, tone: 'warn', detail: '2 个å¯ç”¨èŠ‚ç‚¹ç‰ˆæœ¬ä¸Žéƒ¨ç½²é›† 1.2.0 ä¸ä¸€è‡´' },
{ ...pipeline, tone: 'ok', detail: '最近一次è¿è¡ŒæˆåŠŸï¼ˆmain)' },
{ ...history, tone: 'info', detail: '还没有部署下å‘记录' },
{ ...instances, tone: 'info', detail: '3 个在线实例' },
];
const ALL_PENDING: AttentionItem[] = [
{ ...versions, tone: 'pending', detail: '没有部署集' },
{ ...pipeline, tone: 'pending', detail: '没有部署集' },
{ ...history, tone: 'pending', detail: '没有部署集' },
{ ...instances, tone: 'pending', detail: '在线实例数待接入' },
];
const ALL_OK: AttentionItem[] = [
{ ...versions, tone: 'ok', detail: '4 个å¯ç”¨èŠ‚ç‚¹ç‰ˆæœ¬éƒ½ä¸Žéƒ¨ç½²é›† 1.2.0 一致' },
{ ...pipeline, tone: 'ok', detail: '最近一次è¿è¡ŒæˆåŠŸï¼ˆmain)' },
{ ...history, tone: 'ok', detail: '最近一次下å‘(node-a 安装):命令已å‘出,是å¦ç”Ÿæ•ˆè¯·çœ‹èŠ‚ç‚¹ç‰ˆæœ¬' },
{ ...instances, tone: 'info', detail: '3 个在线实例' },
];
export const stories = [
// 测试状æ€ï¼šwarnã€okã€info æ··åˆï¼›warn 项详情用è¦å‘Šè‰²ã€é»„ç‚¹ï¼›æ²¡æœ‰ã€Œå¾…æŽ¥å…¥ã€æ ‡ç¾ï¼›æ¯è¡Œå³ä¾§ä¸€ä¸ªè·³è½¬æŒ‰é’®
{ id: 'AttentionList/Mixed', component: AttentionList, props: { items: MIXED } },
// 测试状æ€ï¼šå››é¡¹éƒ½å–ä¸åˆ°ï¼Œç©ºå¿ƒåœˆåŠ ã€Œå¾…æŽ¥å…¥ã€æ ‡ç¾ï¼Œä¸å½“作æ£å¸¸
{ id: 'AttentionList/AllPending', component: AttentionList, props: { items: ALL_PENDING } },
// 测试状æ€ï¼šç‰ˆæœ¬ä¸€è‡´ã€æµæ°´çº¿ä¸Žä¸‹å‘æˆåŠŸï¼Œç»¿ç‚¹ï¼›æœ€åŽä¸€è¡Œæ²¡æœ‰ä¸‹è¾¹çº¿
{ id: 'AttentionList/AllOk', component: AttentionList, props: { items: ALL_OK } },
// 测试状æ€ï¼šç‚¹æ¯ä¸ªè·³è½¬æŒ‰é’®ï¼ŒonGo 把收到的页ç¾ä¾æ¬¡è¿½åŠ è¿› window.__attentionGo(CT 点击用例读它),用æ¥ç¡®è®¤æŒ‰é’®å‘出的是 nodesã€pipelineã€historyã€instances
{
id: 'AttentionList/GoRecorder',
component: AttentionList,
props: {
items: MIXED,
onGo: (tab: string) => {
const w = window as unknown as { __attentionGo?: string[] };
(w.__attentionGo ??= []).push(tab);
},
},
},
];
|