Skip to content

Dev: State

Zheng Luo edited this page Dec 11, 2016 · 1 revision

All states are specified in src/states.js, and any mutation of states should only be defined in src/mutations.js. Other files can either or both:

  • Read states
  • Mutate states by calling functions in src/mutations.js

State list

export default {
    mirrorList: [],
    helps: {},
    helpfiles: [],
    news: {},
    newsfiles: [],
};

mirrorlist

[{
                    name: worker,
                    display_name: worker,
                    last_sync: lastSync,
                    status_class: statusClass,
                    status,
},
...
]

helps

{
    "repo_name": "help_html",
    ...
}

helpfiles

[ "repo_name1_which_has_help", ... ]

news

{
    "news_filename1": {
        "title": "title",
        "date": "date",
        "content": "contentHTML"
    },
    ...
}

newsfiles

[
        {
            "title": "新的软件源界面",
            "filename": "rewrite_frontend",
            "date": "2016-05-15"
        },
        {
            "title": "喜迎校庆 SJTUG Mirrors加入Arch Linux镜像源",
            "filename": "celebration_for_anniversary",
            "date": "2016-04-07"
        },
        {
            "title": "SJTUG Demo镜像源成立",
            "filename": "established",
            "date": "2016-03-17"
        }
    ]
Clone this wiki locally