支持Clash YAML输入

This commit is contained in:
Peng-YM
2020-08-25 11:18:35 +08:00
parent 8cec472812
commit 1b0f8f124e
9 changed files with 674 additions and 101 deletions

View File

@@ -52,9 +52,13 @@ const store = new Vuex.Store({
});
},
// update subscriptions
async UPDATE_SUBSCRIPTION({commit}, {name, sub}) {
async UPDATE_SUBSCRIPTION({commit, dispatch}, {name, sub}) {
axios.patch(`/sub/${name}`, sub).then(() => {
commit("FETCH_SUBSCRIPTIONS");
dispatch("FETCH_SUBSCRIPTIONS");
dispatch("FETCH_COLLECTIONS");
commit("SET_SUCCESS_MESSAGE", `成功更新订阅${sub.name || name}`);
}).catch(err => {
commit("SET_ERROR_MESSAGE", err);
});
},
// new subscription
@@ -62,8 +66,14 @@ const store = new Vuex.Store({
},
// delete subscription
async DELETE_SUBSCRIPTION() {
async DELETE_SUBSCRIPTION({commit, dispatch}, name) {
axios.delete(`/sub/${name}`).then(() => {
dispatch("FETCH_SUBSCRIPTIONS");
dispatch("FETCH_COLLECTIONS");
commit("SET_SUCCESS_MESSAGE", `成功删除订阅${name}`);
}).catch(err => {
commit("SET_ERROR_MESSAGE", err);
})
},
// update collection
async UPDATE_COLLECTION() {