Add squel.js

This commit is contained in:
Namhyeon Go 2020-11-14 22:16:47 +09:00
parent 94052fa412
commit d86fc7f279
3 changed files with 12 additions and 10 deletions

2
app/assets/js/squel-5.13.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -5,10 +5,6 @@
// Common routines. Defines LIB object which contains the API, as well as
// a global DBG function.
//
// References:
// * https://github.com/redskyit/wsh-appjs
// * https://github.com/JSman-/JS-Framework
//
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
@ -49,12 +45,15 @@ require("app/assets/js/es5-shim-4.5.14.min");
require("app/assets/js/es5-sham-4.5.14.min");
// JSON 3 was a JSON polyfill for older JavaScript platforms
require("app/assets/js/json3-3.3.2.min");
global.JSON = require("app/assets/js/json3-3.3.2.min");
// ECMAScript 6 compatibility shims for legacy JS engines
require("app/assets/js/es6-shim-0.35.5.min");
require("app/assets/js/es6-sham-0.35.5.min");
// Squel.js SQL Query Builder
global.squel = require("app/assets/js/squel-5.13.0.min");
/////////////////////////////////////////////////////////////////////////////////
// Global APIs
/////////////////////////////////////////////////////////////////////////////////
@ -84,10 +83,6 @@ global.CHR = function(ord) {
// Private APIs / Utility functions
/////////////////////////////////////////////////////////////////////////////////
exports.VERSIONINFO = "Standard Lib (std.js) version 0.2";
exports.global = global;
exports.require = global.require;
/////////////////////////////////////////////////////////////////////////////////
// Emulate Server.CreateObject
/////////////////////////////////////////////////////////////////////////////////
@ -122,3 +117,7 @@ exports.CreateObject = function(progId, serverName, callback) {
};
/////////////////////////////////////////////////////////////////////////////////
exports.VERSIONINFO = "Standard Lib (std.js) version 0.2";
exports.global = global;
exports.require = global.require;

View File

@ -190,7 +190,8 @@ exports.createShortcut = function(shoutcutName, fileName) {
exports.ping = function(address) {
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
var query = "Select * From win32_PingStatus where address='" + address + "'";
//var query = "Select * From win32_PingStatus where address='" + address + "'";
var query = squel.select().from("Win32_PingStatus").where("address = ?", address).toString();
var colItems = wmi.ExecQuery(query);
var enumItems = new Enumerator(colItems);