Skip to content

Commit

Permalink
- Changed telegram login
Browse files Browse the repository at this point in the history
  • Loading branch information
639852 committed Aug 9, 2023
1 parent af33fb3 commit 9c3d24d
Show file tree
Hide file tree
Showing 8 changed files with 347 additions and 257 deletions.
24 changes: 21 additions & 3 deletions src/components/appMain/appFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="footer">
<div class="container">
<div class="footer__content">
<div v-for="(button, index) in getButtons" :key="index" @click="setTabByName(button.title)" class="button" :class="{ active: button.title==active }">
<div v-for="(button, index) in filteredButtons" :key="index" @click="setTabByName(button.title)" class="button" :class="{ active: button.title==active }">
<div class="button__icon">
<a-icon :type="button.icon" :theme="button.theme" />
</div>
Expand All @@ -22,13 +22,31 @@ export default {
computed: {
...mapGetters('app', ['getButtons']),
...mapGetters('app', ['getActiveTab']),
active(){
user() {
return this.$store.getters['nocloud/auth/billingData'];
},
active() {
const footerTitle = this.$route.meta?.footerTitle;
const layoutTitle = this.$route.meta?.layoutTitle;
if(footerTitle) return footerTitle;
if(layoutTitle) return layoutTitle;
return this.getActiveTab.title;
}
},
filteredButtons() {
return this.getButtons.filter(({ title }) => {
if (!this.user.roles) return true;
switch (title) {
case 'billing':
return this.user.roles?.invoice;
case 'settings':
return true;
default:
return this.user.roles[title];
}
});
}
},
methods: {
...mapActions('app', ['setTabByName'])
Expand Down
23 changes: 2 additions & 21 deletions src/components/appMain/appHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@

<script>
import { mapActions, mapGetters, mapMutations } from "vuex";
import { createPromiseClient } from "@bufbuild/connect";
import { HandsfreeService } from "infinimesh-proto/build/es/handsfree/handsfree_connect";
import { ConnectionRequest } from "infinimesh-proto/build/es/handsfree/handsfree_pb";
import balance from "@/components/balance/balance.vue";
import moment from "moment";
Expand Down Expand Up @@ -262,24 +259,8 @@ export default {
{
name: "support_telegram",
icon: "telegram",
onClickFuncion: async () => {
const { token } = this.$store.state.nocloud.auth;
const { transport } = this.$store.state.nocloud.chats;
const handsfree = createPromiseClient(HandsfreeService, transport);
try {
const stream = handsfree.connect(new ConnectionRequest({ appId: token }));
for await (const event of stream) {
console.log(event);
}
} catch (error) {
this.$notification.error({
message: this.$t(error.response?.data?.message ?? error.message ?? error)
});
}
// window.open(`https://t.me/nocloud_telegram_bot?start=${token}`, '_blank');
onClickFuncion: () => {
this.$router.push({ name: 'handsfree', query: { code: '666666' } });
}
},
{
Expand Down
23 changes: 18 additions & 5 deletions src/components/appMain/newPaaS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,20 @@
</a-row>
</transition-group>

<transition name="networkApear">
<a-row
type="flex"
justify="space-between"
v-if="product.installationFee"
:style="{ 'font-size': '1.1rem' }"
>
<a-col> {{ $t('installation') | capitalize }}: </a-col>
<a-col>
{{ +(product.installationFee * currency.rate).toFixed(2) }} {{ currency.code }}
</a-col>
</a-row>
</transition>

<a-row
type="flex"
justify="space-between"
Expand Down Expand Up @@ -679,9 +693,9 @@ export default {
this.showcases.forEach((showcase) => {
showcase.locations?.forEach((location) => {
const sp = this.getSP.find(({ locations, type }) =>
locations.find(({ id, type: locationType }) =>
location.id.includes(id) && locationType.includes(type)
const sp = this.getSP.find(({ locations }) =>
locations.find(({ id, type }) =>
location.id.includes(id) && location.type.includes(type)
)
);
Expand Down Expand Up @@ -750,8 +764,7 @@ export default {
});
return this.getPlans.filter(({ uuid, type }) =>
((locationItem.type) ? locationItem.type === type : true) &&
plans.includes(uuid)
locationItem.type === type && plans.includes(uuid)
);
},
//UNKNOWN and STATIC
Expand Down
Loading

0 comments on commit 9c3d24d

Please sign in to comment.