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
25 changes: 24 additions & 1 deletion backend/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6877,5 +6877,28 @@
"Module \":name\" could not be uninstalled: :msg": "Module \":name\" could not be uninstalled: :msg",
"Module \":name\" uninstalled. Its database tables were left in place; reinstalling keeps the data.": "Module \":name\" uninstalled. Its database tables were left in place; reinstalling keeps the data.",
"Failed to import settings - nothing from the file was saved. :message": "Failed to import settings - nothing from the file was saved. :message",
"Click a step to show only its components; click it again to show all. The number on a step is how many components it consumes.": "Click a step to show only its components; click it again to show all. The number on a step is how many components it consumes."
"Click a step to show only its components; click it again to show all. The number on a step is how many components it consumes.": "Click a step to show only its components; click it again to show all. The number on a step is how many components it consumes.",
"(inactive)": "(inactive)",
"The production line this device feeds — the default target for its topic mappings (e.g. a sensor counting units on this line).": "The production line this device feeds — the default target for its topic mappings (e.g. a sensor counting units on this line).",
"Also count as finished goods (feeds the work order's produced qty)": "Also count as finished goods (feeds the work order's produced qty)",
"Counting": "Counting",
"(supports + and # wildcards)": "(supports + and # wildcards)",
"e.g. Production count from Line 1": "e.g. Production count from Line 1",
"Field path — e.g. $.qty or $.data.value": "Field path — e.g. $.qty or $.data.value",
"Action type *": "Action type *",
"Condition — e.g. value > 0": "Condition — e.g. value > 0",
"Counting — pick the line and station": "Counting — pick the line and station",
"Action params (JSON) — e.g. {\"order_no_path\":\"$.order_no\"}": "Action params (JSON) — e.g. {\"order_no_path\":\"$.order_no\"}",
"e.g. Update produced qty from machine counter": "e.g. Update produced qty from machine counter",
"· scale ×": "· scale ×",
"Upstream source batch": "Upstream source batch",
"Add Produced Quantity": "Add Produced Quantity",
"Already produced": "Already produced",
"No rows yet.": "No rows yet.",
"est.": "est.",
"Contact": "Contact",
"Identity": "Identity",
"Pricing": "Pricing",
"Sequence": "Sequence",
"Credentials": "Credentials"
}
25 changes: 24 additions & 1 deletion backend/lang/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6990,5 +6990,28 @@
"Module \":name\" could not be uninstalled: :msg": "Không thể gỡ cài đặt mô-đun \":name\": :msg",
"Module \":name\" uninstalled. Its database tables were left in place; reinstalling keeps the data.": "Đã gỡ cài đặt mô-đun \":name\". Các bảng cơ sở dữ liệu vẫn được giữ nguyên; cài đặt lại sẽ khôi phục dữ liệu.",
"Failed to import settings - nothing from the file was saved. :message": "Không thể nhập cài đặt - không có dữ liệu nào từ tệp được lưu. :message",
"Click a step to show only its components; click it again to show all. The number on a step is how many components it consumes.": "Bấm vào một bước công đoạn để chỉ hiển thị các linh kiện của bước đó; bấm lần nữa để hiển thị tất cả. Con số trên bước công đoạn cho biết số lượng linh kiện tiêu hao."
"Click a step to show only its components; click it again to show all. The number on a step is how many components it consumes.": "Bấm vào một bước công đoạn để chỉ hiển thị các linh kiện của bước đó; bấm lần nữa để hiển thị tất cả. Con số trên bước công đoạn cho biết số lượng linh kiện tiêu hao.",
"(inactive)": "(không hoạt động)",
"The production line this device feeds — the default target for its topic mappings (e.g. a sensor counting units on this line).": "Dây chuyền sản xuất mà thiết bị này cung cấp dữ liệu — mục tiêu mặc định cho các ánh xạ chủ đề (ví dụ: cảm biến đếm số lượng trên dây chuyền này).",
"Also count as finished goods (feeds the work order's produced qty)": "Đồng thời tính là thành phẩm (cập nhật vào số lượng đã sản xuất của lệnh sản xuất)",
"Counting": "Đếm sản lượng",
"(supports + and # wildcards)": "(hỗ trợ ký tự đại diện + và #)",
"e.g. Production count from Line 1": "vd: Đếm sản lượng từ Dây chuyền 1",
"Field path — e.g. $.qty or $.data.value": "Đường dẫn trường — vd: $.qty hoặc $.data.value",
"Action type *": "Loại hành động *",
"Condition — e.g. value > 0": "Điều kiện — vd: value > 0",
"Counting — pick the line and station": "Đếm sản lượng — chọn dây chuyền và công đoạn",
"Action params (JSON) — e.g. {\"order_no_path\":\"$.order_no\"}": "Tham số hành động (JSON) — vd: {\"order_no_path\":\"$.order_no\"}",
"e.g. Update produced qty from machine counter": "vd: Cập nhật sản lượng từ bộ đếm máy",
"· scale ×": "· hệ số tỉ lệ ×",
"Upstream source batch": "Lô sản xuất nguồn đầu vào",
"Add Produced Quantity": "Thêm sản lượng đã sản xuất",
"Already produced": "Đã sản xuất",
"No rows yet.": "Chưa có dòng nào.",
"est.": "ước tính",
"Contact": "Liên hệ",
"Identity": "Định danh",
"Pricing": "Định giá",
"Sequence": "Quy tắc đánh số",
"Credentials": "Thông tin xác thực"
}
44 changes: 22 additions & 22 deletions backend/resources/js/Pages/admin/connectivity/mqtt/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppDataTable from '../../../../components/AppDataTable';
import AppLayout from '../../../../layouts/AppLayout';
import Tooltip from '../../../../components/Tooltip';
import useConfirm from '../../../../components/useConfirm';
import { formatNumber } from '../../../../lib/i18n';
import { __, formatNumber } from '../../../../lib/i18n';

const STATUS_DOT = {
green: 'bg-om-running',
Expand All @@ -18,7 +18,7 @@ export default function MqttIndex() {
const { confirm, dialog } = useConfirm();

const handleDelete = (conn) => {
confirm({ title: 'Delete this connection and all its topics?' }, () => {
confirm({ title: __('Delete this connection and all its topics?') }, () => {
router.delete(`/admin/connectivity/mqtt/${conn.id}`, { preserveScroll: true });
});
};
Expand All @@ -27,7 +27,7 @@ export default function MqttIndex() {
{
id: 'status',
accessorKey: 'status',
header: 'Status',
header: __('Status'),
cell: ({ row }) => {
const conn = row.original;
const dot = STATUS_DOT[conn.status_color] ?? 'bg-slate-400';
Expand All @@ -43,7 +43,7 @@ export default function MqttIndex() {
{
id: 'name',
accessorKey: 'name',
header: 'Name',
header: __('Name'),
cell: ({ row }) => {
const conn = row.original;
return (
Expand All @@ -52,7 +52,7 @@ export default function MqttIndex() {
{conn.name}
</a>
{!conn.is_active && (
<span className="ml-1.5 text-xs text-om-faint">(inactive)</span>
<span className="ml-1.5 text-xs text-om-faint">{__('(inactive)')}</span>
)}
</span>
);
Expand All @@ -62,7 +62,7 @@ export default function MqttIndex() {
{
id: 'broker',
accessorFn: (r) => (r.mqtt_host ? `${r.mqtt_host}:${r.mqtt_port}` : ''),
header: 'Broker',
header: __('Broker'),
cell: ({ row }) => {
const conn = row.original;
return (
Expand All @@ -75,7 +75,7 @@ export default function MqttIndex() {
)}
</>
) : (
<span className="text-red-400">Not configured</span>
<span className="text-red-400">{__('Not configured')}</span>
)}
</span>
);
Expand All @@ -85,14 +85,14 @@ export default function MqttIndex() {
{
id: 'topics',
accessorKey: 'topics_count',
header: 'Topics',
header: __('Topics'),
cell: ({ row }) => <span className="text-om-muted">{row.original.topics_count}</span>,
meta: { align: 'left' },
},
{
id: 'messages',
accessorKey: 'messages_received',
header: 'Messages',
header: __('Messages'),
cell: ({ row }) => (
<span className="text-om-muted">{formatNumber(Number(row.original.messages_received))}</span>
),
Expand All @@ -101,41 +101,41 @@ export default function MqttIndex() {
{
id: 'last_connected',
accessorKey: 'last_connected_at',
header: 'Last connected',
header: __('Last connected'),
cell: ({ row }) => (
<span className="text-xs text-om-muted">{row.original.last_connected_at ?? '—'}</span>
),
meta: { align: 'left' },
},
{
id: 'actions',
header: 'Actions',
header: __('Actions'),
enableSorting: false,
cell: ({ row }) => {
const conn = row.original;
return (
<div className="flex items-center justify-end gap-2">
<Tooltip label="View">
<a href={`/admin/connectivity/mqtt/${conn.id}`} className="p-1.5 rounded-md transition-colors text-om-muted hover:text-om-ink" aria-label="View">
<Tooltip label={__('View')}>
<a href={`/admin/connectivity/mqtt/${conn.id}`} className="p-1.5 rounded-md transition-colors text-om-muted hover:text-om-ink" aria-label={__('View')}>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</a>
</Tooltip>
<Tooltip label="Edit">
<a href={`/admin/connectivity/mqtt/${conn.id}/edit`} className="p-1.5 rounded-md transition-colors text-om-accent hover:text-om-accent" aria-label="Edit">
<Tooltip label={__('Edit')}>
<a href={`/admin/connectivity/mqtt/${conn.id}/edit`} className="p-1.5 rounded-md transition-colors text-om-accent hover:text-om-accent" aria-label={__('Edit')}>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
</svg>
</a>
</Tooltip>
<Tooltip label="Delete">
<Tooltip label={__('Delete')}>
<button
type="button"
onClick={() => handleDelete(conn)}
className="p-1.5 rounded-md transition-colors text-om-blocked hover:text-om-blocked"
aria-label="Delete"
aria-label={__('Delete')}
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
Expand All @@ -151,14 +151,14 @@ export default function MqttIndex() {

return (
<>
<Head title="MQTT Connections" />
<Head title={__('MQTT Connections')} />

<div className="p-6 space-y-6">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold text-om-ink">MQTT Connections</h1>
<h1 className="text-2xl font-bold text-om-ink">{__('MQTT Connections')}</h1>
<p className="text-sm text-om-muted mt-1">
Define and manage MQTT broker connections and topic subscriptions.
{__('Define and manage MQTT broker connections and topic subscriptions.')}
</p>
</div>
<a
Expand All @@ -168,7 +168,7 @@ export default function MqttIndex() {
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 4v16m8-8H4" />
</svg>
New MQTT Connection
{__('New MQTT Connection')}
</a>
</div>

Expand All @@ -177,7 +177,7 @@ export default function MqttIndex() {
<svg className="w-12 h-12 mx-auto mb-3 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.5" d="M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.14 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0" />
</svg>
<p className="text-sm">No MQTT connections defined.</p>
<p className="text-sm">{__('No MQTT connections defined.')}</p>
</div>
) : (
<AppDataTable
Expand Down
Loading
Loading