CoolFace
Apppublic

kaan1233/bistelligence-api

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
fix_app.cpython-313.pyc70 linesDownload Raw Back to __pycache__
1�

2G�?j	��@�\"SSSS9r\R5rSSS5 SrSr\"\5H urr\RS5(dM\r O \/\\S-r3\"SSSS9r\R\45 SSS5 g!,(df   Nj=f!,(df   g=f)	zfrontend/app.js�rzutf-8)�encodingNu�// ==================== Firebase Setup ====================5// TODO: Kendi Firebase proje bilgilerinizi buraya girin!6const firebaseConfig = {7    apiKey: "YOUR_API_KEY",8    authDomain: "YOUR_PROJECT_ID.firebaseapp.com",9    projectId: "YOUR_PROJECT_ID",10    storageBucket: "YOUR_PROJECT_ID.appspot.com",11    messagingSenderId: "YOUR_MESSAGING_SENDER_ID",12    appId: "YOUR_APP_ID"13};14 15let app;16let auth;17if (firebaseConfig.apiKey !== "YOUR_API_KEY") {18    app = firebase.initializeApp(firebaseConfig);19    auth = firebase.auth();20}21 22// ==================== Navigation ====================23const navLinks = document.querySelectorAll('.nav-links li');24const pages = document.querySelectorAll('.page');25 26navLinks.forEach(link => {27    link.addEventListener('click', () => {28        navLinks.forEach(l => l.classList.remove('active'));29        link.classList.add('active');30        const targetPage = link.getAttribute('data-page');31        pages.forEach(p => p.classList.remove('active'));32        document.getElementById('page-' + targetPage).classList.add('active');33    });34});35 36// ==================== API ====================37const API_BASE = 'http://127.0.0.1:8000/api';38 39window.showAlert = function(message, type = 'error') {40    alert(message);41};42 43async function fetchAPI(endpoint, options = {}) {44    try {45        if (!options.headers) options.headers = {};46        if (auth && auth.currentUser) {47            const token = await auth.currentUser.getIdToken();48            options.headers['Authorization'] = `Bearer ${token}`;49        }50        const res = await fetch(API_BASE + endpoint, options);51        if (!res.ok) throw new Error('API Hatası');52        return await res.json();53    } catch (e) {54        console.error(e);55        return null;56    }57}58 59// ==================== Formatters ====================60const formatTL = (num) => new Intl.NumberFormat('tr-TR', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(num) + ' TL';61const formatCurrency = formatTL;62�zconst formatPct =�w)�open�f�	readlines�lines�new_top�idx�	enumerate�i�l�63startswith�final_lines�64writelines���65fix_app.py�<module>rs���	�66�S�7�3�q�
�K�K�M�E�4�:��x���e��D�A�q��|�|�'�(�(���
�
�67�i�%���+�%��	�68�S�7�3�q��L�L���4�3�M4�3��L4�3�s�A>�#B�>69B�70B