mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 09:24:58 +00:00
fix
This commit is contained in:
parent
22ed37dee4
commit
db94c4ae13
15
app/index.js
15
app/index.js
|
@ -15,6 +15,7 @@ var apiUrl = CONFIG.readConfig("/ApiUrl").first().getText();
|
||||||
|
|
||||||
var servers = [];
|
var servers = [];
|
||||||
var applications = [];
|
var applications = [];
|
||||||
|
var localApplications = [];
|
||||||
|
|
||||||
var assign = function() {
|
var assign = function() {
|
||||||
SHELL.runWindow("cscript app.js shadow");
|
SHELL.runWindow("cscript app.js shadow");
|
||||||
|
@ -27,8 +28,6 @@ var pingtest = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
var getLocalApplications = function() {
|
var getLocalApplications = function() {
|
||||||
var localApplications = [];
|
|
||||||
|
|
||||||
// LDPlayer
|
// LDPlayer
|
||||||
var LDPList = LDPlayer.getList();
|
var LDPList = LDPlayer.getList();
|
||||||
for (var i = 0; i < LDPList.length; i++) {
|
for (var i = 0; i < LDPList.length; i++) {
|
||||||
|
@ -48,6 +47,7 @@ var getLocalApplications = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chrome
|
// Chrome
|
||||||
|
/*
|
||||||
localApplications.push({
|
localApplications.push({
|
||||||
name: "Chrome",
|
name: "Chrome",
|
||||||
uniqueId: "John"
|
uniqueId: "John"
|
||||||
|
@ -60,6 +60,7 @@ var getLocalApplications = function() {
|
||||||
name: "Chrome",
|
name: "Chrome",
|
||||||
uniqueId: "Jasmine"
|
uniqueId: "Jasmine"
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
var template = $("#listview_applications .template");
|
var template = $("#listview_applications .template");
|
||||||
for (var i = 0; i < servers.length; i++) {
|
for (var i = 0; i < servers.length; i++) {
|
||||||
|
@ -155,6 +156,14 @@ var getMyApplications = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xmlStrings.push("</Item>");
|
xmlStrings.push("</Item>");
|
||||||
|
|
||||||
|
// for Chrome
|
||||||
|
if (res.data[i].name == "Chrome") {
|
||||||
|
localApplications.push({
|
||||||
|
name: "Chrome",
|
||||||
|
uniqueId: res.data[i].unique_id
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
xmlStrings.push("</StaticIP>");
|
xmlStrings.push("</StaticIP>");
|
||||||
|
|
||||||
|
@ -263,7 +272,7 @@ if (typeof(token) !== "undefined") {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (FILE.fileExists("credential.json")) {
|
if (FILE.fileExists("credential.json")) {
|
||||||
var credential = JSON.parse(FILE.readFile("token.txt", "utf-8"));
|
var credential = JSON.parse(FILE.readFile("credential.json", "utf-8"));
|
||||||
document.getElementById("txt_email").value = credential.email;
|
document.getElementById("txt_email").value = credential.email;
|
||||||
document.getElementById("txt_password").value = credential.password;
|
document.getElementById("txt_password").value = credential.password;
|
||||||
}
|
}
|
||||||
|
|
23
lib/file.js
23
lib/file.js
|
@ -71,13 +71,18 @@ exports.readFile = function(FN, charset) {
|
||||||
FSO = null;
|
FSO = null;
|
||||||
return T;
|
return T;
|
||||||
} else {
|
} else {
|
||||||
var fsT = CreateObject("ADODB.Stream");
|
try {
|
||||||
fsT.CharSet = charset;
|
var fsT = CreateObject("ADODB.Stream");
|
||||||
fsT.Open();
|
var T = null;
|
||||||
fsT.LoadFromFile(FN);
|
fsT.CharSet = charset;
|
||||||
T = fsT.ReadText();
|
fsT.Open();
|
||||||
fsT = null;
|
fsT.LoadFromFile(FN);
|
||||||
return T;
|
T = fsT.ReadText();
|
||||||
|
fsT = null;
|
||||||
|
return T;
|
||||||
|
} catch (e) {
|
||||||
|
console.error("readFile -> " + e.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -168,7 +173,3 @@ exports.deleteFile = function(FN) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
exports.copyFolder = function(FN) {
|
|
||||||
|
|
||||||
};
|
|
14
lib/shell.js
14
lib/shell.js
|
@ -108,6 +108,16 @@ var ShellObject = function() {
|
||||||
return oShell;
|
return oShell;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.createDesktopIcon = function(filename, workingDirectory) {
|
||||||
|
var desktopPath = this.interface.SpecialFolders("Desktop");
|
||||||
|
var link = this.interface.CreateShortcut(desktopPath + "\\" + name + ".lnk");
|
||||||
|
link.IconLocation = filename + ",1";
|
||||||
|
link.TargetPath = workingDirectory + "\\" + filename;
|
||||||
|
link.WindowStyle = 3;
|
||||||
|
link.WorkingDirectory = workingDirectory;
|
||||||
|
link.Save();
|
||||||
|
};
|
||||||
|
|
||||||
this.release = function() {
|
this.release = function() {
|
||||||
console.info("ShellObject.release() -> " + this.currentDirectory);
|
console.info("ShellObject.release() -> " + this.currentDirectory);
|
||||||
this.interface.CurrentDirectory = this.currentDirectory;
|
this.interface.CurrentDirectory = this.currentDirectory;
|
||||||
|
@ -148,6 +158,10 @@ exports.runAs = function(FN, args) {
|
||||||
return (new ShellObject()).runAs(FN, args);
|
return (new ShellObject()).runAs(FN, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.createDesktopIcon = function(filename, workingDirectory) {
|
||||||
|
return (new ShellObject()).createDesktopIcon(filename, workingDirectory);
|
||||||
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Shell Lib (shell.js) version 0.1";
|
exports.VERSIONINFO = "Shell Lib (shell.js) version 0.1";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user