@tekkare/auriga 0.2.203 → 0.2.206
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 +3 -3
- 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 +28 -14
- package/dist/runtime/components/argSourcesElastic.vue +52 -32
- package/dist/runtime/components/argSourcesElastic.vue.d.ts +15 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<div
|
|
32
32
|
v-if="item.onClick"
|
|
33
33
|
class="arg_accordion_item"
|
|
34
|
-
@click="() => { item.onClick
|
|
34
|
+
@click="() => { item.onClick(); $emit('onNavigate', item); }"
|
|
35
35
|
>
|
|
36
36
|
<div class="arg_accordion_item_left">
|
|
37
37
|
<arg-icon v-if="item.icon" :name="item.icon" size="20" />
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<div
|
|
91
91
|
v-if="item.onClick"
|
|
92
92
|
class="arg_accordion_item"
|
|
93
|
-
@click="() => { item.onClick
|
|
93
|
+
@click="() => { item.onClick(); $emit('onNavigate', item); }"
|
|
94
94
|
>
|
|
95
95
|
<div class="arg_accordion_item_left">
|
|
96
96
|
<arg-icon v-if="item.icon" :name="item.icon" size="20" />
|
|
@@ -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>
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
v-show="sliderVisible"
|
|
42
42
|
class="toggle_option_slider"
|
|
43
43
|
:style="{
|
|
44
|
-
background: 'white',
|
|
45
44
|
left: silderInfos.left,
|
|
46
45
|
width: silderInfos.width,
|
|
47
46
|
height: silderInfos.height
|
|
@@ -58,6 +57,7 @@ import {
|
|
|
58
57
|
ref,
|
|
59
58
|
computed,
|
|
60
59
|
onMounted,
|
|
60
|
+
onBeforeUnmount,
|
|
61
61
|
nextTick,
|
|
62
62
|
watch
|
|
63
63
|
} from "vue";
|
|
@@ -118,33 +118,47 @@ export default defineComponent({
|
|
|
118
118
|
return { width: "0", left: "0", height: "0" };
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
const recalculateSlider =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
if (newInfos.width !== "0") {
|
|
127
|
-
sliderVisible.value = true;
|
|
128
|
-
}
|
|
121
|
+
const recalculateSlider = () => {
|
|
122
|
+
if (el.value && buttonContents.value && buttonContents.value.length > 0) {
|
|
123
|
+
const newInfos = getSliderInfos(props.activeTab);
|
|
124
|
+
if (newInfos.width !== "0") {
|
|
125
|
+
sliderVisible.value = true;
|
|
129
126
|
}
|
|
130
|
-
}
|
|
127
|
+
}
|
|
131
128
|
};
|
|
129
|
+
let resizeObserver = null;
|
|
132
130
|
watch(
|
|
133
131
|
() => props.activeTab,
|
|
134
|
-
() => {
|
|
132
|
+
async () => {
|
|
133
|
+
await nextTick();
|
|
135
134
|
recalculateSlider();
|
|
136
135
|
}
|
|
137
136
|
);
|
|
138
137
|
watch(
|
|
139
138
|
() => props.tabs,
|
|
140
|
-
() => {
|
|
139
|
+
async () => {
|
|
141
140
|
sliderVisible.value = false;
|
|
141
|
+
await nextTick();
|
|
142
142
|
recalculateSlider();
|
|
143
143
|
},
|
|
144
144
|
{ deep: true }
|
|
145
145
|
);
|
|
146
146
|
onMounted(() => {
|
|
147
|
-
|
|
147
|
+
nextTick(() => {
|
|
148
|
+
recalculateSlider();
|
|
149
|
+
});
|
|
150
|
+
if (el.value) {
|
|
151
|
+
resizeObserver = new ResizeObserver(() => {
|
|
152
|
+
recalculateSlider();
|
|
153
|
+
});
|
|
154
|
+
resizeObserver.observe(el.value);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
onBeforeUnmount(() => {
|
|
158
|
+
if (resizeObserver) {
|
|
159
|
+
resizeObserver.disconnect();
|
|
160
|
+
resizeObserver = null;
|
|
161
|
+
}
|
|
148
162
|
});
|
|
149
163
|
return {
|
|
150
164
|
updateButton,
|
|
@@ -158,5 +172,5 @@ export default defineComponent({
|
|
|
158
172
|
</script>
|
|
159
173
|
|
|
160
174
|
<style scoped>
|
|
161
|
-
.wrapper{background:rgba(82,86,112,.04);border:1px solid rgba(82,86,112,.1);border-radius:8px;padding:2px}.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;z-index:20}.toggle_option_slider{background:var(--
|
|
175
|
+
.wrapper{background:rgba(82,86,112,.04);border:1px solid rgba(82,86,112,.1);border-radius:8px;padding:2px}.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:#fff;font-weight:600}.toggle_radio label.active svg{color:#fff!important}.toggle_option_slider{background:var(--primary,#2176ff);border:none;border-radius:6px;box-shadow:0 1px 3px 0 rgba(33,118,255,.3);position:absolute;transition:all .4s ease}.labels_container{align-self:center;height:100%}.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
176
|
</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
|
}
|
|
@@ -262,7 +281,8 @@ export default defineComponent({
|
|
|
262
281
|
getLastUpdate,
|
|
263
282
|
isLoadingQuery,
|
|
264
283
|
reorderedUuids,
|
|
265
|
-
reloadKey
|
|
284
|
+
reloadKey,
|
|
285
|
+
labels
|
|
266
286
|
};
|
|
267
287
|
}
|
|
268
288
|
});
|
|
@@ -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;
|