@tekkare/auriga 0.2.204 → 0.2.207
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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/argAccordionMenu.vue +1 -1
- package/dist/runtime/components/argHeaderTabs.vue +33 -2
- package/dist/runtime/components/argModal.vue +1 -1
- package/dist/runtime/components/argSidebar.vue +1 -1
- package/dist/runtime/components/argSliderTabs.vue +33 -16
- package/dist/runtime/components/argSourcesElastic.vue +55 -45
- package/dist/runtime/components/argSourcesElastic.vue.d.ts +15 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -198,5 +198,5 @@ export default defineComponent({
|
|
|
198
198
|
</script>
|
|
199
199
|
|
|
200
200
|
<style scoped>
|
|
201
|
-
.arg_accordion_menu{display:flex;flex-direction:column;width:100%}.arg_accordion_section{border-bottom:1px solid var(--light,#ececf2);margin-bottom:4px;padding-bottom:8px}.arg_accordion_section:last-child{border-bottom:none}.arg_accordion_header{align-items:center;border-radius:8px;cursor:pointer;display:flex;justify-content:space-between;padding:8px;transition:background-color .2s ease}.arg_accordion_header:hover{background-color:var(--light,#ececf2)}.arg_accordion_title{font-size:13px;font-weight:700;line-height:normal}.arg_accordion_chevron{align-items:center;display:flex;transition:transform .2s ease}.arg_accordion_chevron.rotated{transform:rotate(180deg)}.arg_accordion_content{max-height:0;overflow:hidden;padding-left:12px;padding-right:8px;transition:max-height .3s ease}.arg_accordion_content.open{margin-top:4px;max-height:
|
|
201
|
+
.arg_accordion_menu{display:flex;flex-direction:column;width:100%}.arg_accordion_section{border-bottom:1px solid var(--light,#ececf2);margin-bottom:4px;padding-bottom:8px}.arg_accordion_section:last-child{border-bottom:none}.arg_accordion_header{align-items:center;border-radius:8px;cursor:pointer;display:flex;justify-content:space-between;padding:8px;transition:background-color .2s ease}.arg_accordion_header:hover{background-color:var(--light,#ececf2)}.arg_accordion_title{font-size:13px;font-weight:700;line-height:normal}.arg_accordion_chevron{align-items:center;display:flex;transition:transform .2s ease}.arg_accordion_chevron.rotated{transform:rotate(180deg)}.arg_accordion_content{max-height:0;overflow:hidden;padding-left:12px;padding-right:8px;transition:max-height .3s ease}.arg_accordion_content.open{margin-top:4px;max-height:2000px}.arg_accordion_item{align-items:center;align-self:stretch;border-radius:4px;color:var(--darkest,#1a1a2e);cursor:pointer;display:flex;font-size:14px;font-weight:400;gap:8px;justify-content:space-between;line-height:160%;padding:8px;text-decoration:none}.arg_accordion_item:hover:not(.is-active){background:var(--light,#ececf2)}.arg_accordion_item.is-active{background:rgba(33,118,255,.1)}.arg_accordion_item svg{color:var(--dark,#6c6c8a)!important}.arg_accordion_item.is-active svg,.arg_accordion_item:hover:not(.is-active) svg{color:var(--primary,#2176ff)!important}.arg_accordion_item_left{align-items:center;display:flex;gap:8px}.arg_accordion_indicator{border-radius:50%;flex-shrink:0;height:10px;width:10px}.arg_accordion_indicator.has-data{background-color:var(--system-success,#2ecc71)}.arg_accordion_indicator.no-data{background-color:#bdbdd2}.arg_accordion_sub_section{margin-bottom:8px}.arg_accordion_sub_header{align-items:center;border-radius:8px;cursor:pointer;display:flex;justify-content:space-between;padding:4px 8px;transition:background-color .2s ease}.arg_accordion_sub_header:hover{background-color:var(--light,#ececf2)}.arg_accordion_sub_label{color:var(--dark,#6c6c8a);font-size:12px;font-weight:700}.arg_accordion_sub_chevron{align-items:center;color:var(--medium,#9999b0);display:flex;transition:transform .2s ease}.arg_accordion_sub_chevron.rotated{transform:rotate(180deg)}.arg_accordion_sub_content{background:rgba(234,236,248,.4);border-radius:8px;margin-top:4px;max-height:0;overflow:hidden;padding:0 8px;transition:max-height .2s ease,padding .2s ease}.arg_accordion_sub_content.open{max-height:300px;padding:8px}
|
|
202
202
|
</style>
|
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
watch,
|
|
78
78
|
defineComponent
|
|
79
79
|
} from "vue";
|
|
80
|
+
import { useRouter, useRoute } from "vue-router";
|
|
80
81
|
export default defineComponent({
|
|
81
82
|
name: "argHeaderTabs",
|
|
82
83
|
props: {
|
|
@@ -99,14 +100,41 @@ export default defineComponent({
|
|
|
99
100
|
},
|
|
100
101
|
emits: ["updateMenu", "update:Menu"],
|
|
101
102
|
setup(props, { emit }) {
|
|
102
|
-
const
|
|
103
|
+
const router = useRouter();
|
|
104
|
+
const route = useRoute();
|
|
105
|
+
function toSlug(text) {
|
|
106
|
+
return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
107
|
+
}
|
|
108
|
+
function getTabIndexFromRoute() {
|
|
109
|
+
const tabParam = route.query.tab;
|
|
110
|
+
if (!tabParam) return null;
|
|
111
|
+
const idx = props.tabs.findIndex(
|
|
112
|
+
(t) => toSlug(String(t)) === tabParam
|
|
113
|
+
);
|
|
114
|
+
return idx !== -1 ? idx + 1 : null;
|
|
115
|
+
}
|
|
116
|
+
function updateRouteTab(index) {
|
|
117
|
+
const tab = props.tabs[index - 1];
|
|
118
|
+
if (!tab) return;
|
|
119
|
+
const slug = toSlug(String(tab));
|
|
120
|
+
if (route.query.tab !== slug) {
|
|
121
|
+
router.replace({ query: { ...route.query, tab: slug } });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const initialTab = getTabIndexFromRoute();
|
|
125
|
+
const true_index_menu = ref(initialTab ?? props.index_menu);
|
|
103
126
|
const scrollValue = ref(0);
|
|
104
127
|
const oldWidth = ref();
|
|
105
128
|
const isOverflow = ref(false);
|
|
129
|
+
if (initialTab && initialTab !== props.index_menu) {
|
|
130
|
+
emit("updateMenu", typeof props.index_menu === "string" ? initialTab.toString() : initialTab);
|
|
131
|
+
emit("update:Menu", typeof props.index_menu === "string" ? initialTab.toString() : initialTab);
|
|
132
|
+
}
|
|
106
133
|
watch(
|
|
107
134
|
() => props.index_menu,
|
|
108
135
|
(new_index_menu) => {
|
|
109
136
|
true_index_menu.value = new_index_menu;
|
|
137
|
+
updateRouteTab(Number(new_index_menu));
|
|
110
138
|
setBarWidth();
|
|
111
139
|
}
|
|
112
140
|
);
|
|
@@ -141,6 +169,7 @@ export default defineComponent({
|
|
|
141
169
|
emit("update:Menu", value);
|
|
142
170
|
}
|
|
143
171
|
true_index_menu.value = value;
|
|
172
|
+
updateRouteTab(Number(value));
|
|
144
173
|
scrollToActiveTab();
|
|
145
174
|
setBarWidth();
|
|
146
175
|
}
|
|
@@ -188,8 +217,10 @@ export default defineComponent({
|
|
|
188
217
|
}
|
|
189
218
|
onMounted(() => {
|
|
190
219
|
oldWidth.value = window?.innerWidth;
|
|
220
|
+
const startTab = initialTab ?? props.index_menu;
|
|
221
|
+
updateRouteTab(Number(startTab));
|
|
191
222
|
setTimeout(() => {
|
|
192
|
-
changeMenu(
|
|
223
|
+
changeMenu(startTab);
|
|
193
224
|
});
|
|
194
225
|
window.onresize = () => {
|
|
195
226
|
const content = document?.querySelector(".header_tabs_overlay");
|
|
@@ -41,5 +41,5 @@ export default defineComponent({
|
|
|
41
41
|
});
|
|
42
42
|
</script>
|
|
43
43
|
<style scoped>
|
|
44
|
-
.arg_modal_container{align-items:center;background-color:transparent;display:flex;flex-direction:column;height:100vh;justify-content:center;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:background-color .35s ease,opacity .35s ease;width:100
|
|
44
|
+
.arg_modal_container{align-items:center;background-color:transparent;display:flex;flex-direction:column;height:100vh;justify-content:center;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:background-color .35s ease,opacity .35s ease;width:100%;z-index:99}.arg_modal_open{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background-color:rgba(0,0,0,.6);opacity:1;pointer-events:auto;z-index:99}.arg_modal{align-items:flex-start;background:var(--base-white,#fff);border-radius:12px;display:flex;flex-shrink:0;height:100%;opacity:0;transform:scale(.95);transition:transform .35s ease,opacity .35s ease;width:100%}.arg_modal_visible{opacity:1;transform:scale(1)}.arg_modal.row{flex-direction:row;max-height:711px;max-width:1014px}.arg_modal.col{flex-direction:column;max-height:663px;max-width:966px}.arg_modal_open.set-width{padding:0 15%;width:70%}.arg_modal_header{align-items:center;align-self:stretch;border-bottom:1px solid var(--light,#ececf2);display:flex;justify-content:space-between;padding:24px}.arg_modal_body{align-self:stretch;flex:1;overflow-y:auto;padding:24px}.arg_modal_body.no-header.no-footer{overflow-y:visible;padding:24px}.arg_modal_footer{align-items:center;align-self:stretch;border-top:1px solid var(--light,#ececf2);display:flex;gap:16px;padding:24px}.arg_modal_close{align-items:center;border-radius:4px;cursor:pointer;display:flex;justify-content:center;padding:6px}.arg_modal_close:hover{background-color:var(--lightest,#f5f5fa)}
|
|
45
45
|
</style>
|
|
@@ -145,5 +145,5 @@ export default defineComponent({
|
|
|
145
145
|
});
|
|
146
146
|
</script>
|
|
147
147
|
<style scoped>
|
|
148
|
-
.arg_sidebar{align-items:flex-start;background:var(--lightest);border-right:1px solid var(--light,#ececf2);box-sizing:border-box;display:flex;flex-direction:column;gap:16px;height:100vh;left:0;padding:16px 8px;position:fixed;top:0;transition:all .3s ease;width:54px;z-index:98}.arg_sidebar_open{width:200px}.arg_sidebar_header_full{align-items:center;align-self:stretch;display:flex}.arg_sidebar_header_full.center{display:flex;justify-content:space-between}.arg_sidebar_header_full.end{display:flex;justify-content:flex-end}.arg_sidebar_header_small{align-items:center;display:flex;flex-direction:column;gap:var(--xxs,4px)}.arg_sidebar_home{background:var(--transparent);border-radius:4px;color:var(--primary);cursor:pointer;font-size:14px;font-weight:400;gap:6px;height:32px;line-height:160%;padding:6px}.arg_sidebar_home,.arg_sidebar_title{align-items:center;display:flex;font-style:normal}.arg_sidebar_title{align-self:stretch;flex-direction:row;font-size:20px;font-weight:900;gap:8px;line-height:normal;margin-bottom:16px;padding:0 8px}.arg_sidebar_body{
|
|
148
|
+
.arg_sidebar{align-items:flex-start;background:var(--lightest);border-right:1px solid var(--light,#ececf2);box-sizing:border-box;display:flex;flex-direction:column;gap:16px;height:100vh;left:0;padding:16px 8px;position:fixed;top:0;transition:all .3s ease;width:54px;z-index:98}.arg_sidebar_open{width:200px}.arg_sidebar_header_full{align-items:center;align-self:stretch;display:flex}.arg_sidebar_header_full.center{display:flex;justify-content:space-between}.arg_sidebar_header_full.end{display:flex;justify-content:flex-end}.arg_sidebar_header_small{align-items:center;display:flex;flex-direction:column;gap:var(--xxs,4px)}.arg_sidebar_home{background:var(--transparent);border-radius:4px;color:var(--primary);cursor:pointer;font-size:14px;font-weight:400;gap:6px;height:32px;line-height:160%;padding:6px}.arg_sidebar_home,.arg_sidebar_title{align-items:center;display:flex;font-style:normal}.arg_sidebar_title{align-self:stretch;flex-direction:row;font-size:20px;font-weight:900;gap:8px;line-height:normal;margin-bottom:16px;padding:0 8px}.arg_sidebar_body{gap:16px;justify-content:space-between;overflow:hidden;width:100%}.arg_sidebar_body,.arg_sidebar_content{display:flex;flex:1;flex-direction:column;min-height:0}.arg_sidebar_content{gap:8px;overflow-y:auto}.arg_sidebar_content::-webkit-scrollbar{height:5px;width:5px}.arg_sidebar_content::-webkit-scrollbar-thumb{background:var(--medium);border-radius:12px!important}.arg_sidebar_content::-webkit-scrollbar-thumb:hover{background:var(--medium)!important}.sidebar_toggle{align-items:center;align-self:flex-end;background:transparent;border-radius:4px;cursor:pointer;display:flex;justify-content:center;padding:6px}.link_menu_tooltip_icon{flex:1 1 100%}.tooltip_display{display:flex!important}.arg_sidebar_home:hover,.sidebar_toggle:hover{background:var(--light,#ececf2)!important}
|
|
149
149
|
</style>
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
:key="index"
|
|
20
20
|
:for="tabs[0].label + index"
|
|
21
21
|
class="labels_container hover_container"
|
|
22
|
-
:class="
|
|
22
|
+
:class="{
|
|
23
|
+
active: index === activeTab,
|
|
24
|
+
'show-separator': index !== activeTab && index !== activeTab - 1 && index !== tabs.length - 1
|
|
25
|
+
}"
|
|
23
26
|
>
|
|
24
27
|
<div
|
|
25
28
|
ref="buttonContents"
|
|
@@ -41,7 +44,6 @@
|
|
|
41
44
|
v-show="sliderVisible"
|
|
42
45
|
class="toggle_option_slider"
|
|
43
46
|
:style="{
|
|
44
|
-
background: 'white',
|
|
45
47
|
left: silderInfos.left,
|
|
46
48
|
width: silderInfos.width,
|
|
47
49
|
height: silderInfos.height
|
|
@@ -58,6 +60,7 @@ import {
|
|
|
58
60
|
ref,
|
|
59
61
|
computed,
|
|
60
62
|
onMounted,
|
|
63
|
+
onBeforeUnmount,
|
|
61
64
|
nextTick,
|
|
62
65
|
watch
|
|
63
66
|
} from "vue";
|
|
@@ -108,7 +111,7 @@ export default defineComponent({
|
|
|
108
111
|
return { width: "0", left: "0", height: "0" };
|
|
109
112
|
}
|
|
110
113
|
const width = `${activeButton.clientWidth + 16}px`;
|
|
111
|
-
const height = `${el.value.clientHeight -
|
|
114
|
+
const height = `${el.value.clientHeight - 10}px`;
|
|
112
115
|
return {
|
|
113
116
|
width,
|
|
114
117
|
left: `${left}px`,
|
|
@@ -118,33 +121,47 @@ export default defineComponent({
|
|
|
118
121
|
return { width: "0", left: "0", height: "0" };
|
|
119
122
|
}
|
|
120
123
|
};
|
|
121
|
-
const recalculateSlider =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
if (newInfos.width !== "0") {
|
|
127
|
-
sliderVisible.value = true;
|
|
128
|
-
}
|
|
124
|
+
const recalculateSlider = () => {
|
|
125
|
+
if (el.value && buttonContents.value && buttonContents.value.length > 0) {
|
|
126
|
+
const newInfos = getSliderInfos(props.activeTab);
|
|
127
|
+
if (newInfos.width !== "0") {
|
|
128
|
+
sliderVisible.value = true;
|
|
129
129
|
}
|
|
130
|
-
}
|
|
130
|
+
}
|
|
131
131
|
};
|
|
132
|
+
let resizeObserver = null;
|
|
132
133
|
watch(
|
|
133
134
|
() => props.activeTab,
|
|
134
|
-
() => {
|
|
135
|
+
async () => {
|
|
136
|
+
await nextTick();
|
|
135
137
|
recalculateSlider();
|
|
136
138
|
}
|
|
137
139
|
);
|
|
138
140
|
watch(
|
|
139
141
|
() => props.tabs,
|
|
140
|
-
() => {
|
|
142
|
+
async () => {
|
|
141
143
|
sliderVisible.value = false;
|
|
144
|
+
await nextTick();
|
|
142
145
|
recalculateSlider();
|
|
143
146
|
},
|
|
144
147
|
{ deep: true }
|
|
145
148
|
);
|
|
146
149
|
onMounted(() => {
|
|
147
|
-
|
|
150
|
+
nextTick(() => {
|
|
151
|
+
recalculateSlider();
|
|
152
|
+
});
|
|
153
|
+
if (el.value) {
|
|
154
|
+
resizeObserver = new ResizeObserver(() => {
|
|
155
|
+
recalculateSlider();
|
|
156
|
+
});
|
|
157
|
+
resizeObserver.observe(el.value);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
onBeforeUnmount(() => {
|
|
161
|
+
if (resizeObserver) {
|
|
162
|
+
resizeObserver.disconnect();
|
|
163
|
+
resizeObserver = null;
|
|
164
|
+
}
|
|
148
165
|
});
|
|
149
166
|
return {
|
|
150
167
|
updateButton,
|
|
@@ -158,5 +175,5 @@ export default defineComponent({
|
|
|
158
175
|
</script>
|
|
159
176
|
|
|
160
177
|
<style scoped>
|
|
161
|
-
.wrapper{background
|
|
178
|
+
.wrapper{background:#fff;border:1px solid var(--light,#dbdef0);border-radius:8px;padding:4px}.toggle_radio{background:hsla(0,0%,100%,.1);position:relative}.toggle_radio>*{float:left}.toggle_radio input[type=radio]{display:none}.toggle_radio label{color:var(--Main-Dark,#525670);cursor:pointer;display:block;font-family:Figtree;font-size:14px;font-weight:500;margin:3px;padding:2px 6px;text-align:center;transition:color .3s ease,font-weight .3s ease;z-index:20}.toggle_radio label.active{color:var(--primary,#2176ff);font-weight:600}.toggle_radio label.active svg{color:var(--primary,#2176ff)!important}.toggle_option_slider{background:rgba(33,118,255,.08);border:1px solid rgba(33,118,255,.25);border-radius:6px;box-shadow:none;position:absolute;transition:all .4s ease}.labels_container{align-self:center;height:100%;position:relative}.labels_container.show-separator:after{background:var(--light,#dbdef0);content:"";height:60%;position:absolute;right:-3px;top:20%;width:1px}.hover_container:not(.active):hover,.hover_container:not(.active):hover svg{color:var(--primary)!important}.icon_replacement-div{height:24px;margin:0;padding:0;width:0}.button_label{z-index:2}.icon_div{align-items:center;display:flex;height:24px;justify-content:center;z-index:2}
|
|
162
179
|
</style>
|
|
@@ -20,25 +20,26 @@
|
|
|
20
20
|
:source-id="uuid"
|
|
21
21
|
:source-title="constructTitle(uuid)"
|
|
22
22
|
:default-open="sourceToOpen && sourceToOpen == uuid"
|
|
23
|
+
:lang="lang"
|
|
23
24
|
>
|
|
24
25
|
<div class="oip_list gap-24">
|
|
25
26
|
<div class="oip_row v-center gap-24">
|
|
26
27
|
<div>
|
|
27
|
-
<p class="oip_filter_label">
|
|
28
|
+
<p class="oip_filter_label">{{ labels.lastUpdate }} :</p>
|
|
28
29
|
{{ getLastUpdate(uuid)?.update }}
|
|
29
30
|
</div>
|
|
30
31
|
|
|
31
32
|
<div>
|
|
32
|
-
<p class="oip_filter_label">
|
|
33
|
+
<p class="oip_filter_label">{{ labels.frequency }} :</p>
|
|
33
34
|
{{ getLastUpdate(uuid)?.frequency }}
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
36
37
|
<div class="oip_list gap-8">
|
|
37
|
-
<p class="small_heading">
|
|
38
|
+
<p class="small_heading">{{ labels.aboutProvider }}</p>
|
|
38
39
|
<p v-html="getDescriptions(uuid).provider" />
|
|
39
40
|
</div>
|
|
40
41
|
<div class="oip_list gap-8">
|
|
41
|
-
<p class="small_heading">
|
|
42
|
+
<p class="small_heading">{{ labels.aboutSource }}</p>
|
|
42
43
|
<p v-html="getDescriptions(uuid).source" />
|
|
43
44
|
</div>
|
|
44
45
|
</div>
|
|
@@ -63,7 +64,8 @@ export default defineComponent({
|
|
|
63
64
|
authKey: { type: String },
|
|
64
65
|
cluster: { type: String, default: "new" },
|
|
65
66
|
showCountry: { type: Boolean, default: true },
|
|
66
|
-
sourceToOpen: { type: String, default: null }
|
|
67
|
+
sourceToOpen: { type: String, default: null },
|
|
68
|
+
lang: { type: String, default: "en" }
|
|
67
69
|
},
|
|
68
70
|
emits: ["updateSources"],
|
|
69
71
|
setup(props, { emit }) {
|
|
@@ -80,43 +82,60 @@ export default defineComponent({
|
|
|
80
82
|
}
|
|
81
83
|
return uuids;
|
|
82
84
|
});
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
|
|
85
|
+
function getTranslated(provider, source) {
|
|
86
|
+
const langCode = props.lang;
|
|
87
|
+
const providerTrans = provider?.provider_sub_language?.find(
|
|
88
|
+
(t) => t.languages_code?.startsWith(langCode)
|
|
86
89
|
);
|
|
87
|
-
const
|
|
88
|
-
|
|
90
|
+
const sourceTrans = source?.source_sub_language?.find(
|
|
91
|
+
(t) => t.languages_code?.startsWith(langCode)
|
|
92
|
+
);
|
|
93
|
+
return {
|
|
94
|
+
providerName: providerTrans?.provider_name || provider?.provider_title,
|
|
95
|
+
providerDescription: providerTrans?.provider_description || provider?.provider_description,
|
|
96
|
+
sourceName: sourceTrans?.source_name || source?.source_title,
|
|
97
|
+
sourceDescription: sourceTrans?.source_description || source?.source_description
|
|
98
|
+
};
|
|
89
99
|
}
|
|
90
|
-
function
|
|
100
|
+
function findProviderAndSource(uuid) {
|
|
91
101
|
const provider = sourceResults.value.find(
|
|
92
102
|
(x) => x.provider_uuid === uuid || x?.sources?.some((y) => y?.source_id === uuid)
|
|
93
103
|
);
|
|
94
104
|
const source = provider?.sources?.find((x) => x.source_id === uuid);
|
|
105
|
+
return { provider, source };
|
|
106
|
+
}
|
|
107
|
+
function constructTitle(uuid) {
|
|
108
|
+
const { provider, source } = findProviderAndSource(uuid);
|
|
109
|
+
const translated = getTranslated(provider, source);
|
|
110
|
+
return `${translated.providerName} - ${translated.sourceName}`;
|
|
111
|
+
}
|
|
112
|
+
function getDescriptions(uuid) {
|
|
113
|
+
const { provider, source } = findProviderAndSource(uuid);
|
|
114
|
+
const translated = getTranslated(provider, source);
|
|
95
115
|
return {
|
|
96
|
-
provider:
|
|
97
|
-
source:
|
|
116
|
+
provider: translated.providerDescription,
|
|
117
|
+
source: translated.sourceDescription
|
|
98
118
|
};
|
|
99
119
|
}
|
|
120
|
+
const dateLocale = computed(() => {
|
|
121
|
+
const map = { fr: "fr-FR", en: "en-GB", es: "es-ES", jp: "ja-JP", kr: "ko-KR" };
|
|
122
|
+
return map[props.lang] || "en-GB";
|
|
123
|
+
});
|
|
124
|
+
const labels = computed(() => {
|
|
125
|
+
const isEn = props.lang === "en";
|
|
126
|
+
return {
|
|
127
|
+
lastUpdate: isEn ? "Last Update" : "Derni\xE8re mise \xE0 jour",
|
|
128
|
+
frequency: isEn ? "Update Frequency" : "Fr\xE9quence de mise \xE0 jour",
|
|
129
|
+
aboutProvider: isEn ? "About the provider" : "\xC0 propos du fournisseur",
|
|
130
|
+
aboutSource: isEn ? "About the source" : "\xC0 propos de la source"
|
|
131
|
+
};
|
|
132
|
+
});
|
|
100
133
|
function getLastUpdate(uuid) {
|
|
101
|
-
const provider =
|
|
102
|
-
|
|
103
|
-
);
|
|
104
|
-
const source = provider?.sources?.find((x) => x.source_id === uuid);
|
|
134
|
+
const { provider, source } = findProviderAndSource(uuid);
|
|
135
|
+
const dateOpts = { day: "numeric", month: "long", year: "numeric" };
|
|
105
136
|
return {
|
|
106
|
-
update: source?.last_download_date ? new Date(source?.last_download_date)?.toLocaleDateString("
|
|
107
|
-
|
|
108
|
-
month: "long",
|
|
109
|
-
year: "numeric"
|
|
110
|
-
}) : provider?.["@timestamp"] ? new Date(provider?.["@timestamp"])?.toLocaleDateString("en-GB", {
|
|
111
|
-
day: "numeric",
|
|
112
|
-
month: "long",
|
|
113
|
-
year: "numeric"
|
|
114
|
-
}) : "-",
|
|
115
|
-
visit: source?.source_last_visit ? new Date(source?.source_last_visit)?.toLocaleDateString("en-GB", {
|
|
116
|
-
day: "numeric",
|
|
117
|
-
month: "long",
|
|
118
|
-
year: "numeric"
|
|
119
|
-
}) : "-",
|
|
137
|
+
update: source?.last_download_date ? new Date(source?.last_download_date)?.toLocaleDateString(dateLocale.value, dateOpts) : provider?.["@timestamp"] ? new Date(provider?.["@timestamp"])?.toLocaleDateString(dateLocale.value, dateOpts) : "-",
|
|
138
|
+
visit: source?.source_last_visit ? new Date(source?.source_last_visit)?.toLocaleDateString(dateLocale.value, dateOpts) : "-",
|
|
120
139
|
frequency: source?.update_frequency ?? "-"
|
|
121
140
|
};
|
|
122
141
|
}
|
|
@@ -191,12 +210,7 @@ export default defineComponent({
|
|
|
191
210
|
};
|
|
192
211
|
if (field.startsWith("sources.")) {
|
|
193
212
|
filters.push({
|
|
194
|
-
|
|
195
|
-
path: "sources",
|
|
196
|
-
query: {
|
|
197
|
-
terms: term
|
|
198
|
-
}
|
|
199
|
-
}
|
|
213
|
+
terms: term
|
|
200
214
|
});
|
|
201
215
|
} else {
|
|
202
216
|
filters.push({
|
|
@@ -211,13 +225,8 @@ export default defineComponent({
|
|
|
211
225
|
}
|
|
212
226
|
});
|
|
213
227
|
filters.push({
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
query: {
|
|
217
|
-
terms: {
|
|
218
|
-
"sources.source_id.keyword": uuids
|
|
219
|
-
}
|
|
220
|
-
}
|
|
228
|
+
terms: {
|
|
229
|
+
"sources.source_id.keyword": uuids
|
|
221
230
|
}
|
|
222
231
|
});
|
|
223
232
|
}
|
|
@@ -262,7 +271,8 @@ export default defineComponent({
|
|
|
262
271
|
getLastUpdate,
|
|
263
272
|
isLoadingQuery,
|
|
264
273
|
reorderedUuids,
|
|
265
|
-
reloadKey
|
|
274
|
+
reloadKey,
|
|
275
|
+
labels
|
|
266
276
|
};
|
|
267
277
|
}
|
|
268
278
|
});
|
|
@@ -23,6 +23,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
23
23
|
type: StringConstructor;
|
|
24
24
|
default: null;
|
|
25
25
|
};
|
|
26
|
+
lang: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
26
30
|
}>, {
|
|
27
31
|
sourceResults: import("vue").Ref<never[], never[]>;
|
|
28
32
|
constructTitle: (uuid: string) => string;
|
|
@@ -38,6 +42,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
38
42
|
isLoadingQuery: import("vue").Ref<boolean, boolean>;
|
|
39
43
|
reorderedUuids: import("vue").ComputedRef<unknown[]>;
|
|
40
44
|
reloadKey: import("vue").Ref<number, number>;
|
|
45
|
+
labels: import("vue").ComputedRef<{
|
|
46
|
+
lastUpdate: string;
|
|
47
|
+
frequency: string;
|
|
48
|
+
aboutProvider: string;
|
|
49
|
+
aboutSource: string;
|
|
50
|
+
}>;
|
|
41
51
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "updateSources"[], "updateSources", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
42
52
|
fields: {
|
|
43
53
|
type: ArrayConstructor;
|
|
@@ -63,9 +73,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
63
73
|
type: StringConstructor;
|
|
64
74
|
default: null;
|
|
65
75
|
};
|
|
76
|
+
lang: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
66
80
|
}>> & Readonly<{
|
|
67
81
|
onUpdateSources?: ((...args: any[]) => any) | undefined;
|
|
68
82
|
}>, {
|
|
83
|
+
lang: string;
|
|
69
84
|
cluster: string;
|
|
70
85
|
showCountry: boolean;
|
|
71
86
|
sourceToOpen: string;
|