-
- @Cp0204/quark_auto_save v{{ version }}
-
+
+
+
Cookie
-
-
-
+
所有账号执行签到,仅第一个账号执行转存,请自行确认顺序。
+
+
+
+
+
Emby
+
+
+
+
定时规则
+
+
+
任务列表
+
+
+
+
+
-
-
-
-
+
+
-
-
-
+
-
+
+
+
+
+
+
+
+
+ },
+ deep: true
+ }
+ },
+ mounted() {
+ this.fetchData();
+ },
+ methods: {
+ fetchData() {
+ axios.get('/data')
+ .then(response => {
+ // cookie兼容
+ if (typeof response.data.cookie === 'string')
+ response.data.cookie = [response.data.cookie];
+ // 星期运行兼容
+ response.data.tasklist = response.data.tasklist.map(task => {
+ if (!task.hasOwnProperty('runweek')) {
+ task.runweek = [1, 2, 3, 4, 5, 6, 7];
+ }
+ return task;
+ });
+ this.formData = response.data;
+ })
+ .catch(error => {
+ console.error('Error fetching data:', error);
+ });
+ },
+ saveConfig() {
+ axios.post('/update', this.formData)
+ .then(response => {
+ alert(response.data);
+ console.log('Config saved successfully:', response.data);
+ })
+ .catch(error => {
+ console.error('Error saving config:', error);
+ });
+ },
+ addCookie() {
+ this.formData.cookie.push("");
+ },
+ removeCookie(index) {
+ if (confirm("确认删除吗?"))
+ this.formData.cookie.splice(index, 1);
+ },
+ addPush() {
+ key = prompt("增加的键名", "");
+ if (key != "" && key != null)
+ this.$set(this.formData.push_config, key, "");
+ },
+ removePush(key) {
+ if (confirm("确认删除吗?"))
+ this.$delete(this.formData.push_config, key);
+ },
+ addTask() {
+ this.formData.tasklist.push({
+ taskname: "",
+ shareurl: "",
+ savepath: "",
+ pattern: "",
+ replace: "",
+ enddate: "",
+ emby_id: "",
+ runweek: [1, 2, 3, 4, 5, 6, 7]
+ });
+ },
+ removeTask(index) {
+ if (confirm("确认删除吗?"))
+ this.formData.tasklist.splice(index, 1);
+ },
+ clearShareurlBan(task) {
+ delete task.shareurl_ban;
+ },
+ runScriptNow() {
+ $('#logModal').modal('toggle')
+ this.run_log = "请耐心等待脚本全部执行完毕..."
+ axios.post('/run_script_now')
+ .then(response => {
+ this.run_log = response.data;
+ })
+ .catch(error => {
+ this.run_log = "错误:\n" + error
+ console.error('Error:', error);
+ });
+ }
+ }
+ });
+
\ No newline at end of file