@לימוד-בתורת-מרן כתב:
שלום לכל התותחים בפורום!
הרבה פעמים אנחנו רוצים לתת למשתמשים (או לעצמנו) אפשרות להגדיר שלוחת ניתוב למערכת אחרת בצורה פשוטה, בלי להיכנס לאתר הניהול המורכב. ️
בניתי עבורכם קוד HTML מעוצב בסגנון Glassmorphism (זכוכית מודרנית) יוקרתי, שמאפשר להגדיר שלוחה ראשית כניתוב "מספר אישי" בצורה חלקה!
מה הממשק יודע לעשות? 🧐
עיצוב מפואר ורספונסיבי (מתאים גם לנייד).
הגדרה אוטומטית של השלוחה הראשית (/) כסוג routing_yemot.
אימות מול ה-API של ימות המשיח.
פידבק בעברית: במקום לקבל הודעת שגיאה באנגלית או JSON מפחיד, המשתמש מקבל הודעה ברורה: "הוגדר בהצלחה" או "סיסמה שגויה".
איך משתמשים?
מעתיקים את הקוד לפנקס רשימות.
שומרים בשם יצירת מספר אישי.html.
פותחים בדפדפן ונהנים!
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<title>הגדרת מספר אישי</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(45deg, #0f2027, #203a43, #2c5364);
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
color: #fff;
}
.container {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(15px);
padding: 40px;
border-radius: 25px;
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
width: 380px;
border: 1px solid rgba(255, 255, 255, 0.1);
text-align: center;
}
h2 { margin-bottom: 30px; font-weight: 300; letter-spacing: 1px; }
input {
width: 100%;
padding: 14px;
margin: 12px 0;
border: none;
border-radius: 12px;
background: rgba(255, 255, 255, 0.05);
color: #fff;
font-size: 16px;
border: 1px solid rgba(255, 255, 255, 0.2);
transition: 0.3s;
box-sizing: border-box;
}
input:focus {
outline: none;
background: rgba(255, 255, 255, 0.15);
border-color: #00d2ff;
}
button {
width: 100%;
padding: 15px;
margin-top: 25px;
border: none;
border-radius: 12px;
background: linear-gradient(to right, #00d2ff, #3a7bd5);
color: white;
font-size: 18px;
font-weight: bold;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.3s;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0, 210, 255, 0.4);
}
#status {
margin-top: 25px;
font-size: 14px;
font-weight: bold;
min-height: 20px;
}
.success { color: #00ffcc; }
.error { color: #ff6666; }
</style>
</head>
<body>
<div class="container">
<h2>הגדרת מספר אישי</h2>
<input type="text" id="systemNum" placeholder="מספר מערכת">
<input type="password" id="password" placeholder="סיסמת ניהול">
<button onclick="setupRouting()">הגדר על שלוחה ראשית</button>
<div id="status"></div>
</div>
<script>
async function setupRouting() {
const num = document.getElementById('systemNum').value;
const pass = document.getElementById('password').value;
const statusDiv = document.getElementById('status');
if (!num || !pass) {
alert('אנא הזן מספר מערכת וסיסמה');
return;
}
statusDiv.innerText = 'מבצע הגדרה, נא להמתין...';
statusDiv.className = '';
const url = `https://www.call2all.co.il/ym/api/UpdateExtension?token=${num}:${pass}&path=ivr2:/&type=routing_yemot&routing_yemot_number=${num}`;
try {
const response = await fetch(url);
const data = await response.json();
if (data.responseStatus === 'OK') {
statusDiv.className = 'success';
statusDiv.innerText = `הוגדר בהצלחה מספר אישי למערכת ומספר המערכת: ${num}`;
} else {
statusDiv.className = 'error';
// כאן מוגדר המלל בעברית במקרה של שגיאת התחברות (סיסמה שגויה וכד')
statusDiv.innerText = `לא ניתן להגדיר מספר אישי למערכת ${num}: סיסמה או מספר שגויים`;
}
} catch (error) {
statusDiv.className = 'error';
statusDiv.innerText = 'שגיאת תקשורת: ודא שיש חיבור אינטרנט תקין';
}
}
</script>
</body>
</html>
Spoiler
תענהההההההההההההה