This commit is contained in:
Namhyeon Go 2020-11-18 15:46:34 +09:00
parent 22ed37dee4
commit db94c4ae13
4 changed files with 39 additions and 15 deletions

View File

@ -15,6 +15,7 @@ var apiUrl = CONFIG.readConfig("/ApiUrl").first().getText();
var servers = [];
var applications = [];
var localApplications = [];
var assign = function() {
SHELL.runWindow("cscript app.js shadow");
@ -27,8 +28,6 @@ var pingtest = function() {
};
var getLocalApplications = function() {
var localApplications = [];
// LDPlayer
var LDPList = LDPlayer.getList();
for (var i = 0; i < LDPList.length; i++) {
@ -48,6 +47,7 @@ var getLocalApplications = function() {
}
// Chrome
/*
localApplications.push({
name: "Chrome",
uniqueId: "John"
@ -60,6 +60,7 @@ var getLocalApplications = function() {
name: "Chrome",
uniqueId: "Jasmine"
});
*/
var template = $("#listview_applications .template");
for (var i = 0; i < servers.length; i++) {
@ -155,6 +156,14 @@ var getMyApplications = function() {
}
}
xmlStrings.push("</Item>");
// for Chrome
if (res.data[i].name == "Chrome") {
localApplications.push({
name: "Chrome",
uniqueId: res.data[i].unique_id
});
}
}
xmlStrings.push("</StaticIP>");
@ -263,7 +272,7 @@ if (typeof(token) !== "undefined") {
};
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_password").value = credential.password;
}

View File

@ -71,13 +71,18 @@ exports.readFile = function(FN, charset) {
FSO = null;
return T;
} else {
try {
var fsT = CreateObject("ADODB.Stream");
var T = null;
fsT.CharSet = charset;
fsT.Open();
fsT.LoadFromFile(FN);
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) {
};

View File

@ -108,6 +108,16 @@ var ShellObject = function() {
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() {
console.info("ShellObject.release() -> " + this.currentDirectory);
this.interface.CurrentDirectory = this.currentDirectory;
@ -148,6 +158,10 @@ exports.runAs = function(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.global = global;
exports.require = global.require;

View File

@ -1,3 +1,3 @@
@echo off
pushd "%~dp0"
cscript app.js bootstrap