-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
<template> | ||
<div id="main"> | ||
<div | ||
v-if="is_telegram_client && is_telegram_api_updated" | ||
> | ||
<!-- v-if="is_telegram_client && is_telegram_api_updated"--> | ||
<div> | ||
<v-card | ||
class="mx-auto" | ||
max-width="600" | ||
|
@@ -82,12 +81,17 @@ | |
<GeoCard | ||
v-if="enriched_values[akey]['type'] === 'geo'" | ||
:coordinate="enriched_values[akey]['info']" | ||
@remove-key="removeKey(key)" | ||
@remove-key="removeKey(akey)" | ||
/> | ||
<UrlCard | ||
v-if="enriched_values[akey]['type'] === 'url'" | ||
:url="enriched_values[akey]['info']" | ||
@remove-key="removeKey(key)" | ||
@remove-key="removeKey(akey)" | ||
/> | ||
<TextCard | ||
v-if="enriched_values[akey]['type'] === 'text' || enriched_values[akey]['type'] === 'wifi' || enriched_values[akey]['type'] === 'vcard'" | ||
:text="enriched_values[akey]['info']" | ||
@remove-key="removeKey(akey)" | ||
/> | ||
</v-expansion-panel-text> | ||
</v-expansion-panel> | ||
|
@@ -185,11 +189,13 @@ | |
import { prepareUrl, prepareCoordinate } from './helpers' | ||
import UrlCard from "./components/UrlCard.vue"; | ||
import GeoCard from "./components/GeoCard.vue"; | ||
import TextCard from "./components/TextCard.vue"; | ||
export default { | ||
components: { | ||
UrlCard, | ||
GeoCard | ||
GeoCard, | ||
TextCard, | ||
}, | ||
data() { | ||
return { | ||
|
@@ -198,8 +204,10 @@ export default { | |
last_code: null, | ||
show_history: true, | ||
// Cloud storage | ||
cloud_storage_keys: [], | ||
cloud_storage_values: {}, | ||
// cloud_storage_keys: [], | ||
// cloud_storage_values: {}, | ||
cloud_storage_keys: [ "1696492897779", "1696492893878", "1696492890069", "1696492865770" ], | ||
cloud_storage_values: {"1696492897779": "geo:46.227638,2.213749", "1696492893878": "WIFI:S:mywifi;T:WPA;P:12345678;;", "1696492890069": "BEGIN:VCARD\nVERSION:2.1\nN:Doe;John\nFN:John Doe\nORG:Telegram\nTITLE:Dr\nTEL:+20345968753\nEMAIL:[email protected]\nADR:;;2 ABC street;London;London;16873;uk\nURL:www.telegram.org\nEND:VCARD\n", "1696492865770": "https://telegram.com" }, | ||
enriched_values: {}, | ||
is_continuous_scan: false, | ||
show_debug: false, | ||
|
@@ -283,11 +291,13 @@ export default { | |
if (code_type == "geo") { | ||
this.enriched_values[key]['info'] = prepareCoordinate(this.cloud_storage_values[key]); | ||
} else if (code_type == "wifi") { | ||
//this.enriched_values[key]['info'] = processWifiCode(this.cloud_storage_values[key]); | ||
this.enriched_values[key]['info'] = this.cloud_storage_values[key]; | ||
} else if (code_type == "vcard") { | ||
//this.enriched_values[key]['info'] = processVcardCode(this.cloud_storage_values[key]); | ||
this.enriched_values[key]['info'] = this.cloud_storage_values[key]; | ||
} else if (code_type == "url") { | ||
this.enriched_values[key]['info'] = prepareUrl(this.cloud_storage_values[key]); | ||
} else if (code_type == "text") { | ||
this.enriched_values[key]['info'] = this.cloud_storage_values[key]; | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<v-card | ||
class="mx-auto" | ||
max-width="600" | ||
variant="flat" | ||
> | ||
<v-card-item> | ||
<div> | ||
{{ atext }} | ||
</div> | ||
</v-card-item> | ||
<v-card-actions> | ||
<v-spacer /> | ||
<v-btn | ||
color="red" | ||
icon="mdi-delete-outline" | ||
variant="text" | ||
@click="$emit('remove-key')" | ||
/> | ||
</v-card-actions> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from 'vue'; | ||
export default defineComponent({ | ||
name: "TextCard", | ||
props: { | ||
text: { | ||
type: String, // Object is a constructor for objects | ||
required: true, // This is optional, but it makes the prop required | ||
} | ||
}, | ||
emits: [ | ||
'remove-key' | ||
], | ||
data() { | ||
return { | ||
atext: this.text, | ||
}; | ||
}, | ||
created() { | ||
console.log(this.coordinate); | ||
}, | ||
methods: { | ||
openLink(lat, lng) { | ||
this.TWA.openLink('https://maps.google.com/?q=' + lat + ',' + lng); | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
|
||
|
||
<style scoped> | ||
</style> |