PageSourceSearch

https://sistema.thefiber.com.br/central_assinante_web/controller/speed_test/speed_test.js

js thefiber.com.br collected 2026-09-24 14:09:57 UTC 4,706 bytes, 126 lines download raw bytes

1buscarSpeedTestHTML();
2
3var funcoes_speedtest = {
4    iniciar(speed_iniciado) {
5        if (speed_iniciado === false) {
6            this.speed_iniciado = true;
7            var element = document.getElementById('speed-test-content');
8            router.history.current.matched[0].instances.default.pingResult = null;
9            router.history.current.matched[0].instances.default.downloadResult = null;
10            router.history.current.matched[0].instances.default.uploadResult = null;
11
12            var speed = new SpeedTest(element, this.SpeedTestServer, this.PingServer, funcoes_speedtest.setPingMS, funcoes_speedtest.setDownloadMBPS, funcoes_speedtest.setUploadMBPS);
13            speed.speedTestInit();
14            speed.execPing();
15        }
16    },
17    setPingMS(res) {
18        try {
19            router.history.current.matched[0].instances.default.pingResult = res.ping.time;
20            res.speed.execDownload();
21        } catch (e) {
22            throw e;
23        }
24    },
25    setDownloadMBPS(speed) {
26        try {
27            router.history.current.matched[0].instances.default.downloadResult = speed.downloadMBPS;
28            speed.execUpload(1, 0);
29        } catch (e) {
30            throw e;
31        }
32    },
33    setUploadMBPS(speed) {
34        try {
35            router.history.current.matched[0].instances.default.uploadResult = speed.uploadMBPS;
36
37            let dadosSpeedTest = {
38                ping: router.history.current.matched[0].instances.default.pingResult,
39                download: router.history.current.matched[0].instances.default.downloadResult,
40                upload: router.history.current.matched[0].instances.default.uploadResult,
41                ip_user: router.history.current.matched[0].instances.default.IP,
42                ping_server: router.history.current.matched[0].instances.default.PingServer,
43            };
44            speed.insertResult(dadosSpeedTest);
45
46            setTimeout(function () {
47                router.history.current.matched[0].instances.default.speed_iniciado = false;
48                speed.rmSpeedTest();
49            }, 3000);
50        } catch (e) {
51            throw e;
52        }
53    },
54    showSpeed() {
55        router.history.current.matched[0].instances.default.SpeedTestDicas = false;
56        if (router.history.current.matched[0].instances.default.iframe) {
57            window.addEventListener('message', handleMessage, false);
58
59            function handleMessage(e) {
60                let dadosSpeedTest = e.data;
61                dadosSpeedTest.ip_user = router.history.current.matched[0].instances.default.IP;
62                dadosSpeedTest.ping_server = router.history.current.matched[0].instances.default.PingServer;
63
64                funcoes_speedtest.insertResult(dadosSpeedTest);
65
66                setTimeout(function () {
67                    router.history.current.matched[0].instances.default.speed_iniciado = false;
68                }, 3000);
69            }
70        }
71    },
72    insertResult(dadosSpeedTest) {
73        var data = {
74            ACTION: 'inserirDadosSpeedTest',
75            dadosSpeedTest: dadosSpeedTest
76        };
77        $.get(__SERVER__ + "/model/speed_test/speed_test.php", data);
78
79    }
80};
81
82function buscarSpeedTestHTML() {
83    try {
84        $.ajax({
85            url: __SERVER__ + "/view/speed_test/speed_test.vue",
86            type: "GET",
87            data: "",
88            dataType: 'html'
89        }).done(function (resposta) {
90            __ROTAS__.push({
91                path: '/central_assinante_web/speed_test',
92                name: 'speed_test',
93                component: {
94                    template: resposta,
95                    data() {
96                        return {
97                            speed_iniciado: false,
98                            loading: true,
99                            SpeedTest:false,
100                            SpeedTestDicas: true,
101                            iframe:false,
102                            pingResult: null,
103                            downloadResult: null,
104                            uploadResult: null,
105                            IP: null,
106                            ServerName: '...',
107                            PingServer:'',
108                            SpeedTestServer:''
109                        };
110                    },
111                    methods: funcoes_speedtest,
112                    mounted() {
113                        Vue.component(vueDirectiveTooltip, {
114                            template: '#tooltipTeste'
115                        });
116                    }
117                }
118            });
119
120            PAGE_SPEEDTEST = true;
121            verificaPages();
122        });
123    } catch (e) {
124        console.log("Error Message -> " + e);
125    }
126}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.