@valaxyjs/devtools 0.25.11 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,131 +0,0 @@
1
- import { p as defineComponent, q as ref, i as createBlock, l as withCtx, y as unref, x as createVNode, a as createBaseVNode, z as createTextVNode, c as createElementBlock, h as renderList, w as withDirectives, ae as vModelCheckbox, t as toDisplayString, ac as postList, F as Fragment, af as vModelText, o as openBlock } from './index-DMBtOiwv.js';
2
- import { P as Pe, b as script, g as ge, c as axios } from './splitpanes.es-CQZybzj_.js';
3
-
4
- const _hoisted_1 = {
5
- flex: "~ gap-2",
6
- class: "items-center justify-center"
7
- };
8
- const _hoisted_2 = {
9
- class: "h-full",
10
- overflow: "auto",
11
- pl: "12",
12
- pr: "4",
13
- py: "4"
14
- };
15
- const _hoisted_3 = ["name", "value"];
16
- const _hoisted_4 = ["for"];
17
- const _hoisted_5 = {
18
- class: "h-full",
19
- overflow: "auto",
20
- pl: "12",
21
- pr: "4",
22
- py: "4"
23
- };
24
- const _hoisted_6 = ["for"];
25
- const _hoisted_7 = ["onUpdate:modelValue", "name"];
26
- const _sfc_main = /* @__PURE__ */ defineComponent({
27
- __name: "migration",
28
- setup(__props) {
29
- const mapper = ref({});
30
- const checkedPosts = ref([]);
31
- function clearPosts(select) {
32
- checkedPosts.value.length = 0;
33
- if (select)
34
- checkedPosts.value = checkedPosts.value.concat(postList.value.posts.map((i) => i.filePath));
35
- }
36
- async function migration() {
37
- const update = {};
38
- for (const key in mapper.value) {
39
- if (mapper.value[key] !== "")
40
- update[key] = mapper.value[key];
41
- }
42
- const res = await axios.post("/valaxy-devtools-api/migration", {
43
- pageData: checkedPosts.value,
44
- frontmatter: update
45
- });
46
- if (res.data === "ok") ;
47
- }
48
- return (_ctx, _cache) => {
49
- return openBlock(), createBlock(unref(Pe), { class: "h-full" }, {
50
- default: withCtx(() => [
51
- createVNode(unref(ge), null, {
52
- default: withCtx(() => [
53
- createBaseVNode("div", _hoisted_1, [
54
- createVNode(unref(script), {
55
- onClick: _cache[0] || (_cache[0] = ($event) => clearPosts(true))
56
- }, {
57
- default: withCtx(() => _cache[3] || (_cache[3] = [
58
- createTextVNode(" 全选 ", -1)
59
- ])),
60
- _: 1,
61
- __: [3]
62
- }),
63
- createVNode(unref(script), {
64
- onClick: _cache[1] || (_cache[1] = ($event) => clearPosts(false))
65
- }, {
66
- default: withCtx(() => _cache[4] || (_cache[4] = [
67
- createTextVNode(" 清空 ", -1)
68
- ])),
69
- _: 1,
70
- __: [4]
71
- })
72
- ]),
73
- createBaseVNode("ul", _hoisted_2, [
74
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(postList).posts, (post) => {
75
- return openBlock(), createElementBlock("li", {
76
- key: post.filePath,
77
- class: "list-decimal"
78
- }, [
79
- withDirectives(createBaseVNode("input", {
80
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => checkedPosts.value = $event),
81
- type: "checkbox",
82
- name: post.filePath,
83
- value: post.filePath
84
- }, null, 8, _hoisted_3), [
85
- [vModelCheckbox, checkedPosts.value]
86
- ]),
87
- createBaseVNode("label", {
88
- for: post.filePath
89
- }, toDisplayString(post.frontmatter.title), 9, _hoisted_4)
90
- ]);
91
- }), 128))
92
- ])
93
- ]),
94
- _: 1
95
- }),
96
- createVNode(unref(ge), null, {
97
- default: withCtx(() => [
98
- _cache[5] || (_cache[5] = createBaseVNode("h2", null, "原frontmatter字段->新字段", -1)),
99
- createBaseVNode("button", { onClick: migration }, " 提交 "),
100
- createBaseVNode("ul", _hoisted_5, [
101
- (openBlock(true), createElementBlock(Fragment, null, renderList(mapper.value, (_, key) => {
102
- return openBlock(), createElementBlock("li", { key }, [
103
- createBaseVNode("label", {
104
- for: key,
105
- style: { "margin-right": "20px" }
106
- }, toDisplayString(key) + " ->", 9, _hoisted_6),
107
- withDirectives(createBaseVNode("input", {
108
- "onUpdate:modelValue": ($event) => mapper.value[key] = $event,
109
- name: key
110
- }, null, 8, _hoisted_7), [
111
- [vModelText, mapper.value[key]]
112
- ])
113
- ]);
114
- }), 128))
115
- ])
116
- ]),
117
- _: 1,
118
- __: [5]
119
- })
120
- ]),
121
- _: 1
122
- });
123
- };
124
- }
125
- });
126
-
127
- /* Injected with object hook! */
128
-
129
- /* Injected with object hook! */
130
-
131
- export { _sfc_main as default };