Skip to content

Commit

Permalink
updated vue to support combined view
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteinberg1 committed May 23, 2020
1 parent d39239c commit 433627d
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client/dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/home/phone.ico><title>VOIP Phone Info</title><link href=/home/css/chunk-vendors.2da8ba22.css rel=preload as=style><link href=/home/js/app.bc0484fe.js rel=preload as=script><link href=/home/js/chunk-vendors.005690c0.js rel=preload as=script><link href=/home/css/chunk-vendors.2da8ba22.css rel=stylesheet></head><body><noscript><strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/home/js/chunk-vendors.005690c0.js></script><script src=/home/js/app.bc0484fe.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/home/phone.ico><title>VOIP Phone Info</title><link href=/home/css/chunk-vendors.2da8ba22.css rel=preload as=style><link href=/home/js/app.8a0493b3.js rel=preload as=script><link href=/home/js/chunk-vendors.005690c0.js rel=preload as=script><link href=/home/css/chunk-vendors.2da8ba22.css rel=stylesheet></head><body><noscript><strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/home/js/chunk-vendors.005690c0.js></script><script src=/home/js/app.8a0493b3.js></script></body></html>
2 changes: 2 additions & 0 deletions client/dist/js/app.8a0493b3.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/dist/js/app.8a0493b3.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions client/dist/js/app.bc0484fe.js

This file was deleted.

1 change: 0 additions & 1 deletion client/dist/js/app.bc0484fe.js.map

This file was deleted.

4 changes: 3 additions & 1 deletion client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import IdleTimeout from '@/components/Idle_Timeout.vue'
import Phone_Info from '@/components/Phone_Info.vue'
import Phone_Scraper from '@/components/Phone_Scraper.vue'
import Phone_Combined from '@/components/Phone_Combined.vue'
import Settings_Management from '@/components/Settings_Management.vue'
import Job_Status from '@/components/Job_Status.vue'
Expand All @@ -43,7 +44,7 @@ export default {
name: 'App',
data () {
return {
MenuTabs: ["Phone Info", "Phone Scraper", "Settings Management","Job Status"],
MenuTabs: ["Phone Info", "Phone Scraper", "Phone Combined", "Settings Management", "Job Status"],
NavSelection: "",
}
},
Expand All @@ -53,6 +54,7 @@ export default {
MainNavbar,
Phone_Info,
Phone_Scraper,
Phone_Combined,
Settings_Management,
Job_Status,
IdleTimeout
Expand Down
182 changes: 182 additions & 0 deletions client/src/components/Phone_Combined.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<template>
<div>
<div v-if="loadingData">
<b-row align-h="center">
<b-spinner label="Loading..."></b-spinner>
</b-row>
</div>
<div v-else>
<b-row align-h="center">
<div v-if="rowData.length > 0" style="height: 100% display: flex; flex-direction: row overflow: hidden; flex-grow: 1">
<hot-table ref="hotTableComponent" :settings="hotSettings" :data="rowData"></hot-table>
</div>
<div v-else >
<p>There is no data in the database. Please run a manual sync from the Job Status tab.</p>
</div>
<hr>
</b-row>
<b-row align-h="center">
<b-button @click="exportToCsv">Download as CSV</b-button>
<p> </p>
<b-button @click="refreshGrid">Refresh</b-button>
</b-row>
</div>
</div>
</template>

<script>
import { HotTable } from '@handsontable/vue';
export default {
name: 'Phone_Combined',
data() {
return {
hotSettings: {
licenseKey: 'non-commercial-and-evaluation',
autoRowSize: false,
height: 600,
colHeaders: true,
autoColumnSize: true,
manualColumnResize: true,
manualColumnMove: true,
fixedColumnsLeft: 1,
manualColumnFreeze: true,
filters: true,
columnSorting: true,
dropdownMenu: ['filter_by_condition'],
contextMenu: ['alignment', 'hidden_columns_hide', 'hidden_columns_show'],
hiddenColumns: {
indicators: true
},
nestedHeaders: [
[
"",
{label: 'CUCM API', colspan: 13},
{label: 'Phone Scraper', colspan: 40}
],
[
'Name', 'Description', 'Device Pool', 'Device CSS', 'Model', 'First Seen', 'Last Seen', 'Reg Time',
'IPv4', 'Firmware', 'Cluster', 'Protocol', 'EM Profile', 'EM Login Time',
'Serial', 'Firmware', 'DN', 'Model', 'kem1', 'kem2', 'IP Addr', 'Subnet', 'Gateway', 'DHCP', 'DHCP Server', 'Domain', 'DNS1',
'DNS2', 'Alt TFTP', 'TFTP 1', 'TFTP 2', 'op_vlan', 'admin_vlan', 'CDP Host', 'CDP IP', 'CDP Port', 'LLDP Port', 'LLDP Port', 'LLDP Port', 'CUCM 1',
'CUCM 2', 'CUCM 3', 'CUCM 4', 'CUCM 5', 'Info URL', 'Dir URL', 'SVC URL', 'IDLR URL', 'Info URL Time', 'Proxy URL', 'Auth URL', 'TVS', 'ITL',
'Last Scraped'
]
],
columns: [
{data: "dname", readOnly: true},
{data: "descr", readOnly: true},
{data: "dpool", readOnly: true},
{data: "dcss", readOnly: true},
{data: "model", readOnly: true},
{data: "fdate", readOnly: true},
{data: "ldate", readOnly: true},
{data: "regstamp", readOnly: true},
{data: "ipv4", readOnly: true},
{data: "fw", readOnly: true},
{data: "cluster", readOnly: true},
{data: "prot", readOnly: true},
{data: "em_profile", readOnly: true},
{data: "em_time", readOnly: true},
{data: "sn", readOnly: true},
{data: "firmware", readOnly: true},
{data: "dn", readOnly: true},
{data: "model", readOnly: true},
{data: "kem1", readOnly: true},
{data: "kem2", readOnly: true},
{data: "ip_address", readOnly: true},
{data: "subnetmask", readOnly: true},
{data: "gateway", readOnly: true},
{data: "dhcp", readOnly: true},
{data: "dhcp_server", readOnly: true},
{data: "domain_name", readOnly: true},
{data: "dns1", readOnly: true},
{data: "dns2", readOnly: true},
{data: "alt_tftp", readOnly: true},
{data: "tftp1", readOnly: true},
{data: "tftp2", readOnly: true},
{data: "op_vlan", readOnly: true},
{data: "admin_vlan", readOnly: true},
{data: "CDP_Neighbor_ID", readOnly: true},
{data: "CDP_Neighbor_IP", readOnly: true},
{data: "CDP_Neighbor_Port", readOnly: true},
{data: "LLDP_Neighbor_ID", readOnly: true},
{data: "LLDP_Neighbor_IP", readOnly: true},
{data: "LLDP_Neighbor_Port", readOnly: true},
{data: "cucm1", readOnly: true},
{data: "cucm2", readOnly: true},
{data: "cucm3", readOnly: true},
{data: "cucm4", readOnly: true},
{data: "cucm5", readOnly: true},
{data: "info_url", readOnly: true},
{data: "dir_url", readOnly: true},
{data: "svc_url", readOnly: true},
{data: "idle_url", readOnly: true},
{data: "info_url_time", readOnly: true},
{data: "proxy_url", readOnly: true},
{data: "auth_url", readOnly: true},
{data: "tvs", readOnly: true},
{data: "ITL", readOnly: true},
{data: "last_scraped", readOnly: true},
],
},
rowData: [],
loadingData: false
}
},
components: {
HotTable
},
beforeMount() {
},
mounted() {
this.loadData();
},
methods: {
reSizeColumns(params) {
console.log(params)
},
exportToCsv() {
console.log("exporting to csv")
var exportPlugin = this.$refs.hotTableComponent.hotInstance.getPlugin('exportFile');
exportPlugin.downloadFile('csv', {
columnHeaders: true,
columnDelimiter: ',',
fileExtension: 'csv',
filename: 'Phone-Scraper-CSV-file_[YYYY]-[MM]-[DD]',
mimeType: 'text/csv',
});
},
loadData() {
var vm = this
vm.loadingData = true
this.$http({
method: 'get',
url: '/phonedata/allschema',
timeout: 120000
})
.then(function (response) {
vm.rowData = response.data
vm.loadingData = false
})
.catch(function (error) {
console.log(error);
vm.loadingData = false
})
},
refreshGrid() {
this.loadData();
}
}
}
</script>

<style src="../../node_modules/handsontable/dist/handsontable.full.css"></style>
6 changes: 5 additions & 1 deletion client/src/components/Phone_Info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export default {
fixedColumnsLeft: 1,
manualColumnFreeze: true,
filters: true,
dropdownMenu: ['remove_col', 'filter_by_condition', 'filter_action_bar'],
columnSorting: true,
dropdownMenu: ['filter_by_condition'],
contextMenu: ['alignment', 'hidden_columns_hide', 'hidden_columns_show'],
hiddenColumns: {
indicators: true
},
colHeaders: ['Name', 'Pool', 'CSS', 'Description', 'Firmware', 'IPv4', 'Protocol', 'Model',
'First Seen', 'Last Seen', 'Regstamp', 'Cluster', 'EM Profile', 'EM Time'
],
Expand Down
8 changes: 6 additions & 2 deletions client/src/components/Phone_Scraper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export default {
fixedColumnsLeft: 1,
manualColumnFreeze: true,
filters: true,
dropdownMenu: ['remove_col', 'filter_by_condition', 'filter_action_bar'],
columnSorting: true,
dropdownMenu: ['filter_by_condition'],
contextMenu: ['alignment', 'hidden_columns_hide', 'hidden_columns_show'],
hiddenColumns: {
indicators: true
},
colHeaders: ['Name', 'Model', 'IPv4', 'Serial', 'Firmware', 'DN', 'kem1', 'kem2', 'Subnet', 'Gateway', 'DHCP', 'DHCP Server', 'Domain', 'DNS1',
'DNS2', 'Alt TFTP', 'TFTP 1', 'TFTP 2', 'op_vlan', 'admin_vlan', 'CDP Host', 'CDP IP', 'CDP Port', 'LLDP Port', 'LLDP Port', 'LLDP Port', 'CUCM 1',
'CUCM 2', 'CUCM 3', 'CUCM 4', 'CUCM 5', 'Info URL', 'Dir URL', 'SVC URL', 'IDLR URL', 'Info URL Time', 'Proxy URL', 'Auth URL', 'TVS', 'ITL',
Expand Down Expand Up @@ -129,7 +133,7 @@ export default {
this.$http({
method: 'get',
url: '/phonedata/scraper',
timeout: 15000
timeout: 60000
})
.then(function (response) {
Expand Down

0 comments on commit 433627d

Please sign in to comment.