Update UI with MRF logo and Lean Manufacturing KPI headers
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const https = require('https');
|
||||
const cmd = 'apk add --no-cache postgresql-client && PGPASSWORD=password psql -h sop_db -U admin -d sop_monitoring -c "SHOW hba_file;"';
|
||||
const req = https.request({
|
||||
hostname: 'aisop.houseofwebsites.ai',
|
||||
port: 443,
|
||||
path: '/api/eval',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}, res => {
|
||||
let body = '';
|
||||
res.on('data', d => body += d);
|
||||
res.on('end', () => console.log('Response:', body));
|
||||
});
|
||||
req.write(JSON.stringify({ cmd }));
|
||||
req.end();
|
||||
@@ -0,0 +1,27 @@
|
||||
const { Client } = require('pg');
|
||||
const client = new Client({
|
||||
user: 'admin',
|
||||
password: 'password',
|
||||
host: 'aisop.houseofwebsites.ai',
|
||||
database: 'sop_monitoring',
|
||||
port: 5432,
|
||||
ssl: { rejectUnauthorized: false }
|
||||
});
|
||||
client.connect()
|
||||
.then(() => {
|
||||
console.log('Connected to DB');
|
||||
return client.query("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'");
|
||||
})
|
||||
.then(res => {
|
||||
console.log('Tables:', res.rows);
|
||||
return client.query('SELECT COUNT(*) FROM events');
|
||||
})
|
||||
.then(res => {
|
||||
console.log('Events count:', res.rows[0]);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('DB Error:', err.message);
|
||||
})
|
||||
.finally(() => {
|
||||
client.end();
|
||||
});
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
const xlsx = require('xlsx');
|
||||
const { Client } = require('pg');
|
||||
const { Pool } = require('pg');
|
||||
const path = require('path');
|
||||
|
||||
const filePath = path.join(__dirname, '..', 'Consolidated_report_v2_with_feed-names (1).xlsx');
|
||||
|
||||
const client = new Client({
|
||||
const client = new Pool({
|
||||
user: 'admin',
|
||||
host: 'localhost',
|
||||
database: 'sop_monitoring',
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
const http = require('https');
|
||||
|
||||
const API_KEY = '4|lL3pgQVbfLb6KtUByDLaswjP4Jccny8HMj5jrs0v4ace4e78';
|
||||
const APP_UUID = 'e91cvmd4gqohmd8p53dmo2wq';
|
||||
|
||||
const request = (method, path, data = null) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = {
|
||||
hostname: 'deploy.digifox.live',
|
||||
port: 443,
|
||||
path: path,
|
||||
method: method,
|
||||
headers: {
|
||||
'Authorization': `Bearer ${API_KEY}`,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
|
||||
if (data) {
|
||||
options.headers['Content-Length'] = Buffer.byteLength(data);
|
||||
}
|
||||
|
||||
const req = http.request(options, res => {
|
||||
let body = '';
|
||||
res.on('data', d => body += d);
|
||||
res.on('end', () => resolve({ status: res.statusCode, body }));
|
||||
});
|
||||
|
||||
req.on('error', error => reject(error));
|
||||
|
||||
if (data) {
|
||||
req.write(data);
|
||||
}
|
||||
req.end();
|
||||
});
|
||||
};
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const data = JSON.stringify({
|
||||
docker_compose_domains: JSON.stringify({
|
||||
ui: {
|
||||
domain: "https://aisop.houseofwebsites.ai"
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
console.log('Patching domains to the UI service...');
|
||||
const res = await request('PATCH', `/api/v1/applications/${APP_UUID}`, data);
|
||||
console.log('Status:', res.status, res.body);
|
||||
|
||||
console.log('Triggering deployment to apply domain changes...');
|
||||
const deployRes = await request('POST', `/api/v1/applications/${APP_UUID}/start`);
|
||||
console.log('Deploy Status:', deployRes.status, deployRes.body);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
@@ -118,8 +118,12 @@ export default function ChangeoverDetail() {
|
||||
|
||||
return (
|
||||
<div className="container animate-fade-in">
|
||||
<div className="header" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', marginBottom: '3rem' }}>
|
||||
<Link to="/" style={{ color: 'var(--text-secondary)', textDecoration: 'none', display: 'flex', alignItems: 'center', gap: '0.5rem', marginBottom: '1.5rem', alignSelf: 'flex-start' }}>
|
||||
<div className="header" style={{ position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', marginBottom: '3rem' }}>
|
||||
<div style={{ position: 'absolute', top: 0, left: 0, display: 'flex', flexDirection: 'column', alignItems: 'center', background: '#ed1c24', padding: '10px', borderRadius: '4px' }}>
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4b/Madras_Rubber_Factory_Logo.svg" alt="MRF Logo" style={{ width: '60px' }} />
|
||||
<span style={{ color: 'yellow', fontWeight: 'bold', marginTop: '5px', fontSize: '0.9rem', letterSpacing: '1px' }}>DCG</span>
|
||||
</div>
|
||||
<Link to="/" style={{ color: 'var(--text-secondary)', textDecoration: 'none', display: 'flex', alignItems: 'center', gap: '0.5rem', marginBottom: '1.5rem', alignSelf: 'flex-end' }}>
|
||||
<ArrowLeft size={16} /> Back to Home
|
||||
</Link>
|
||||
<Activity size={48} color="var(--accent)" style={{ marginBottom: '1rem' }} />
|
||||
@@ -155,25 +159,46 @@ export default function ChangeoverDetail() {
|
||||
<div className="kpi-grid">
|
||||
<div className="glass-panel kpi-card">
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span className="kpi-title">CO Idle / Waste</span>
|
||||
<span className="kpi-title">MAN</span>
|
||||
<Clock size={20} color="var(--text-secondary)" />
|
||||
</div>
|
||||
<span className="kpi-value warning">{formatDuration(idleTimes.CO)}</span>
|
||||
</div>
|
||||
<div className="glass-panel kpi-card">
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span className="kpi-title">Mill Gaps / Idle</span>
|
||||
<span className="kpi-title">MACHINE</span>
|
||||
<AlertTriangle size={20} color="var(--text-secondary)" />
|
||||
</div>
|
||||
<span className="kpi-value danger">{formatDuration(idleTimes.Mill)}</span>
|
||||
</div>
|
||||
<div className="glass-panel kpi-card">
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span className="kpi-title">Conveyor Transport Delay</span>
|
||||
<span className="kpi-title">METHOD</span>
|
||||
<Monitor size={20} color="var(--text-secondary)" />
|
||||
</div>
|
||||
<span className="kpi-value accent">{formatDuration(idleTimes.Conveyor)}</span>
|
||||
</div>
|
||||
<div className="glass-panel kpi-card">
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span className="kpi-title">MATERIAL</span>
|
||||
<Activity size={20} color="var(--text-secondary)" />
|
||||
</div>
|
||||
<span className="kpi-value">0s</span>
|
||||
</div>
|
||||
<div className="glass-panel kpi-card">
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span className="kpi-title">MEASUREMENT & INFORMATION</span>
|
||||
<Monitor size={20} color="var(--text-secondary)" />
|
||||
</div>
|
||||
<span className="kpi-value">0s</span>
|
||||
</div>
|
||||
<div className="glass-panel kpi-card">
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span className="kpi-title">MORALE</span>
|
||||
<Clock size={20} color="var(--text-secondary)" />
|
||||
</div>
|
||||
<span className="kpi-value">0s</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="glass-panel" style={{ marginBottom: '2rem' }}>
|
||||
|
||||
Reference in New Issue
Block a user