directus-extension-cdh-tweets-report
Advanced tools
Comparing version 1.1.4 to 1.1.5
218
dist/app.js
@@ -1,2 +0,2 @@ | ||
import { defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createElementVNode, createBlock, normalizeStyle, createCommentVNode, inject, ref, computed, watch, onMounted, onUnmounted, toDisplayString } from 'vue'; | ||
import { defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createElementVNode, createBlock, normalizeStyle, createCommentVNode, inject, ref, computed, watch, onMounted, onUnmounted, createTextVNode, toDisplayString } from 'vue'; | ||
@@ -9,5 +9,5 @@ function defineModule(config) { | ||
const _hoisted_1$2 = { class: "" }; | ||
const _hoisted_2$2 = { class: "flex items-center" }; | ||
var _sfc_main$2 = /* @__PURE__ */ defineComponent({ | ||
const _hoisted_1$3 = { class: "" }; | ||
const _hoisted_2$3 = { class: "flex items-center" }; | ||
var _sfc_main$3 = /* @__PURE__ */ defineComponent({ | ||
__name: "nav", | ||
@@ -33,3 +33,3 @@ setup(__props) { | ||
const _component_v_list = resolveComponent("v-list"); | ||
return openBlock(), createElementBlock("div", _hoisted_1$2, [ | ||
return openBlock(), createElementBlock("div", _hoisted_1$3, [ | ||
createVNode(_component_v_list, { nav: "" }, { | ||
@@ -51,3 +51,3 @@ default: withCtx(() => [ | ||
default: withCtx(() => [ | ||
createElementVNode("div", _hoisted_2$2, [ | ||
createElementVNode("div", _hoisted_2$3, [ | ||
navItem.icon ? (openBlock(), createBlock(_component_v_icon, { | ||
@@ -95,3 +95,3 @@ key: 0, | ||
var Nav = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "nav.vue"]]); | ||
var Nav = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "nav.vue"]]); | ||
@@ -105,5 +105,5 @@ function useApi() { | ||
const _hoisted_1$1 = { class: "contain" }; | ||
const _hoisted_2$1 = { class: "wrapChar" }; | ||
var _sfc_main$1 = /* @__PURE__ */ defineComponent({ | ||
const _hoisted_1$2 = { class: "contain" }; | ||
const _hoisted_2$2 = { class: "wrapChar" }; | ||
var _sfc_main$2 = /* @__PURE__ */ defineComponent({ | ||
__name: "key-words", | ||
@@ -286,3 +286,3 @@ setup(__props) { | ||
default: withCtx(() => [ | ||
createElementVNode("div", _hoisted_1$1, [ | ||
createElementVNode("div", _hoisted_1$2, [ | ||
createVNode(_component_v_form, { | ||
@@ -299,3 +299,3 @@ modelValue: formSearch.value, | ||
[`item.percent`]: withCtx(({ item }) => [ | ||
createElementVNode("div", _hoisted_2$1, [ | ||
createElementVNode("div", _hoisted_2$2, [ | ||
createElementVNode( | ||
@@ -330,4 +330,193 @@ "div", | ||
var topKeyword = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "key-words.vue"]]); | ||
var topKeyword = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "key-words.vue"]]); | ||
const _hoisted_1$1 = { key: 0 }; | ||
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode( | ||
"br", | ||
null, | ||
null, | ||
-1 | ||
/* HOISTED */ | ||
); | ||
const _hoisted_3$1 = { | ||
key: 0, | ||
style: { "color": "var(--success)" } | ||
}; | ||
const _hoisted_4$1 = { | ||
key: 1, | ||
style: { "color": "var(--danger)" } | ||
}; | ||
var _sfc_main$1 = /* @__PURE__ */ defineComponent({ | ||
__name: "popup-add-keyword", | ||
setup(__props) { | ||
const api = useApi(); | ||
const fieldsPopup = [{ | ||
field: "keyword", | ||
name: "Keyword", | ||
meta: { | ||
interface: "input" | ||
} | ||
}, { | ||
name: "From Date", | ||
field: "from_date", | ||
type: "date", | ||
meta: { | ||
interface: "datetime" | ||
} | ||
}, { | ||
name: "To Date", | ||
field: "to_date", | ||
type: "date", | ||
meta: { | ||
interface: "datetime" | ||
} | ||
}]; | ||
const messages = ref({ | ||
status: "", | ||
message: "" | ||
}); | ||
const date = /* @__PURE__ */ new Date(); | ||
date.setDate(date.getDate() + 5); | ||
const modelAdd = ref({ | ||
keyword: "", | ||
from_date: "", | ||
to_date: "" | ||
}); | ||
const popupCreate = ref(false); | ||
const popupLoading = ref(false); | ||
const submitKeyword = () => { | ||
popupLoading.value = true; | ||
api.post("/reports/add-keyword", { | ||
keyword: modelAdd.value.keyword.toUpperCase(), | ||
fromDate: modelAdd.value.from_date, | ||
toDate: modelAdd.value.to_date | ||
}).then((r) => { | ||
messages.value.status = "success"; | ||
messages.value.message = "Success! " + r.data.data; | ||
modelAdd.value = { | ||
keyword: "", | ||
from_date: "", | ||
to_date: "" | ||
}; | ||
}).catch((e) => { | ||
messages.value.status = "error"; | ||
messages.value.message = "Has error. Cant create keyword"; | ||
}).then((r) => { | ||
popupLoading.value = false; | ||
}); | ||
setTimeout(() => { | ||
messages.value.status = ""; | ||
messages.value.message = ""; | ||
}, 3e3); | ||
}; | ||
const canSubmit = computed(() => { | ||
return modelAdd.value.keyword && modelAdd.value.keyword.length > 2 && modelAdd.value.keyword.from_date && modelAdd.value.keyword.to_date; | ||
}); | ||
return (_ctx, _cache) => { | ||
const _component_v_icon = resolveComponent("v-icon"); | ||
const _component_v_button = resolveComponent("v-button"); | ||
const _component_v_card_title = resolveComponent("v-card-title"); | ||
const _component_v_form = resolveComponent("v-form"); | ||
const _component_v_card_text = resolveComponent("v-card-text"); | ||
const _component_v_card_actions = resolveComponent("v-card-actions"); | ||
const _component_v_card = resolveComponent("v-card"); | ||
const _component_v_dialog = resolveComponent("v-dialog"); | ||
return openBlock(), createBlock(_component_v_dialog, { | ||
modelValue: popupCreate.value, | ||
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => popupCreate.value = $event), | ||
onEsc: _cache[4] || (_cache[4] = ($event) => popupCreate.value = false) | ||
}, { | ||
activator: withCtx(({ on }) => [ | ||
createVNode(_component_v_button, { | ||
onClick: _cache[0] || (_cache[0] = ($event) => popupCreate.value = true), | ||
rounded: "", | ||
icon: "" | ||
}, { | ||
default: withCtx(() => [ | ||
createVNode(_component_v_icon, { name: "add" }) | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}) | ||
]), | ||
default: withCtx(() => [ | ||
createVNode(_component_v_card, null, { | ||
default: withCtx(() => [ | ||
createVNode(_component_v_card_title, null, { | ||
default: withCtx(() => [ | ||
createTextVNode("Add New Keywords Search") | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}), | ||
createVNode(_component_v_card_text, null, { | ||
default: withCtx(() => [ | ||
createVNode(_component_v_form, { | ||
modelValue: modelAdd.value, | ||
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelAdd.value = $event), | ||
fields: fieldsPopup | ||
}, null, 8, ["modelValue"]), | ||
messages.value.status ? (openBlock(), createElementBlock("div", _hoisted_1$1, [ | ||
_hoisted_2$1, | ||
messages.value.status === "success" ? (openBlock(), createElementBlock( | ||
"div", | ||
_hoisted_3$1, | ||
toDisplayString(messages.value.message), | ||
1 | ||
/* TEXT */ | ||
)) : createCommentVNode("v-if", true), | ||
messages.value.status === "error" ? (openBlock(), createElementBlock( | ||
"div", | ||
_hoisted_4$1, | ||
toDisplayString(messages.value.message), | ||
1 | ||
/* TEXT */ | ||
)) : createCommentVNode("v-if", true) | ||
])) : createCommentVNode("v-if", true) | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}), | ||
createVNode(_component_v_card_actions, null, { | ||
default: withCtx(() => [ | ||
createVNode(_component_v_button, { | ||
secondary: "", | ||
onClick: _cache[2] || (_cache[2] = ($event) => popupCreate.value = false) | ||
}, { | ||
default: withCtx(() => [ | ||
createTextVNode(" Cancel ") | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}), | ||
createVNode(_component_v_button, { | ||
kind: "warning", | ||
disabled: canSubmit.value, | ||
loading: popupLoading.value, | ||
onClick: submitKeyword | ||
}, { | ||
default: withCtx(() => [ | ||
createTextVNode(" Submit ") | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}, 8, ["disabled", "loading"]) | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}) | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}) | ||
]), | ||
_: 1 | ||
/* STABLE */ | ||
}, 8, ["modelValue"]); | ||
}; | ||
} | ||
}); | ||
var PopupAddKeyword = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "popup-add-keyword.vue"]]); | ||
const _hoisted_1 = { class: "contain" }; | ||
@@ -501,2 +690,5 @@ const _hoisted_2 = /* @__PURE__ */ createElementVNode( | ||
]), | ||
actions: withCtx(() => [ | ||
createVNode(PopupAddKeyword) | ||
]), | ||
default: withCtx(() => [ | ||
@@ -503,0 +695,0 @@ createElementVNode("div", _hoisted_1, [ |
{ | ||
"name": "directus-extension-cdh-tweets-report", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "directus:extension": { |
Sorry, the diff of this file is too big to display
388286
17907