这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions frontend/src/locales/ar/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const TRANSLATIONS = {
onboarding: {
home: {
title: "مرحبا في",
getStarted: "بسم الله",
getStarted: "بسم الله",
},
llm: {
title: "إعدادات نموذج التعلم العميق المفضّلة",
description:
"يمكن لـِ إيني ثينك إلْلْمْ العمل مع عدة موفرين لنماذج التعلم العميق لأداء خدمة المحادثات",
"يمكن لـِ إيني ثينك إلْلْمْ العمل مع عدة موفرين لنماذج التعلم العميق لأداء خدمة المحادثات",
},
userSetup: {
title: "إنشاء المستعمِل",
Expand All @@ -18,8 +18,7 @@ const TRANSLATIONS = {
instancePassword: "كلمة مرورالمثيل",
setPassword: "هل تريد إنشاء كلمة مرور ؟",
passwordReq: "يجب أن تحتوي كلمة المرور على ثمانية حروف على الأقل",
passwordWarn:
"من المهم حفظ كلمة المرور هذه لأنه لا يمكن استردادها.",
passwordWarn: "من المهم حفظ كلمة المرور هذه لأنه لا يمكن استردادها.",

adminUsername: "اسم مستعمل حساب المشرف",
adminUsernameReq:
Expand All @@ -33,12 +32,12 @@ const TRANSLATIONS = {
title: "معالجة البيانات والخصوصية",
description:
"نحن ملتزمون بالشفافية والمراقبة عندما يتعلق الأمر ببياناتك الشخصية.",
settingsHint:
"يمكن إعادة ضبط هذه الإعدادات في أي وقت.",
settingsHint: "يمكن إعادة ضبط هذه الإعدادات في أي وقت.",
},
survey: {
title: "مرحباً في إيني ثينك إلْلْمْ",
description: " بما يتناسب مع احتياجاتك ساعدنا إذا أحببت في تصميم إيني ثينك إلْلْمْ",
description:
" بما يتناسب مع احتياجاتك ساعدنا إذا أحببت في تصميم إيني ثينك إلْلْمْ",

email: "ما هو بريدك الالكتروني؟",
useCase: "لماذا ستستخدم إيني ثينك إلْلْمْ؟",
Expand Down Expand Up @@ -167,7 +166,8 @@ const TRANSLATIONS = {
general: {
vector: {
title: "عدد المتجهات",
description: "العدد الإجمالي للمتجهات في قاعدة بيانات المتجهات الخاصة بك.",
description:
"العدد الإجمالي للمتجهات في قاعدة بيانات المتجهات الخاصة بك.",
},
names: {
description: "سيؤدي هذا فقط إلى تغيير اسم العرض لمساحة العمل الخاصة بك.",
Expand All @@ -183,8 +183,7 @@ const TRANSLATIONS = {
},
pfp: {
title: "صورة الملف الشخصي للمساعد",
description:
"تخصيص صورة الملف الشخصي للمساعد لمساحة العمل هذه.",
description: "تخصيص صورة الملف الشخصي للمساعد لمساحة العمل هذه.",
image: "صورة مساحة العمل",
remove: "إزالة صورة مساحة العمل",
},
Expand Down Expand Up @@ -324,8 +323,7 @@ const TRANSLATIONS = {
},
scrape: {
title: "جمع محتوى المواقع الإلكترونية",
description:
"السماح للوكيل بزيارة مواقع الويب وجمع محتواها.",
description: "السماح للوكيل بزيارة مواقع الويب وجمع محتواها.",
},
generate: {
title: "إنشاء المخططات البيانية",
Expand Down Expand Up @@ -388,8 +386,7 @@ const TRANSLATIONS = {
},
icons: {
title: "أيقونات التذييل المخصصة",
description:
"تخصيص أيقونات التذييل المعروضة في أسفل الشريط الجانبي.",
description: "تخصيص أيقونات التذييل المعروضة في أسفل الشريط الجانبي.",
icon: "أيقونة",
link: "رابط",
},
Expand Down Expand Up @@ -425,8 +422,7 @@ const TRANSLATIONS = {
"يمكن أن يؤدي استخدام نموذج الهمس المحلي على الأجهزة ذات ذاكرة الوصول العشوائي أو وحدة المعالجة المركزية المحدودة إلى تعطيل إني ثينك إلْلْم عند معالجة ملفات الوسائط.",
"warn-recommend":
"نوصي بذاكرة وصول عشوائي بسعة 2 جيجابايت على الأقل وتحميل ملفات أقل من 10 ميجا بايت.",
"warn-end":
"سيتم تنزيل النموذج المدمج تلقائيًا عند الاستخدام الأول.",
"warn-end": "سيتم تنزيل النموذج المدمج تلقائيًا عند الاستخدام الأول.",
},

embedding: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/models/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,8 @@ const System = {
return { apiKey: null, error: e.message };
});
},
deleteApiKey: async function () {
return fetch(`${API_BASE}/system/api-key`, {
deleteApiKey: async function (apiKeyId = "") {
return fetch(`${API_BASE}/system/api-key/${apiKeyId}`, {
method: "DELETE",
headers: baseHeaders(),
})
Expand Down
1 change: 1 addition & 0 deletions server/endpoints/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ function adminEndpoints(app) {
async (request, response) => {
try {
const { id } = request.params;
if (!id || isNaN(Number(id))) return response.sendStatus(400).end();
await ApiKey.delete({ id: Number(id) });

await EventLogs.logEvent(
Expand Down
39 changes: 23 additions & 16 deletions server/endpoints/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,24 +925,31 @@ function systemEndpoints(app) {
}
);

app.delete("/system/api-key", [validatedRequest], async (_, response) => {
try {
if (response.locals.multiUserMode) {
return response.sendStatus(401).end();
}
// TODO: This endpoint is replicated in the admin endpoints file.
// and should be consolidated to be a single endpoint with flexible role protection.
app.delete(
"/system/api-key/:id",
[validatedRequest],
async (request, response) => {
try {
if (response.locals.multiUserMode)
return response.sendStatus(401).end();
const { id } = request.params;
if (!id || isNaN(Number(id))) return response.sendStatus(400).end();

await ApiKey.delete();
await EventLogs.logEvent(
"api_key_deleted",
{ deletedBy: response.locals?.user?.username },
response?.locals?.user?.id
);
return response.status(200).end();
} catch (error) {
console.error(error);
response.status(500).end();
await ApiKey.delete({ id: Number(id) });
await EventLogs.logEvent(
"api_key_deleted",
{ deletedBy: response.locals?.user?.username },
response?.locals?.user?.id
);
return response.status(200).end();
} catch (error) {
console.error(error);
response.status(500).end();
}
}
});
);

app.post(
"/system/custom-models",
Expand Down