You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
417 lines
15 KiB
417 lines
15 KiB
14/ raha entree eo amlay username dia makeo am password raha vide ilay password sinon se connecter raha tsy vide ilay password
|
|
1/ Mot Login => Se connecter
|
|
2/ Mila ahena ny taille anlay titre rehetra
|
|
3/ Ajout etudiant miala ilay ANNULER
|
|
4/ Asina boutton retour rehefa manao ajout am page rehetra (Voir capture)
|
|
5/ Mampiasa librairie fileinput amlay upload photos rehetra
|
|
6/ Gestion de note:
|
|
=> Choix de la classe
|
|
=> Choix de l'eleve
|
|
=> maka ny matiere rehetra par classe (mitovy amlay actuelle)
|
|
7/ Asiana gestion de classe
|
|
8/ Asiana gestion de note (Liste eleve par classe atao tableau)
|
|
9/ lay amsary profil etsy ambany ny contenue atao modification de mot de passe ny contenue
|
|
10/ Dashboard
|
|
=> Nombre d'eleve
|
|
=> Nombre de classe
|
|
11/ Ny tena important amzay ny generation de code QR par creation d'eleve
|
|
12/ Generation de carte d'etudiant
|
|
|
|
13/ dia asiana page a propos koa ilay logiciel
|
|
|
|
Pour moi : 6, 7, 8, 9, 10, 11, 12
|
|
reto avy ny mila anlay API.
|
|
1/ Mise a jour du logiciel
|
|
2/ synchronisation des donnee.
|
|
- mpianatra (vita)
|
|
- classe
|
|
- matiere
|
|
- note
|
|
|
|
. ajout etudiant, am le anarana refa mvoka carte lasa undefined
|
|
ASINA MESSAGE DE SUCCES SY EREUR NY AJOUT NOTE
|
|
|
|
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
|
|
|
|
Yes, you can use `electron-updater` with other providers besides GitHub for managing app updates. Some popular alternatives include using a custom server or a file-based hosting solution like AWS S3, DigitalOcean, or even your own web server. Here’s how you can set it up.
|
|
|
|
### Using a Custom Server for Updates
|
|
|
|
#### 1. **Host Update Files on a Web Server**
|
|
You can host the update files (`.exe`, `.zip`, or `.dmg` for macOS) on your own server. This server only needs to serve the files—no GitHub release process required.
|
|
|
|
#### Steps to set up:
|
|
|
|
1. **Configure `package.json` for a custom provider:**
|
|
Update your `package.json` to point to the URL where the updates will be hosted. Here's an example configuration for using a custom server:
|
|
|
|
```json
|
|
{
|
|
"name": "your-app",
|
|
"version": "1.0.0",
|
|
"build": {
|
|
"publish": {
|
|
"provider": "generic",
|
|
"url": "https://yourserver.com/updates"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
- The `provider` is set to `"generic"`.
|
|
- The `url` is the base URL where your update files will be located.
|
|
|
|
2. **Upload your release files to the server:**
|
|
After building your Electron app with a tool like `electron-builder`, you'll get your `*.exe`, `*.nupkg`, or other update files (for macOS, Linux). Upload these to your server under the `updates` folder specified in the URL.
|
|
|
|
Example file structure on your server:
|
|
```
|
|
https://yourserver.com/updates/
|
|
├── latest.yml
|
|
├── your-app-1.0.0.exe
|
|
├── your-app-1.0.0.nupkg
|
|
```
|
|
|
|
The `latest.yml` file is automatically generated by `electron-builder` and contains metadata about the latest version. The updater uses this file to determine if a new update is available.
|
|
|
|
3. **Trigger Updates in Your Electron App:**
|
|
In your Electron app, set up the `autoUpdater` to check for updates and download them from your custom server. The logic will remain the same as when using GitHub releases.
|
|
|
|
```js
|
|
const { autoUpdater } = require('electron-updater');
|
|
const log = require('electron-log');
|
|
|
|
autoUpdater.logger = log;
|
|
autoUpdater.logger.transports.file.level = 'info';
|
|
|
|
autoUpdater.on('update-available', (info) => {
|
|
log.info('Update available:', info);
|
|
});
|
|
|
|
autoUpdater.on('update-downloaded', (info) => {
|
|
log.info('Update downloaded:', info);
|
|
const dialogOpts = {
|
|
type: 'info',
|
|
buttons: ['Restart', 'Later'],
|
|
title: 'Update Available',
|
|
message: 'A new version has been downloaded. Restart the application to apply the update.',
|
|
detail: `Version ${info.version} is ready to install.`,
|
|
};
|
|
|
|
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
|
if (returnValue.response === 0) {
|
|
autoUpdater.quitAndInstall();
|
|
}
|
|
});
|
|
});
|
|
|
|
autoUpdater.checkForUpdatesAndNotify();
|
|
```
|
|
|
|
4. **Build and Deploy:**
|
|
When you build your app using `electron-builder`, it will create the necessary update files (`*.exe`, `.zip`, `.nupkg`, `latest.yml`, etc.). Upload these to the server so that the app can detect new versions.
|
|
|
|
#### 2. **Use AWS S3 as a File Host**
|
|
You can use Amazon S3 to host the update files:
|
|
|
|
1. **Configure `package.json` for AWS S3:**
|
|
```json
|
|
{
|
|
"name": "your-app",
|
|
"version": "1.0.0",
|
|
"build": {
|
|
"publish": {
|
|
"provider": "s3",
|
|
"bucket": "your-bucket-name",
|
|
"region": "us-west-1"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
2. **Set Up AWS Credentials:**
|
|
You'll need to set AWS credentials in your environment to allow `electron-builder` to upload files to S3.
|
|
|
|
```bash
|
|
export AWS_ACCESS_KEY_ID=your-access-key
|
|
export AWS_SECRET_ACCESS_KEY=your-secret-key
|
|
```
|
|
|
|
3. **Build and Upload:**
|
|
Build your app using `electron-builder`, and it will upload the necessary update files to your specified S3 bucket automatically.
|
|
|
|
#### 3. **Use DigitalOcean Spaces (or similar)**
|
|
DigitalOcean Spaces works similarly to S3:
|
|
|
|
1. **Configure `package.json` for DigitalOcean Spaces:**
|
|
```json
|
|
{
|
|
"name": "your-app",
|
|
"version": "1.0.0",
|
|
"build": {
|
|
"publish": {
|
|
"provider": "s3",
|
|
"bucket": "your-space-name",
|
|
"endpoint": "https://nyc3.digitaloceanspaces.com",
|
|
"region": "nyc3"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
2. **Build and Upload:**
|
|
Use `electron-builder` to build and upload your files to the DigitalOcean Space.
|
|
|
|
### Summary of Providers You Can Use with `electron-updater`:
|
|
- **Generic:** Host updates on any web server (requires a URL to the update files).
|
|
- **S3:** Amazon S3 bucket hosting.
|
|
- **Spaces:** DigitalOcean Spaces hosting.
|
|
- **GitLab:** Use GitLab releases to host updates.
|
|
- **Bintray:** For those who have a Bintray account (soon to be deprecated).
|
|
- **Custom Server:** Build your own server API to manage releases.
|
|
|
|
Each of these options allows you to bypass GitHub and have full control over where you host your update files.
|
|
|
|
Let me know if you'd like help setting up one of these methods!
|
|
|
|
To handle both XLSX and CSV file uploads in a React component, read the first 5 rows of data, and display it in a table format, you can use the following approach. This will combine the functionalities for both file types using the `xlsx` and `papaparse` libraries.
|
|
|
|
### Step-by-Step Implementation
|
|
|
|
1. **Install Required Libraries**:
|
|
Make sure to install `xlsx` and `papaparse` in your project if you haven't already:
|
|
|
|
```bash
|
|
npm install xlsx papaparse
|
|
```
|
|
|
|
2. **Create the React Component**:
|
|
Here’s a complete example of a React component that handles both XLSX and CSV files:
|
|
|
|
```javascript
|
|
import React, { useState } from 'react';
|
|
import XLSX from 'xlsx';
|
|
import Papa from 'papaparse';
|
|
|
|
const FileUploader = () => {
|
|
const [data, setData] = useState([]);
|
|
const [error, setError] = useState('');
|
|
|
|
const handleFileChange = (event) => {
|
|
const file = event.target.files[0];
|
|
if (!file) {
|
|
setError('No file selected');
|
|
return;
|
|
}
|
|
|
|
const fileExtension = file.name.split('.').pop().toLowerCase();
|
|
|
|
if (fileExtension === 'xlsx') {
|
|
// Read XLSX file
|
|
const reader = new FileReader();
|
|
reader.onload = (e) => {
|
|
const data = new Uint8Array(e.target.result);
|
|
const workbook = XLSX.read(data, { type: 'array' });
|
|
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
const rows = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
|
|
setData(rows.slice(0, 5)); // Get the first 5 rows
|
|
};
|
|
reader.readAsArrayBuffer(file);
|
|
} else if (fileExtension === 'csv') {
|
|
// Read CSV file
|
|
const reader = new FileReader();
|
|
reader.onload = (e) => {
|
|
const fileContent = e.target.result;
|
|
Papa.parse(fileContent, {
|
|
complete: (results) => {
|
|
setData(results.data.slice(0, 5)); // Get the first 5 rows
|
|
},
|
|
header: false, // Change to true if your CSV has headers
|
|
});
|
|
};
|
|
reader.readAsText(file);
|
|
} else {
|
|
setError('Unsupported file format. Please upload .xlsx or .csv file.');
|
|
}
|
|
};
|
|
|
|
return (
|
|
<div>
|
|
<input type="file" onChange={handleFileChange} accept=".xlsx,.csv" />
|
|
{error && <div style={{ color: 'red' }}>{error}</div>}
|
|
<h3>First 5 Rows:</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Nom</th>
|
|
<th>Prenom</th>
|
|
<th>Photos</th>
|
|
<th>Date de Naissances</th>
|
|
<th>Niveau</th>
|
|
<th>Année Univesitaire</th>
|
|
<th>Num Inscription</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{data.map((row, index) => (
|
|
<tr key={index}>
|
|
{row.map((cell, cellIndex) => (
|
|
<td key={cellIndex}>{cell}</td>
|
|
))}
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default FileUploader;
|
|
```
|
|
|
|
### Explanation of the Code
|
|
|
|
1. **File Input**: The `<input type="file" />` allows users to upload either an XLSX or CSV file.
|
|
|
|
2. **Handling File Change**:
|
|
- When a file is selected, the `handleFileChange` function is triggered.
|
|
- It checks the file extension to determine whether it's an `.xlsx` or `.csv` file.
|
|
|
|
3. **Reading XLSX Files**:
|
|
- If the file is an XLSX file, it uses `FileReader` to read the file and `xlsx` to parse it.
|
|
- It retrieves the first sheet and converts it into a JSON format. The first 5 rows are stored in the state.
|
|
|
|
4. **Reading CSV Files**:
|
|
- For CSV files, it uses `FileReader` and `papaparse` to parse the CSV content.
|
|
- It stores the first 5 rows in the state.
|
|
|
|
5. **Displaying Data**:
|
|
- The data is displayed in a simple HTML table format. The table structure includes headers for clarity.
|
|
|
|
### Step 3: Use the Component in Your App
|
|
|
|
You can use the `FileUploader` component in your main application component:
|
|
|
|
```javascript
|
|
import React from 'react';
|
|
import FileUploader from './FileUploader';
|
|
|
|
const App = () => {
|
|
return (
|
|
<div>
|
|
<h1>File Upload Example</h1>
|
|
<FileUploader />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default App;
|
|
```
|
|
|
|
### Important Notes
|
|
- **Header Handling**: If your CSV files have headers and you want to include them, set `header: true` in the `Papa.parse` options. Adjust the table rendering accordingly.
|
|
- **Data Format**: Make sure the data format in the uploaded files aligns with your application's needs (e.g., the number of columns).
|
|
- **Error Handling**: The component currently displays a simple error message if the file format is unsupported. You might want to expand this with more detailed error handling and user feedback.
|
|
|
|
This implementation provides a basic but functional way to read and display data from both XLSX and CSV files in a React application. You can further enhance it based on your specific requirements, such as adding validation, processing the data further, or integrating it with your database.
|
|
|
|
miala ny license,
|
|
description : logiciel de gestion d'universiter
|
|
email : director@c4m.mg
|
|
tel : 0348415301
|
|
SELECT SOME AN ILAY NOTE AMZAY REFA SUPERIEUR A ZERO IZY VAO ATAO EFA MISY
|
|
|
|
rehefa manao ajout ohatra hoe etudiant liste deroulant ilay niveau
|
|
puis modification lasa champ de texte dia zay mila respecter-na
|
|
|
|
----------------------------------------------------------------------------------------------------------------
|
|
parametre systeme de note, de passan sa redoublon
|
|
algorithe de hoe redoublonsa passans selon an le noteliste de note sty aseo directe fa atao genre dsongade mampiditra nore fa relever de notre ampiditra eo de msemlectioner niveau su eleve,
|
|
note generale ana classe retra amzay tsy manasarojavatra, zany hoe ita eo liste ana classe retra am anneé scolaire iton de mipoitra ny moyenne de classe, de ita ao daoly mpianatra am classe io sy ny note any fa trsy afaka atao nininona,
|
|
afaka admis automatique koa izy aveo
|
|
asina archive daoly ilay note aveo
|
|
asina statut des eleve koa hoe passants sa redoublon sa renvoyer
|
|
asina filliere koa hoe iniona ny filliere any anavahana anzy
|
|
|
|
|
|
______________________________________________________________________________________________________________________
|
|
import { PDFDocument } from "pdf-lib";
|
|
import { saveAs } from "file-saver";
|
|
import pdf from '../../assets/carte_etudiant.pdf';
|
|
|
|
const PDFEditor = async (data) => {
|
|
// Load the existing PDF file
|
|
const existingPdfBytes = await fetch(pdf).then((res) =>
|
|
res.arrayBuffer()
|
|
);
|
|
|
|
// Load the PDF document
|
|
const pdfDoc = await PDFDocument.load(existingPdfBytes);
|
|
|
|
// Get the form in the PDF
|
|
const form = pdfDoc.getForm();
|
|
|
|
// Set text fields
|
|
form.getTextField("f1").setText(data.f1);
|
|
form.getTextField("f2").setText(data.f2);
|
|
form.getTextField("f3").setText(data.f3);
|
|
form.getTextField("f4").setText(data.f4);
|
|
form.getTextField("f5").setText(data.f5);
|
|
|
|
// Add image to replace form field 'f8' (assuming the image is a base64-encoded string)
|
|
// let base64Image = data.f8; // Base64-encoded image string
|
|
|
|
// const pages = pdfDoc.getPages();
|
|
// // Loop through each page to find the text
|
|
// pages.forEach((page) => {
|
|
// const textContent = page.getTextContent(); // PDF-lib doesn't directly support text search, so you may need to implement your own extraction
|
|
|
|
// // For this example, we're assuming you already have the coordinates of the text (e.g., F8)
|
|
// const textCoords = getTextCoordinates(textContent, "f8");
|
|
|
|
// // Now replace the text with an image at the found coordinates
|
|
// if (textCoords) {
|
|
// const { x, y } = textCoords;
|
|
|
|
// // Add the image at the position
|
|
// page.drawImage(base64Image, {
|
|
// x,
|
|
// y,
|
|
// width: image.width,
|
|
// height: image.height,
|
|
// });
|
|
// }
|
|
// });
|
|
|
|
// Flatten the form so that the data becomes part of the content
|
|
form.flatten();
|
|
|
|
// Save the modified PDF
|
|
const pdfBytes = await pdfDoc.save();
|
|
|
|
// Trigger download of the PDF
|
|
const blob = new Blob([pdfBytes], { type: "application/pdf" });
|
|
saveAs(blob, "modified_form.pdf");
|
|
};
|
|
|
|
export default PDFEditor;
|
|
const form2 = pdfDoc2.getForm();
|
|
const field = form2.getField("f6");
|
|
if (field) {
|
|
form2.removeField(field);
|
|
}
|
|
|
|
<a id="not-clickable">◕‿‿◕</a>
|
|
<Tooltip anchorSelect="#not-clickable">
|
|
<button>You can't click me :(</button>
|
|
</Tooltip>
|
|
<a id="clickable">◕‿‿◕</a>
|
|
<Tooltip anchorSelect="#clickable" clickable>
|
|
<button>You can click me!</button>
|
|
</Tooltip>
|
|
|
|
-----------------------------------------------------------------------------------------------------------
|
|
relever de note
|
|
rectification des vue Notes
|
|
get certificate
|
|
formations
|
|
|