last commit
This commit is contained in:
parent
fcb5467f84
commit
715351ace2
|
|
@ -713,6 +713,8 @@ io.on("connection", (socket) => {
|
||||||
// if (data.result[0].status.toLocaleLowerCase() === "error") {
|
// if (data.result[0].status.toLocaleLowerCase() === "error") {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
let nameFile = moment(Date.now()).format("YYYYMMDD") + "-AUTO-Session." + data.result[0].sta_name.replace(" ", "-") + ".log"
|
||||||
fs.access(
|
fs.access(
|
||||||
"../netmiko_Api/public/dailyLogs/" +
|
"../netmiko_Api/public/dailyLogs/" +
|
||||||
moment(Date.now()).format("YYYYMMDD") +
|
moment(Date.now()).format("YYYYMMDD") +
|
||||||
|
|
@ -722,6 +724,7 @@ io.on("connection", (socket) => {
|
||||||
fs.constants.F_OK,
|
fs.constants.F_OK,
|
||||||
(err) => {
|
(err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
//chua co log
|
||||||
fs.writeFile(
|
fs.writeFile(
|
||||||
"../netmiko_Api/public/dailyLogs/" +
|
"../netmiko_Api/public/dailyLogs/" +
|
||||||
moment(Date.now()).format("YYYYMMDD") +
|
moment(Date.now()).format("YYYYMMDD") +
|
||||||
|
|
@ -740,6 +743,7 @@ io.on("connection", (socket) => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
//da co log
|
||||||
const old_data = fs.readFileSync(
|
const old_data = fs.readFileSync(
|
||||||
"../netmiko_Api/public/dailyLogs/" +
|
"../netmiko_Api/public/dailyLogs/" +
|
||||||
moment(Date.now()).format("YYYYMMDD") +
|
moment(Date.now()).format("YYYYMMDD") +
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue