mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
Fixed bulk actions and few minor UX bugs.
This commit is contained in:
parent
91e7d9ff4a
commit
b7cf917141
17 changed files with 31 additions and 72 deletions
|
@ -17,7 +17,7 @@ const RRD = props => {
|
|||
let year = newDate.getFullYear();
|
||||
let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
|
||||
return <div className="date">{day} {months[month - 1]} {year}</div>;
|
||||
return <div className="date">{day} {months[month]} {year}</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -10,12 +10,6 @@ const Server = props => {
|
|||
const { data } = props;
|
||||
const { i18n } = useSelector(state => state.session);
|
||||
|
||||
const printTime = seconds => {
|
||||
let hours = seconds / 60;
|
||||
let days = Math.floor(hours / 24);
|
||||
return days;
|
||||
}
|
||||
|
||||
const checkItem = () => {
|
||||
props.checkItem(data.NAME);
|
||||
}
|
||||
|
@ -41,7 +35,7 @@ const Server = props => {
|
|||
<div><span>{i18n.Memory}: <span className="stat">{data.MEM} {i18n.mb}</span></span></div>
|
||||
</Container>
|
||||
<Container className="c-3">
|
||||
<div><span>{i18n.Uptime}: <span className="stat">{printTime(data.RTIME)} {i18n.days}</span></span></div>
|
||||
<div><span>{i18n.Uptime}: <span className="stat">{data.RTIME}</span></span></div>
|
||||
</Container>
|
||||
<Container className="c-1" />
|
||||
</div>
|
||||
|
|
|
@ -9,13 +9,6 @@ import { useSelector } from 'react-redux';
|
|||
const Server = props => {
|
||||
const { data } = props;
|
||||
const { i18n } = useSelector(state => state.session);
|
||||
const token = localStorage.getItem("token");
|
||||
|
||||
const printTime = seconds => {
|
||||
let hours = seconds / 60;
|
||||
let days = Math.floor(hours / 24);
|
||||
return days;
|
||||
}
|
||||
|
||||
const checkItem = () => {
|
||||
props.checkItem(props.data.HOSTNAME);
|
||||
|
@ -39,7 +32,7 @@ const Server = props => {
|
|||
<div>{i18n['Load Average']}: <span><span className="stat">{data.LOADAVERAGE}</span></span></div>
|
||||
</Container>
|
||||
<Container className="c-3">
|
||||
<div><span>{i18n.Uptime}: <span className="stat">{printTime(data.UPTIME)} {i18n.days}</span></span></div>
|
||||
<div><span>{i18n.Uptime}: <span className="stat">{data.UPTIME}</span></span></div>
|
||||
</Container>
|
||||
</div>
|
||||
</Container>
|
||||
|
|
|
@ -285,10 +285,8 @@ const Backups = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -330,10 +330,8 @@ const CronJobs = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -285,10 +285,8 @@ export default function DnsRecords(props) {
|
|||
bulkAction(action, selection, state.domain)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -330,10 +330,8 @@ const Databases = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -346,10 +346,8 @@ const DomainNameSystems = props => {
|
|||
bulkDomainAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -236,10 +236,8 @@ const BanLists = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -324,10 +324,8 @@ const Firewalls = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -318,10 +318,8 @@ const InternetProtocols = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -324,10 +324,8 @@ export default function MailAccounts(props) {
|
|||
bulkMailAccountAction(action, props.domain, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -337,10 +337,8 @@ const Mails = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -314,10 +314,8 @@ const Packages = props => {
|
|||
bulkAction(action, selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -259,10 +259,8 @@ const Servers = props => {
|
|||
displayModal(res.data.error);
|
||||
}
|
||||
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
}
|
||||
|
|
|
@ -328,10 +328,8 @@ const Users = props => {
|
|||
bulkAction(action, state.selection)
|
||||
.then(result => {
|
||||
if (result.status === 200) {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
|
|
@ -322,10 +322,8 @@ const Web = props => {
|
|||
setLoading(true);
|
||||
bulkAction(action, state.selection)
|
||||
.then(result => {
|
||||
fetchData().then(() => {
|
||||
refreshMenuCounters();
|
||||
toggleAll(false);
|
||||
});
|
||||
toggleAll(false);
|
||||
fetchData().then(() => refreshMenuCounters());
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue