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") {
|
||||
|
||||
// }
|
||||
|
||||
let nameFile = moment(Date.now()).format("YYYYMMDD") + "-AUTO-Session." + data.result[0].sta_name.replace(" ", "-") + ".log"
|
||||
fs.access(
|
||||
"../netmiko_Api/public/dailyLogs/" +
|
||||
moment(Date.now()).format("YYYYMMDD") +
|
||||
|
|
@ -722,8 +724,9 @@ io.on("connection", (socket) => {
|
|||
fs.constants.F_OK,
|
||||
(err) => {
|
||||
if (err) {
|
||||
//chua co log
|
||||
fs.writeFile(
|
||||
"../netmiko_Api/public/dailyLogs/" +
|
||||
"../netmiko_Api/public/dailyLogs/" +
|
||||
moment(Date.now()).format("YYYYMMDD") +
|
||||
"-AUTO-Session." +
|
||||
data.result[0].sta_name.replace(" ", "-") +
|
||||
|
|
@ -740,6 +743,7 @@ io.on("connection", (socket) => {
|
|||
}
|
||||
);
|
||||
} else {
|
||||
//da co log
|
||||
const old_data = fs.readFileSync(
|
||||
"../netmiko_Api/public/dailyLogs/" +
|
||||
moment(Date.now()).format("YYYYMMDD") +
|
||||
|
|
|
|||
Loading…
Reference in New Issue