1098 changed files with 0 additions and 99506 deletions
@ -1,36 +0,0 @@ |
|||
HELP.md |
|||
target/ |
|||
!.mvn/wrapper/maven-wrapper.jar |
|||
!**/src/main/**/target/ |
|||
!**/src/test/**/target/ |
|||
|
|||
### STS ### |
|||
.apt_generated |
|||
.classpath |
|||
.factorypath |
|||
.project |
|||
.settings |
|||
.springBeans |
|||
.sts4-cache |
|||
|
|||
### IntelliJ IDEA ### |
|||
.idea |
|||
*.iws |
|||
*.iml |
|||
*.ipr |
|||
|
|||
### NetBeans ### |
|||
/nbproject/private/ |
|||
/nbbuild/ |
|||
/dist/ |
|||
/nbdist/ |
|||
/.nb-gradle/ |
|||
build/ |
|||
!**/src/main/**/build/ |
|||
!**/src/test/**/build/ |
|||
|
|||
### VS Code ### |
|||
.vscode/ |
|||
|
|||
logs/ |
|||
files/ |
|||
@ -1,6 +0,0 @@ |
|||
# 数据库服务器配置 |
|||
type=com.alibaba.druid.pool.DruidDataSource |
|||
druid.driver-class=com.mysql.cj.jdbc.Driver |
|||
druid.url=jdbc:mysql://127.0.0.1:3306/wbfs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
|||
druid.username=root |
|||
druid.password=root |
|||
@ -1,2 +0,0 @@ |
|||
./fss -t /sss/ |
|||
末尾的/ 需要加上,未加上末尾/ 的话,会导致 将目录也打包进入 |
|||
@ -1,5 +0,0 @@ |
|||
color 87 |
|||
set GOOS=linux |
|||
set GOARCH=amd64 |
|||
set CGO_ENABLED=0 |
|||
go build -o fss main.go |
|||
@ -1,49 +0,0 @@ |
|||
package config |
|||
|
|||
import ( |
|||
"fmt" |
|||
"net" |
|||
) |
|||
|
|||
type Config struct { |
|||
DeviceName string |
|||
Port string |
|||
LocalIP string |
|||
FilePath string |
|||
Version string |
|||
} |
|||
|
|||
var G Config |
|||
|
|||
// 本地ip
|
|||
func GetLocalIP() (string, error) { |
|||
addrs, err := net.InterfaceAddrs() |
|||
if err != nil { |
|||
return "", err |
|||
} |
|||
var ips []string |
|||
for _, address := range addrs { |
|||
if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { |
|||
if ipnet.IP.To4() != nil { |
|||
ips = append(ips, ipnet.IP.String()) |
|||
} |
|||
} |
|||
} |
|||
if len(ips) == 0 { |
|||
return "", fmt.Errorf("get local ip failed") |
|||
} else if len(ips) == 1 { |
|||
return ips[0], nil |
|||
} else { |
|||
// Select the one connected to the network
|
|||
// when there are multiple network interfaces
|
|||
|
|||
// Is there a better way?
|
|||
c, err := net.Dial("udp", "8.8.8.8:80") |
|||
if err != nil { |
|||
return ips[0], nil |
|||
} |
|||
defer c.Close() |
|||
return c.LocalAddr().(*net.UDPAddr).IP.String(), nil |
|||
} |
|||
|
|||
} |
|||
@ -1,59 +0,0 @@ |
|||
package core |
|||
|
|||
import ( |
|||
"encoding/json" |
|||
"fmt" |
|||
"fss/db" |
|||
"fss/util" |
|||
"net/http" |
|||
"strings" |
|||
) |
|||
|
|||
type Brespone struct { |
|||
Status string `json:"status"` |
|||
Data []db.StFileInfo `json:"data"` //目录下的文件
|
|||
} |
|||
|
|||
// 输出数据库中的基础文件的结构和hash
|
|||
func BfsInfo(w http.ResponseWriter, r *http.Request) { |
|||
// 监听的目录通过?p=的方式传入
|
|||
urlpath := r.URL.Query().Get("p") |
|||
fmt.Printf("your params:%s\n", urlpath) |
|||
// 防止逃逸,造成漏洞
|
|||
if strings.Contains(urlpath, "../") { |
|||
// urlpath = "Lg=="
|
|||
urlpath = util.Bas64end(".") |
|||
} |
|||
|
|||
// dsrpath := util.Base64dec(urlpath)
|
|||
// 如果根目录
|
|||
if urlpath == "" || urlpath == "." || urlpath == "Lg==" { |
|||
urlpath = util.Bas64end(".") |
|||
// urlpath = "Lg=="
|
|||
} |
|||
|
|||
fmt.Printf("after chk:%s\n", urlpath) |
|||
|
|||
// 链接数据库
|
|||
db.Init() |
|||
// 获取请求的信息
|
|||
flists := db.Fquery(urlpath) |
|||
// fmt.Printf("stfile :%v\n", flist)
|
|||
|
|||
//
|
|||
bfslist := make([]db.StFileInfo, 0) |
|||
//
|
|||
for _, v := range flists { |
|||
bfslist = append(bfslist, v) |
|||
} |
|||
|
|||
// fmt.Fprintf(w, "%s:sqlite query ...", r.Host)
|
|||
response := Brespone{ |
|||
Status: "success", |
|||
Data: bfslist, |
|||
} |
|||
|
|||
// 开启跨域
|
|||
uCorsHadler(w, r) |
|||
json.NewEncoder(w).Encode(response) |
|||
} |
|||
@ -1,110 +0,0 @@ |
|||
package core |
|||
|
|||
import ( |
|||
"fmt" |
|||
"fss/config" |
|||
"fss/util" |
|||
"io" |
|||
"mime" |
|||
"net/http" |
|||
"os" |
|||
"path/filepath" |
|||
"strings" |
|||
"time" |
|||
) |
|||
|
|||
// 接收发送来的文件
|
|||
func ReceiveHandler(w http.ResponseWriter, r *http.Request) { |
|||
switch r.Method { |
|||
case http.MethodGet: |
|||
//
|
|||
fmt.Fprintf(w, "%s:接收文件中...", r.Host) |
|||
case http.MethodPost: |
|||
// receive file and save
|
|||
file, header, err := r.FormFile("file") |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusBadRequest) |
|||
return |
|||
} |
|||
defer file.Close() |
|||
|
|||
_, params, err := mime.ParseMediaType(header.Header.Get("Content-Disposition")) |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusBadRequest) |
|||
return |
|||
} |
|||
filename := filepath.FromSlash(params["filename"]) |
|||
|
|||
// fpath
|
|||
bfpath := r.Header.Get("Fpath") |
|||
|
|||
//debug
|
|||
// fmt.Printf("header params:%v\n", r.Header)
|
|||
fmt.Printf("fpath is:%s,afbs64 is:%s\n", bfpath, util.Base64dec(bfpath)) |
|||
|
|||
fmt.Printf("Downloading [%s]...\n", filename) |
|||
// 拼装完整路径
|
|||
nfname := filepath.Join(config.G.FilePath, util.Base64dec(bfpath)) |
|||
dirPath := filepath.Dir(nfname) |
|||
//dirPath := filepath.Dir(filename)
|
|||
err = os.MkdirAll(dirPath, os.ModePerm) |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusInternalServerError) |
|||
return |
|||
} |
|||
// 检查文件是否存在
|
|||
if util.IsFileExist(nfname) { |
|||
// 当前时间
|
|||
curtime := time.Now().Format("2006/01/02") |
|||
// 创建备份文件夹
|
|||
bkdir := filepath.Join(config.G.FilePath, "backup", curtime) |
|||
// 递归创建文件夹
|
|||
serr := os.MkdirAll(bkdir, os.ModePerm) |
|||
// 创建错误 返回空
|
|||
if serr != nil { |
|||
return |
|||
} |
|||
|
|||
// 文件重命名
|
|||
//ddname := filename + "_backup_" + time.Now().Format("20060102150405")
|
|||
ddname := filename + "_backup_" + time.Now().Format("20060102150405") |
|||
// 文件移动到备份目录下,并做压缩包
|
|||
bkzip := filepath.Join(bkdir, ddname) |
|||
zfarr := []string{nfname} |
|||
util.ZipFiles(bkzip+".zip", zfarr, bkdir) |
|||
//渠道
|
|||
// 加上路径
|
|||
fnewname := filepath.Join(bkdir, ddname) |
|||
os.Rename(nfname, fnewname) |
|||
} |
|||
|
|||
out, err := os.Create(nfname) |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusInternalServerError) |
|||
return |
|||
} |
|||
defer out.Close() |
|||
|
|||
_, err = io.Copy(out, file) |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusInternalServerError) |
|||
return |
|||
} |
|||
// 如果单文件,需要先备份
|
|||
|
|||
// 如果收到的是zip文件,自动给解压缩
|
|||
suf := strings.Split(filename, ".") |
|||
if suf[1] == "zip" { |
|||
// 传入实际路径
|
|||
go util.DecompressZip(nfname) |
|||
} |
|||
|
|||
fmt.Printf("[√] Download [%s] Success.\n", filename) |
|||
//
|
|||
default: |
|||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) |
|||
} |
|||
|
|||
// 输出接收结果
|
|||
// fmt.Fprintf(w, "接收成功,并已经完成解压缩")
|
|||
} |
|||
@ -1,103 +0,0 @@ |
|||
package core |
|||
|
|||
import ( |
|||
"fmt" |
|||
"fss/config" |
|||
"fss/util" |
|||
"net" |
|||
"net/http" |
|||
"path" |
|||
"path/filepath" |
|||
"strings" |
|||
"time" |
|||
) |
|||
|
|||
func SendZip(w http.ResponseWriter, r *http.Request) { |
|||
r.ParseForm() |
|||
// 选择文件,并生成zip包
|
|||
// 文件
|
|||
zipfarr := r.Form["sfiles"] |
|||
|
|||
// 服务器ip地址
|
|||
serip := r.Form["serverip"] |
|||
if serip[0] == "" { |
|||
http.Error(w, "remote server ip is blank!", http.StatusInternalServerError) |
|||
return |
|||
} |
|||
|
|||
tpath := "" |
|||
// 选中的路径,可以为空
|
|||
wtculpath := r.Form["curpath"] |
|||
if wtculpath != nil { |
|||
tpath = util.Base64dec(wtculpath[0]) |
|||
} |
|||
// 实际路径
|
|||
realFilePath := filepath.Join(config.G.FilePath, tpath) |
|||
|
|||
// zip 文件名
|
|||
zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip" |
|||
|
|||
// 创建zip 异步?
|
|||
taskId := make(chan string) |
|||
go func() { |
|||
util.CompressToZip(zpFileName, realFilePath, zipfarr) |
|||
taskId <- "arcok" |
|||
// fmt.Fprintln(w, "create archive:", err)
|
|||
}() |
|||
// go util.CompressToZip(zpFileName, realFilePath, zipfarr)
|
|||
fmt.Println("archive is createding...") |
|||
|
|||
// 当前运行的目录
|
|||
|
|||
// ZIP 文件的实际路径
|
|||
ziprl := path.Join("./sync_zips/", zpFileName) |
|||
|
|||
// zip 创建成功后
|
|||
rest := <-taskId |
|||
// 有压缩包 才可以操作
|
|||
if strings.EqualFold(strings.ToLower(rest), "arcok") { |
|||
fmt.Println("archive is sending...") |
|||
// 创建udp 渠道发送数据
|
|||
message := fmt.Sprintf("%s%s%s", config.G.DeviceName, "|", "sender") |
|||
UdpSendFile(serip[0], ziprl, zpFileName, message, w) |
|||
} else { |
|||
fmt.Println("archive is not exist!!!") |
|||
} |
|||
// 执行完 跳转到 首页
|
|||
http.Redirect(w, r, "/", http.StatusFound) |
|||
} |
|||
|
|||
// udp 模式发送文件
|
|||
/* |
|||
* serip 服务器ip, |
|||
* absfilepath 发送文件的实际路径, |
|||
* fname 文件名 |
|||
* message 携带部分信息的消息 |
|||
* http.ResponseWriter |
|||
*/ |
|||
func UdpSendFile(serip string, absfilepath string, fname string, message string, w http.ResponseWriter) { |
|||
|
|||
// 1、获取udp addr
|
|||
remoteAddr, err := net.ResolveUDPAddr("udp", serip+":9099") |
|||
if err != nil { |
|||
return |
|||
} |
|||
// 2、 监听端口
|
|||
conn, err := net.DialUDP("udp", nil, remoteAddr) |
|||
if err != nil { |
|||
return |
|||
} |
|||
defer conn.Close() |
|||
|
|||
// 3、在端口发送数据
|
|||
// message := fmt.Sprintf("%s%s%s", config.G.DeviceName, "|", "sender")
|
|||
// 向链接通道发送数据 数据包头
|
|||
conn.Write([]byte(message)) |
|||
// 发送文件
|
|||
go func() { |
|||
err := util.SendFiles(absfilepath, fmt.Sprintf("http://%s/rc", remoteAddr)) |
|||
if err != nil { |
|||
fmt.Printf("Send file to %s error: %s\n", remoteAddr, err) |
|||
} |
|||
}() |
|||
} |
|||
@ -1,141 +0,0 @@ |
|||
package core |
|||
|
|||
import ( |
|||
"encoding/json" |
|||
"fmt" |
|||
"fss/config" |
|||
"fss/db" |
|||
"fss/util" |
|||
"net/http" |
|||
"os" |
|||
"path/filepath" |
|||
"strings" |
|||
) |
|||
|
|||
// json 结构体
|
|||
type Response struct { |
|||
Status string `json:"status"` //状态
|
|||
Data FilesListJson `json:"data"` //目录下的文件
|
|||
Curdir string `json:"curdir"` // 扫描的目录
|
|||
WorksDir string `json:"workdir"` //监听目录
|
|||
Hostip string `json:"hostip"` //运行的主机ip
|
|||
} |
|||
|
|||
// 文件输出的结构
|
|||
type FileJson struct { |
|||
Fname string `json:"fname"` |
|||
Dirflag bool `json:"dirflag"` |
|||
Isbackup int `json:"isbackup"` |
|||
Fhash string `json:"hash"` // hash
|
|||
Fsize string `json:"size"` //文件大小, 输出带单位的大小
|
|||
Frehash string `json:"rehash"` // 参考hash
|
|||
} |
|||
|
|||
type FilesListJson struct { |
|||
Flist []FileJson `json:"list"` |
|||
} |
|||
|
|||
// 获取运行的路径
|
|||
var Gpath string |
|||
|
|||
// 遍历监视目录,发送到json中
|
|||
func SerInfo(w http.ResponseWriter, r *http.Request) { |
|||
// 监听的目录通过?p=的方式传入
|
|||
urlpath := r.URL.Query().Get("p") |
|||
// 防止逃逸,造成漏洞
|
|||
if strings.Contains(urlpath, "../") || urlpath == "" { |
|||
urlpath = "." |
|||
} |
|||
|
|||
// urlpath 进行base64 解码
|
|||
dsrpath := util.Base64dec(urlpath) |
|||
// 监听的根目录
|
|||
realFilePath := filepath.Join(config.G.FilePath, dsrpath) |
|||
// 时间目录的情况
|
|||
fileInfo, err := os.Stat(realFilePath) |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusInternalServerError) |
|||
return |
|||
} |
|||
// 链接数据库
|
|||
db.Init() |
|||
// 获取请求的信息
|
|||
rcflists := db.Fquery(util.Bas64end(dsrpath)) |
|||
//
|
|||
// list json
|
|||
var flist FilesListJson |
|||
//针对目录的情况才输出
|
|||
// todo 如果是文件的话 暂时不处理
|
|||
if fileInfo.IsDir() { |
|||
// 遍历目录
|
|||
files, err := os.ReadDir(realFilePath) |
|||
if err != nil { |
|||
http.Error(w, err.Error(), http.StatusInternalServerError) |
|||
return |
|||
} |
|||
// 遍历
|
|||
for _, v := range files { |
|||
// fmt.Printf("rang v:%v\n", v)
|
|||
isbak := 0 |
|||
rchash := "" //参考的hash
|
|||
// 如果有 backup
|
|||
if strings.Contains(v.Name(), "backup") { |
|||
isbak = 1 |
|||
} |
|||
// 如果是文件的话,就计算hash和大小
|
|||
if v.IsDir() { |
|||
//While entry is A Directory
|
|||
flist.Flist = append(flist.Flist, FileJson{Fname: v.Name(), Dirflag: v.IsDir(), Isbackup: isbak, Fhash: "", Fsize: "", Frehash: ""}) |
|||
} else { |
|||
// 计算文件的hash
|
|||
funame := filepath.Join(realFilePath, v.Name()) |
|||
fhash := util.CalacHash(funame) |
|||
//
|
|||
for _, av := range rcflists { |
|||
if av.Fname == v.Name() { |
|||
rchash = av.Fhash |
|||
} |
|||
} |
|||
// 文件大小
|
|||
// 获取文件大小(以字节为单位)
|
|||
sizeInBytes := fileInfo.Size() |
|||
sizeStr := fmt.Sprintf("%.2f KB", float64(sizeInBytes)/1024) |
|||
// output
|
|||
flist.Flist = append(flist.Flist, FileJson{Fname: v.Name(), Dirflag: v.IsDir(), Isbackup: isbak, Fhash: fhash, Fsize: sizeStr, Frehash: rchash}) |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
// respone file list
|
|||
response := Response{ |
|||
Status: "success", |
|||
Curdir: urlpath, |
|||
WorksDir: config.G.FilePath, |
|||
Hostip: config.G.LocalIP, |
|||
Data: flist, |
|||
} |
|||
|
|||
// 开启跨域
|
|||
uCorsHadler(w, r) |
|||
json.NewEncoder(w).Encode(response) |
|||
} |
|||
|
|||
// 跨域函数
|
|||
func uCorsHadler(w http.ResponseWriter, r *http.Request) { |
|||
// 设置跨域响应头
|
|||
w.Header().Set("Access-Control-Allow-Origin", "*") |
|||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, OPTIONS,PUT,DELETET") |
|||
// w.Header().Set("Access-Control-Allow-Headers", "Content-Type,Accept,Accept-Length,Accept-Encoding,X-XSRF-TOKEN,X-XSRF-TOKEN")
|
|||
w.Header().Set("Access-Control-Allow-Headers", "*") |
|||
//
|
|||
w.Header().Set("Content-Type", "application/json") |
|||
|
|||
// 如果是OPTIONS请求,返回200 OK
|
|||
if r.Method == "OPTIONS" { |
|||
// fmt.Printf("options is now \n")
|
|||
// w.WriteHeader(http.StatusOK)
|
|||
return |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package db |
|||
|
|||
// 定义数据库中用的模型
|
|||
type StFileInfo struct { |
|||
Id string `json:"id"` |
|||
Fpath string `json:"fpath"` |
|||
Fhash string `json:"fhash"` |
|||
Fname string `json:"fname"` |
|||
} |
|||
@ -1,100 +0,0 @@ |
|||
package db |
|||
|
|||
import ( |
|||
"fmt" |
|||
|
|||
// 导入包,导入前缀为下划线,则init函数被执行,然后注册驱动。
|
|||
"github.com/jmoiron/sqlx" |
|||
_ "github.com/logoove/sqlite" |
|||
) |
|||
|
|||
var db *sqlx.DB |
|||
var err error |
|||
|
|||
func Init() { |
|||
// fmt.Printf("hey,I am initilize function in SqliteDb\n")s
|
|||
//
|
|||
// Open() 函数指定驱动名称和数据源名称
|
|||
db, err = sqlx.Open("sqlite", "ups.db") |
|||
if err != nil { |
|||
fmt.Printf("Database creation failed: %v\n", err) |
|||
return |
|||
} |
|||
// 调用db.Close() 函数,确保关闭数据库并阻止启动新的查询
|
|||
// defer db.Close()
|
|||
//
|
|||
connectDB() |
|||
} |
|||
|
|||
// 连接数据库
|
|||
func connectDB() { |
|||
var version string |
|||
// QueryRow() 执行查询,返回版本号
|
|||
err = db.QueryRow("SELECT SQLITE_VERSION()").Scan(&version) |
|||
if err != nil { |
|||
fmt.Printf("Database creation failed: %v\n", err) |
|||
return |
|||
} |
|||
// 连接成功,打印出"database connected:版本号"
|
|||
fmt.Printf("Database creation successful: %v\n", version) |
|||
} |
|||
|
|||
// 创建数据库表
|
|||
func CreateTable() { |
|||
// 建表语句
|
|||
sts := ` |
|||
CREATE TABLE f_info ( |
|||
id INTEGER PRIMARY KEY NOT NULL, |
|||
fname TEXT NOT NULL, |
|||
fpath TEXT NOT NULL, |
|||
fhash TEXT NOT NULL |
|||
);` |
|||
|
|||
// 使用db.Exec() 函数来执行 SQL 语句
|
|||
_, err = db.Exec(sts) |
|||
if err != nil { |
|||
fmt.Printf("Failed to create database table: %v\n", err) |
|||
return |
|||
} |
|||
fmt.Printf("Successfully created database table! \n") |
|||
} |
|||
|
|||
// 插入数据
|
|||
func InsertStf(sf StFileInfo) { |
|||
// 插入语句
|
|||
res, err := db.Exec("INSERT INTO f_info(fname, fpath,fhash) VALUES(?,?,?)", sf.Fname, sf.Fpath, sf.Fhash) |
|||
if err != nil { |
|||
fmt.Printf("Insert data failed: %v\n", err) |
|||
return |
|||
} |
|||
|
|||
// 获取自增ID
|
|||
lastInsertId, _ := res.LastInsertId() |
|||
fmt.Printf("Successfully inserted data, lastInsertId = %v\n", lastInsertId) |
|||
} |
|||
|
|||
// 查询数据
|
|||
func Fquery(fpbs string) (stlist []StFileInfo) { |
|||
// 结果重量集合
|
|||
stlist = make([]StFileInfo, 0) |
|||
|
|||
// 查询语句
|
|||
rows, err := db.Query("SELECT id,fname,fpath,fhash FROM f_info WHERE fpbs = ?", fpbs) |
|||
//
|
|||
if err != nil { |
|||
fmt.Printf("Failed to query data: %v\n", err) |
|||
return |
|||
} |
|||
// FOR loop
|
|||
for rows.Next() { |
|||
// var weight float64
|
|||
var st StFileInfo |
|||
err = rows.Scan(&st.Id, &st.Fname, &st.Fpath, &st.Fhash) |
|||
if err != nil { |
|||
fmt.Printf("Failed to read data: %v\n", err) |
|||
continue |
|||
} |
|||
stlist = append(stlist, st) |
|||
} |
|||
return stlist |
|||
} |
|||
Binary file not shown.
@ -1,364 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<title>文件更新控制台</title> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="./static/css/bootstrap.css"> |
|||
<link rel="icon" type="image/x-icon" href="/favicon.ico?v=2"> |
|||
<script type="text/javascript" src="./static/js/jquery.min.js"></script> |
|||
<script type="text/javascript" src="./static/js/bootstrap.min.js"></script> |
|||
<style> |
|||
.list-group>.list-group-item { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.optzone { |
|||
height: 60px; |
|||
} |
|||
|
|||
.stabox { |
|||
height: 260px; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.flist { |
|||
height: 360px; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.icon { |
|||
display: inline-block; |
|||
width: 24px; |
|||
height: 24px; |
|||
} |
|||
.hsval { |
|||
font-size: 10px; |
|||
margin-left: 16px; |
|||
} |
|||
|
|||
.hschange { |
|||
/* background-color: #dabd16; */ |
|||
background: linear-gradient(0deg, #dabd16 60%, transparent 20%); |
|||
} |
|||
|
|||
.hschange a { |
|||
color: #fff !important; |
|||
} |
|||
|
|||
.hschange .icon:hover { |
|||
cursor: pointer; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.folder-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
background-color: #c1972e; |
|||
|
|||
} |
|||
|
|||
.file-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
-webkit-mask-imagee: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
background-repeat: no-repeat; |
|||
background-color: #0e0b8b; |
|||
} |
|||
|
|||
#rstatus { |
|||
height: 360px; |
|||
overflow-y: auto; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<div class="jumbotron"> |
|||
<div class="container"> |
|||
<p>文件更新控制台</p> |
|||
<p>ver:3.04</p> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 输入服务器ip --> |
|||
<div class="container"> |
|||
|
|||
<div class="form-group col-md-6"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">服务器ip</div> |
|||
<input type="text" class="form-control" name="sip" id="scip" placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">监视目录</div> |
|||
<input type="text" class="form-control" name="sdir" placeholder="eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group col-md-12"> |
|||
<button type="button" id="entsip" class="btn btn-primary">查看信息</button> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 罗列文件的列表信息 --> |
|||
<div class="container"> |
|||
<!-- 源服务器 --> |
|||
<div class="col-md-12"> |
|||
<div class="panel panel-default"> |
|||
<!-- Default panel contents --> |
|||
<div class="panel-heading" id="ssip">源站</div> |
|||
<div class="panel-body"> |
|||
<p>监听目录:<span class="sc01"></span></p> |
|||
<p>相对目录: <span class="sc02"></span> </p> |
|||
<div class="col-md-12"> |
|||
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall" data-st="ss">全选</a> |
|||
<a href="javascript:void(0);" class="btn btn-info btn-sm" id="sybtn" data-st="ss">同步</a> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- List group --> |
|||
<form action="/sendZip" method="post" class="ssform"> |
|||
<ul class="list-group" id="scsc"></ul> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
<script type="text/javascript"> |
|||
var chkall = true; |
|||
var chknum = 0; |
|||
var scip = ""; //目标服务器ip |
|||
var urlpath = ".";// 当前的操作目录 |
|||
var chkarr = new Array; //选中的文件或目录 |
|||
//var bfsarr = new Array; // base file infomation array |
|||
|
|||
$(function () { |
|||
// read sessionStorage |
|||
var oscip = sessionStorage.getItem("scip"); |
|||
var otip = sessionStorage.getItem("tscip"); |
|||
if (oscip != "" || otip != '') { |
|||
$("input[name='sip']").val(oscip); |
|||
$("input[name='tsip']").val(otip); |
|||
} |
|||
// click function SOURCE SERVER |
|||
$("#entsip").on("click", function () { |
|||
scfs("ss"); |
|||
}) |
|||
|
|||
|
|||
// 目标服务器的文件信息 |
|||
// st 源站 或 目标站 |
|||
var scfs = function (st) { |
|||
// |
|||
scip = $("input[name='sip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("scip", scip); |
|||
//监视目录 |
|||
var jsdir = $("input[name='sdir']").val(); |
|||
if (jsdir != '') { |
|||
urlpath = bsrqst(jsdir) |
|||
//urlpath = encodeURIComponent(btoa(jsdir)); |
|||
} else { |
|||
urlpath = bsrqst(".") |
|||
} |
|||
// 输入框也显示东西 |
|||
$("input[name='sdir']").val(urlpath); |
|||
$("input[name='tsdir']").val(urlpath) |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|||
$("#ssip").text("源站(" + scip + ")"); |
|||
|
|||
// 获取信息 |
|||
gescinfo("#scsc", scip, urlpath,st); |
|||
|
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// button click function for TARGET SERVER |
|||
$("#tentsip").on("click", function () { |
|||
$("#mbip").text("目标站(" + scip + ")"); |
|||
tgfs("tg"); |
|||
}) |
|||
|
|||
// 目标服务器的文件信息 |
|||
var tgfs = function (st) { |
|||
tsip = $("input[name='tsip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("tscip", tsip); |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入目标服务器" + tsip + "</li>"; |
|||
// 目标站 |
|||
$("#mbip").text("目标站(" + tsip + ")"); |
|||
// 获取信息 |
|||
gescinfo("#tgsc", tsip, urlpath,st); |
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// 获取目标服务器的信息 |
|||
var gescinfo = function (elemnt, scip, upath,st) { |
|||
upath = upath.replace("/\\/g", "\/"); |
|||
var url=""; // 客户端的状态地址 |
|||
if(scip=='' || scip=='127.0.0.1' || scip=="localhost"){ |
|||
url="./sc?p="+upath; |
|||
}else{ |
|||
url = "http://" + scip + ":9099/sc?p=" + upath; |
|||
} |
|||
// |
|||
var html = ""; |
|||
$.getJSON(url, function (res) { |
|||
// |
|||
var chgflag; |
|||
$.each(res.data.list, function (k, v) { |
|||
// 不存在这个字段的话 |
|||
if(typeof(v.rehash) != 'undefined'){ |
|||
chgflag = "" |
|||
} |
|||
// 判读是否存在 变化 |
|||
if (!v.dirflag) { |
|||
// hash相同,未修改 |
|||
chgflag = v.rehash == v.hash ? " nochage" : " hschange"; |
|||
} else { |
|||
chgflag = "" |
|||
} |
|||
|
|||
// |
|||
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">"; |
|||
html += "<input type=\"checkbox\" class="+st+'mfile'+" name=\"sfiles\" value=" + v.fname + " />"; |
|||
if (v.dirflag) { //如果是文件夹 |
|||
html += "<span class=\"icon folder-icon\"></span>" ; |
|||
html += v.fname |
|||
// html += "<a href=\"javascript:void(0);\" onclick='"+getDirList(elemnt, scip,v.fname)+"'>"+v.fname +"</a>"; |
|||
html += "</div>"; |
|||
} else { |
|||
|
|||
|
|||
html += "<span class=\"icon file-icon\"></span>" + |
|||
"<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='" |
|||
+ v.rehash + "'>" |
|||
+ v.fname + "</a></div>"; |
|||
|
|||
} |
|||
|
|||
// if (v.isbackup == 1) { |
|||
// html += "<div class=\"col-md-2\"><a href=\"#\" class=\"btn btn-warning btn-sm\">恢复</a></div>"; |
|||
// } else { |
|||
// html += "<div class=\"col-md-2\"></div>"; |
|||
// } |
|||
|
|||
html += "</li>"; |
|||
}) |
|||
// append to html |
|||
html += "<input type='hidden' name='curpath' value='"+upath+"'>"; |
|||
if(st=="tg"){ |
|||
html += "<input type='hidden' name='serverip' value='"+scip+"'>"; |
|||
}else{ |
|||
html += "<input type='hidden' name='serverip' value='192.168.66.16'>"; |
|||
} |
|||
|
|||
// $("#tgsc").html(html) |
|||
$(elemnt).html(html); |
|||
writelog(scip + "获取数据:" + res.data.list.length + "条数据") |
|||
// 客户端监控目录 |
|||
$(elemnt).parent().find(".sc01").text(res.workdir) |
|||
$(elemnt).parent().find(".sc02").text(dbsresp(res.curdir)) |
|||
}); |
|||
} |
|||
|
|||
// write log |
|||
var writelog = function (html) { |
|||
var hprex = "<li class=\"list-group-item\">" + html + "</li>"; |
|||
$("#rstatus").append(hprex); |
|||
} |
|||
|
|||
//全选按钮设置点击事件 |
|||
$("#slall").click(function () { |
|||
let st = $(this).data("st"); |
|||
//1、循环设置其它多选框选中状态,跟标识用的变量一样 |
|||
$("."+st+"mfile").prop("checked", chkall); |
|||
// down button toggle |
|||
if (chkall || chknum > 2) { |
|||
chknum += 1 |
|||
} else { |
|||
chknum -= 1 |
|||
} |
|||
//2、标识的变量取反 |
|||
chkall = !chkall; |
|||
}) |
|||
|
|||
//同步操作 |
|||
$("#sybtn").on("click", function () { |
|||
// var st = $(this).data("st") |
|||
// $(".ssform").submit(); |
|||
// var ss = $("."+st+"mfile").hasClass("checked").val() |
|||
// console.log(ss) |
|||
// 获取选中的文件 或者文件夹 |
|||
// chkarr.push($("input[name='sfiles[]']:checked").val()); |
|||
|
|||
// console.log(chkarr) |
|||
// var ss = $("input[name='sfiles[]']:checked").val(); |
|||
//var ss = $(".mfile").has("checked").val() |
|||
// console.log(ss) |
|||
var ttsip = $("input[name='tsip']").val(); |
|||
if (ttsip == "") { |
|||
alert("老天鹅,你还没填写目标服务器地址。"); |
|||
} else { |
|||
|
|||
// 提交表单 |
|||
$(".ssform").submit(); |
|||
} |
|||
|
|||
}); |
|||
|
|||
// 勾选是否同步的选项 |
|||
$("#sw_sybtn").on("click", function () { |
|||
let swval = $(this).has("checked").val(); |
|||
// 设置相反的值 |
|||
alert(swval); |
|||
}); |
|||
|
|||
//base64 编码防止请求错误 |
|||
var bsrqst = function (path) { |
|||
return encodeURIComponent(btoa(path)); |
|||
} |
|||
//解码base64 |
|||
var dbsresp = function (bsStr) { |
|||
// console.log("respone base64 string ", bsStr) |
|||
if (bsStr == ".") { |
|||
return "." |
|||
} else { |
|||
return decodeURIComponent(atob(bsStr)) |
|||
} |
|||
} |
|||
// 另外的base64的解码 |
|||
function safeAtob(base64Str) { |
|||
// 检查输入字符串是否是有效的Base64编码 |
|||
const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/; |
|||
if (!base64Regex.test(base64Str)) { |
|||
throw new Error('The string to be decoded is not correctly encoded.'); |
|||
} |
|||
|
|||
// 如果输入字符串长度不是4的倍数,添加等号'=' |
|||
while (base64Str.length % 4 !== 0) { |
|||
base64Str += '='; |
|||
} |
|||
|
|||
return atob(base64Str); |
|||
} |
|||
|
|||
|
|||
}); |
|||
</script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,413 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<title>文件更新控制台</title> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="./static/css/bootstrap.css"> |
|||
<link rel="icon" type="image/x-icon" href="/favicon.ico?v=2"> |
|||
<script type="text/javascript" src="./static/js/jquery.min.js"></script> |
|||
<script type="text/javascript" src="./static/js/bootstrap.min.js"></script> |
|||
<style> |
|||
.list-group>.list-group-item { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.optzone { |
|||
height: 60px; |
|||
} |
|||
|
|||
.stabox { |
|||
height: 260px; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.flist { |
|||
height: 360px; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.icon { |
|||
display: inline-block; |
|||
width: 24px; |
|||
height: 24px; |
|||
} |
|||
.hsval { |
|||
font-size: 10px; |
|||
margin-left: 16px; |
|||
} |
|||
|
|||
.hschange { |
|||
/* background-color: #dabd16; */ |
|||
background: linear-gradient(0deg, #dabd16 60%, transparent 20%); |
|||
} |
|||
|
|||
.hschange a { |
|||
color: #fff !important; |
|||
} |
|||
|
|||
.hschange .icon:hover { |
|||
cursor: pointer; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.folder-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
background-color: #c1972e; |
|||
|
|||
} |
|||
|
|||
.file-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
-webkit-mask-imagee: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
background-repeat: no-repeat; |
|||
background-color: #0e0b8b; |
|||
} |
|||
|
|||
#rstatus { |
|||
height: 360px; |
|||
overflow-y: auto; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<div class="jumbotron"> |
|||
<div class="container"> |
|||
<p>文件更新控制台</p> |
|||
<p>ver:3.04</p> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 输入服务器ip --> |
|||
<div class="container"> |
|||
|
|||
<div class="form-group col-md-6"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">服务器ip</div> |
|||
<input type="text" class="form-control" name="sip" id="scip" placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">监视目录</div> |
|||
<input type="text" class="form-control" name="sdir" placeholder="eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group col-md-12"> |
|||
<button type="button" id="entsip" class="btn btn-primary">查看信息</button> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 罗列文件的列表信息 --> |
|||
<div class="container"> |
|||
<!-- 源服务器 --> |
|||
<div class="col-md-12"> |
|||
<div class="panel panel-default"> |
|||
<!-- Default panel contents --> |
|||
<div class="panel-heading" id="ssip">源站</div> |
|||
<div class="panel-body"> |
|||
<p>监听目录:<span class="sc01"></span></p> |
|||
<p>相对目录: <span class="sc02"></span> </p> |
|||
<div class="col-md-12"> |
|||
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall" data-st="ss">全选</a> |
|||
<a href="javascript:void(0);" class="btn btn-info btn-sm" id="sybtn" data-st="ss">同步</a> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- List group --> |
|||
<form action="/sendZip" method="post" class="ssform"> |
|||
<ul class="list-group" id="scsc"></ul> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
|
|||
<!-- 目标服务器 --> |
|||
<div class="container"> |
|||
<!-- 目标的服务器信息 --> |
|||
<div class="form-group col-md-6"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">服务器ip</div> |
|||
<input type="text" class="form-control" name="tsip" id="tcip" placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">监视目录</div> |
|||
<input type="text" class="form-control" name="tsdir" id="" placeholder="eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group col-md-12"> |
|||
<button type="button" id="tentsip" class="btn btn-primary">查看信息</button> |
|||
</div> |
|||
<!-- 目标服务器 --> |
|||
<div class="col-md-12"> |
|||
<div class="panel panel-default"> |
|||
<!-- Default panel contents --> |
|||
<div class="panel-heading" id="mbip">目标服务器</div> |
|||
<div class="panel-body"> |
|||
<p>监听目录:<span id="sc01" class="sc01"></span></p> |
|||
<p>相对目录: <span id="sc02" class="sc02"></span> </p> |
|||
</div> |
|||
|
|||
<!-- List group --> |
|||
<ul class="list-group" id="tgsc"> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 状态信息 --> |
|||
<div class="container"> |
|||
<div class="col-md-12"> |
|||
<p>1、获取远程服务器的文件信息,2、校验hash值3、枚举出所有hash不同的文件4、勾选文件更新即可5、根据勾选的文件制作更新zip文件,发送到目标服务器。文件的参考HASH值,如何同步到几个平台?</p> |
|||
</div> |
|||
<div class="panel"> |
|||
<div class="panel-heading">运行状态</div> |
|||
<div class="panel-body"> |
|||
<ul class="list-group" id="rstatus"></ul> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
|
|||
|
|||
<script type="text/javascript"> |
|||
var chkall = true; |
|||
var chknum = 0; |
|||
var scip = ""; //目标服务器ip |
|||
var urlpath = ".";// 当前的操作目录 |
|||
var chkarr = new Array; //选中的文件或目录 |
|||
//var bfsarr = new Array; // base file infomation array |
|||
|
|||
$(function () { |
|||
// read sessionStorage |
|||
var oscip = sessionStorage.getItem("scip"); |
|||
var otip = sessionStorage.getItem("tscip"); |
|||
if (oscip != "" || otip != '') { |
|||
$("input[name='sip']").val(oscip); |
|||
$("input[name='tsip']").val(otip); |
|||
} |
|||
// click function SOURCE SERVER |
|||
$("#entsip").on("click", function () { |
|||
scfs("ss"); |
|||
}) |
|||
|
|||
|
|||
// 目标服务器的文件信息 |
|||
// st 源站 或 目标站 |
|||
var scfs = function (st) { |
|||
// |
|||
scip = $("input[name='sip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("scip", scip); |
|||
//监视目录 |
|||
var jsdir = $("input[name='sdir']").val(); |
|||
if (jsdir != '') { |
|||
urlpath = bsrqst(jsdir) |
|||
//urlpath = encodeURIComponent(btoa(jsdir)); |
|||
} else { |
|||
urlpath = bsrqst(".") |
|||
} |
|||
// 输入框也显示东西 |
|||
$("input[name='sdir']").val(urlpath); |
|||
$("input[name='tsdir']").val(urlpath) |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|||
$("#ssip").text("源站(" + scip + ")"); |
|||
|
|||
// 获取信息 |
|||
gescinfo("#scsc", scip, urlpath,st); |
|||
|
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// button click function for TARGET SERVER |
|||
$("#tentsip").on("click", function () { |
|||
$("#mbip").text("目标站(" + scip + ")"); |
|||
tgfs("tg"); |
|||
}) |
|||
|
|||
// 目标服务器的文件信息 |
|||
var tgfs = function (st) { |
|||
tsip = $("input[name='tsip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("tscip", tsip); |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入目标服务器" + tsip + "</li>"; |
|||
// 目标站 |
|||
$("#mbip").text("目标站(" + tsip + ")"); |
|||
// 获取信息 |
|||
gescinfo("#tgsc", tsip, urlpath,st); |
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// 获取目标服务器的信息 |
|||
var gescinfo = function (elemnt, scip, upath,st) { |
|||
upath = upath.replace("/\\/g", "\/"); |
|||
var url=""; // 客户端的状态地址 |
|||
if(scip=='' || scip=='127.0.0.1' || scip=="localhost"){ |
|||
url="./sc?p="+upath; |
|||
}else{ |
|||
url = "http://" + scip + ":9099/sc?p=" + upath; |
|||
} |
|||
// |
|||
var html = ""; |
|||
$.getJSON(url, function (res) { |
|||
// |
|||
var chgflag; |
|||
$.each(res.data.list, function (k, v) { |
|||
// 不存在这个字段的话 |
|||
if(typeof(v.rehash) != 'undefined'){ |
|||
chgflag = "" |
|||
} |
|||
// 判读是否存在 变化 |
|||
if (!v.dirflag) { |
|||
// hash相同,未修改 |
|||
chgflag = v.rehash == v.hash ? " nochage" : " hschange"; |
|||
} else { |
|||
chgflag = "" |
|||
} |
|||
|
|||
// |
|||
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">"; |
|||
html += "<input type=\"checkbox\" class="+st+'mfile'+" name=\"sfiles\" value=" + v.fname + " />"; |
|||
if (v.dirflag) { //如果是文件夹 |
|||
html += "<span class=\"icon folder-icon\"></span>" ; |
|||
html += v.fname |
|||
// html += "<a href=\"javascript:void(0);\" onclick='"+getDirList(elemnt, scip,v.fname)+"'>"+v.fname +"</a>"; |
|||
html += "</div>"; |
|||
} else { |
|||
|
|||
|
|||
html += "<span class=\"icon file-icon\"></span>" + |
|||
"<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='" |
|||
+ v.rehash + "'>" |
|||
+ v.fname + "</a></div>"; |
|||
|
|||
} |
|||
|
|||
// if (v.isbackup == 1) { |
|||
// html += "<div class=\"col-md-2\"><a href=\"#\" class=\"btn btn-warning btn-sm\">恢复</a></div>"; |
|||
// } else { |
|||
// html += "<div class=\"col-md-2\"></div>"; |
|||
// } |
|||
|
|||
html += "</li>"; |
|||
}) |
|||
// append to html |
|||
html += "<input type='hidden' name='curpath' value='"+upath+"'>"; |
|||
if(st=="tg"){ |
|||
html += "<input type='hidden' name='serverip' value='"+scip+"'>"; |
|||
}else{ |
|||
html += "<input type='hidden' name='serverip' value='192.168.66.16'>"; |
|||
} |
|||
|
|||
// $("#tgsc").html(html) |
|||
$(elemnt).html(html); |
|||
writelog(scip + "获取数据:" + res.data.list.length + "条数据") |
|||
// 客户端监控目录 |
|||
$(elemnt).parent().find(".sc01").text(res.workdir) |
|||
$(elemnt).parent().find(".sc02").text(dbsresp(res.curdir)) |
|||
}); |
|||
} |
|||
|
|||
// write log |
|||
var writelog = function (html) { |
|||
var hprex = "<li class=\"list-group-item\">" + html + "</li>"; |
|||
$("#rstatus").append(hprex); |
|||
} |
|||
|
|||
//全选按钮设置点击事件 |
|||
$("#slall").click(function () { |
|||
let st = $(this).data("st"); |
|||
//1、循环设置其它多选框选中状态,跟标识用的变量一样 |
|||
$("."+st+"mfile").prop("checked", chkall); |
|||
// down button toggle |
|||
if (chkall || chknum > 2) { |
|||
chknum += 1 |
|||
} else { |
|||
chknum -= 1 |
|||
} |
|||
//2、标识的变量取反 |
|||
chkall = !chkall; |
|||
}) |
|||
|
|||
//同步操作 |
|||
$("#sybtn").on("click", function () { |
|||
// var st = $(this).data("st") |
|||
// $(".ssform").submit(); |
|||
// var ss = $("."+st+"mfile").hasClass("checked").val() |
|||
// console.log(ss) |
|||
// 获取选中的文件 或者文件夹 |
|||
// chkarr.push($("input[name='sfiles[]']:checked").val()); |
|||
|
|||
// console.log(chkarr) |
|||
// var ss = $("input[name='sfiles[]']:checked").val(); |
|||
//var ss = $(".mfile").has("checked").val() |
|||
// console.log(ss) |
|||
var ttsip = $("input[name='tsip']").val(); |
|||
if (ttsip == "") { |
|||
alert("老天鹅,你还没填写目标服务器地址。"); |
|||
} else { |
|||
|
|||
// 提交表单 |
|||
$(".ssform").submit(); |
|||
} |
|||
|
|||
}); |
|||
|
|||
// 勾选是否同步的选项 |
|||
$("#sw_sybtn").on("click", function () { |
|||
let swval = $(this).has("checked").val(); |
|||
// 设置相反的值 |
|||
alert(swval); |
|||
}); |
|||
|
|||
//base64 编码防止请求错误 |
|||
var bsrqst = function (path) { |
|||
return encodeURIComponent(btoa(path)); |
|||
} |
|||
//解码base64 |
|||
var dbsresp = function (bsStr) { |
|||
// console.log("respone base64 string ", bsStr) |
|||
if (bsStr == ".") { |
|||
return "." |
|||
} else { |
|||
return decodeURIComponent(atob(bsStr)) |
|||
} |
|||
} |
|||
// 另外的base64的解码 |
|||
function safeAtob(base64Str) { |
|||
// 检查输入字符串是否是有效的Base64编码 |
|||
const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/; |
|||
if (!base64Regex.test(base64Str)) { |
|||
throw new Error('The string to be decoded is not correctly encoded.'); |
|||
} |
|||
|
|||
// 如果输入字符串长度不是4的倍数,添加等号'=' |
|||
while (base64Str.length % 4 !== 0) { |
|||
base64Str += '='; |
|||
} |
|||
|
|||
return atob(base64Str); |
|||
} |
|||
|
|||
|
|||
}); |
|||
</script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,413 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<title>文件更新控制台</title> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="./static/css/bootstrap.css"> |
|||
<link rel="icon" type="image/x-icon" href="/favicon.ico?v=2"> |
|||
<script type="text/javascript" src="./static/js/jquery.min.js"></script> |
|||
<script type="text/javascript" src="./static/js/bootstrap.min.js"></script> |
|||
<style> |
|||
.list-group>.list-group-item { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.optzone { |
|||
height: 60px; |
|||
} |
|||
|
|||
.stabox { |
|||
height: 260px; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.flist { |
|||
height: 360px; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.icon { |
|||
display: inline-block; |
|||
width: 24px; |
|||
height: 24px; |
|||
} |
|||
.hsval { |
|||
font-size: 10px; |
|||
margin-left: 16px; |
|||
} |
|||
|
|||
.hschange { |
|||
/* background-color: #dabd16; */ |
|||
background: linear-gradient(0deg, #dabd16 60%, transparent 20%); |
|||
} |
|||
|
|||
.hschange a { |
|||
color: #fff !important; |
|||
} |
|||
|
|||
.hschange .icon:hover { |
|||
cursor: pointer; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.folder-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
background-color: #c1972e; |
|||
|
|||
} |
|||
|
|||
.file-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
-webkit-mask-imagee: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
background-repeat: no-repeat; |
|||
background-color: #0e0b8b; |
|||
} |
|||
|
|||
#rstatus { |
|||
height: 360px; |
|||
overflow-y: auto; |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<div class="jumbotron"> |
|||
<div class="container"> |
|||
<p>文件更新控制台</p> |
|||
<p>ver:3.04</p> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 输入服务器ip --> |
|||
<div class="container"> |
|||
|
|||
<div class="form-group col-md-6"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">服务器ip</div> |
|||
<input type="text" class="form-control" name="sip" id="scip" placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">监视目录</div> |
|||
<input type="text" class="form-control" name="sdir" placeholder="eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group col-md-12"> |
|||
<button type="button" id="entsip" class="btn btn-primary">查看信息</button> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 罗列文件的列表信息 --> |
|||
<div class="container"> |
|||
<!-- 源服务器 --> |
|||
<div class="col-md-12"> |
|||
<div class="panel panel-default"> |
|||
<!-- Default panel contents --> |
|||
<div class="panel-heading" id="ssip">源站</div> |
|||
<div class="panel-body"> |
|||
<p>监听目录:<span class="sc01"></span></p> |
|||
<p>相对目录: <span class="sc02"></span> </p> |
|||
<div class="col-md-12"> |
|||
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall" data-st="ss">全选</a> |
|||
<a href="javascript:void(0);" class="btn btn-info btn-sm" id="sybtn" data-st="ss">同步</a> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- List group --> |
|||
<form action="/sendZip" method="post" class="ssform"> |
|||
<ul class="list-group" id="scsc"></ul> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
|
|||
<!-- 目标服务器 --> |
|||
<div class="container"> |
|||
<!-- 目标的服务器信息 --> |
|||
<div class="form-group col-md-6"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">服务器ip</div> |
|||
<input type="text" class="form-control" name="tsip" id="tcip" placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">监视目录</div> |
|||
<input type="text" class="form-control" name="tsdir" id="" placeholder="eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group col-md-12"> |
|||
<button type="button" id="tentsip" class="btn btn-primary">查看信息</button> |
|||
</div> |
|||
<!-- 目标服务器 --> |
|||
<div class="col-md-12"> |
|||
<div class="panel panel-default"> |
|||
<!-- Default panel contents --> |
|||
<div class="panel-heading" id="mbip">目标服务器</div> |
|||
<div class="panel-body"> |
|||
<p>监听目录:<span id="sc01" class="sc01"></span></p> |
|||
<p>相对目录: <span id="sc02" class="sc02"></span> </p> |
|||
</div> |
|||
|
|||
<!-- List group --> |
|||
<ul class="list-group" id="tgsc"> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 状态信息 --> |
|||
<div class="container"> |
|||
<div class="col-md-12"> |
|||
<p>1、获取远程服务器的文件信息,2、校验hash值3、枚举出所有hash不同的文件4、勾选文件更新即可5、根据勾选的文件制作更新zip文件,发送到目标服务器。文件的参考HASH值,如何同步到几个平台?</p> |
|||
</div> |
|||
<div class="panel"> |
|||
<div class="panel-heading">运行状态</div> |
|||
<div class="panel-body"> |
|||
<ul class="list-group" id="rstatus"></ul> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
|
|||
|
|||
<script type="text/javascript"> |
|||
var chkall = true; |
|||
var chknum = 0; |
|||
var scip = ""; //目标服务器ip |
|||
var urlpath = ".";// 当前的操作目录 |
|||
var chkarr = new Array; //选中的文件或目录 |
|||
//var bfsarr = new Array; // base file infomation array |
|||
|
|||
$(function () { |
|||
// read sessionStorage |
|||
var oscip = sessionStorage.getItem("scip"); |
|||
var otip = sessionStorage.getItem("tscip"); |
|||
if (oscip != "" || otip != '') { |
|||
$("input[name='sip']").val(oscip); |
|||
$("input[name='tsip']").val(otip); |
|||
} |
|||
// click function SOURCE SERVER |
|||
$("#entsip").on("click", function () { |
|||
scfs("ss"); |
|||
}) |
|||
|
|||
|
|||
// 目标服务器的文件信息 |
|||
// st 源站 或 目标站 |
|||
var scfs = function (st) { |
|||
// |
|||
scip = $("input[name='sip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("scip", scip); |
|||
//监视目录 |
|||
var jsdir = $("input[name='sdir']").val(); |
|||
if (jsdir != '') { |
|||
urlpath = bsrqst(jsdir) |
|||
//urlpath = encodeURIComponent(btoa(jsdir)); |
|||
} else { |
|||
urlpath = bsrqst(".") |
|||
} |
|||
// 输入框也显示东西 |
|||
$("input[name='sdir']").val(urlpath); |
|||
$("input[name='tsdir']").val(urlpath) |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|||
$("#ssip").text("源站(" + scip + ")"); |
|||
|
|||
// 获取信息 |
|||
gescinfo("#scsc", scip, urlpath,st); |
|||
|
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// button click function for TARGET SERVER |
|||
$("#tentsip").on("click", function () { |
|||
$("#mbip").text("目标站(" + scip + ")"); |
|||
tgfs("tg"); |
|||
}) |
|||
|
|||
// 目标服务器的文件信息 |
|||
var tgfs = function (st) { |
|||
tsip = $("input[name='tsip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("tscip", tsip); |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入目标服务器" + tsip + "</li>"; |
|||
// 目标站 |
|||
$("#mbip").text("目标站(" + tsip + ")"); |
|||
// 获取信息 |
|||
gescinfo("#tgsc", tsip, urlpath,st); |
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// 获取目标服务器的信息 |
|||
var gescinfo = function (elemnt, scip, upath,st) { |
|||
upath = upath.replace("/\\/g", "\/"); |
|||
var url=""; // 客户端的状态地址 |
|||
if(scip=='' || scip=='127.0.0.1' || scip=="localhost"){ |
|||
url="./sc?p="+upath; |
|||
}else{ |
|||
url = "http://" + scip + ":9099/sc?p=" + upath; |
|||
} |
|||
// |
|||
var html = ""; |
|||
$.getJSON(url, function (res) { |
|||
// |
|||
var chgflag; |
|||
$.each(res.data.list, function (k, v) { |
|||
// 不存在这个字段的话 |
|||
if(typeof(v.rehash) != 'undefined'){ |
|||
chgflag = "" |
|||
} |
|||
// 判读是否存在 变化 |
|||
if (!v.dirflag) { |
|||
// hash相同,未修改 |
|||
chgflag = v.rehash == v.hash ? " nochage" : " hschange"; |
|||
} else { |
|||
chgflag = "" |
|||
} |
|||
|
|||
// |
|||
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">"; |
|||
html += "<input type=\"checkbox\" class="+st+'mfile'+" name=\"sfiles\" value=" + v.fname + " />"; |
|||
if (v.dirflag) { //如果是文件夹 |
|||
html += "<span class=\"icon folder-icon\"></span>" ; |
|||
html += v.fname |
|||
// html += "<a href=\"javascript:void(0);\" onclick='"+getDirList(elemnt, scip,v.fname)+"'>"+v.fname +"</a>"; |
|||
html += "</div>"; |
|||
} else { |
|||
|
|||
|
|||
html += "<span class=\"icon file-icon\"></span>" + |
|||
"<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='" |
|||
+ v.rehash + "'>" |
|||
+ v.fname + "</a></div>"; |
|||
|
|||
} |
|||
|
|||
// if (v.isbackup == 1) { |
|||
// html += "<div class=\"col-md-2\"><a href=\"#\" class=\"btn btn-warning btn-sm\">恢复</a></div>"; |
|||
// } else { |
|||
// html += "<div class=\"col-md-2\"></div>"; |
|||
// } |
|||
|
|||
html += "</li>"; |
|||
}) |
|||
// append to html |
|||
html += "<input type='hidden' name='curpath' value='"+upath+"'>"; |
|||
if(st=="tg"){ |
|||
html += "<input type='hidden' name='serverip' value='"+scip+"'>"; |
|||
}else{ |
|||
html += "<input type='hidden' name='serverip' value='192.168.66.16'>"; |
|||
} |
|||
|
|||
// $("#tgsc").html(html) |
|||
$(elemnt).html(html); |
|||
writelog(scip + "获取数据:" + res.data.list.length + "条数据") |
|||
// 客户端监控目录 |
|||
$(elemnt).parent().find(".sc01").text(res.workdir) |
|||
$(elemnt).parent().find(".sc02").text(dbsresp(res.curdir)) |
|||
}); |
|||
} |
|||
|
|||
// write log |
|||
var writelog = function (html) { |
|||
var hprex = "<li class=\"list-group-item\">" + html + "</li>"; |
|||
$("#rstatus").append(hprex); |
|||
} |
|||
|
|||
//全选按钮设置点击事件 |
|||
$("#slall").click(function () { |
|||
let st = $(this).data("st"); |
|||
//1、循环设置其它多选框选中状态,跟标识用的变量一样 |
|||
$("."+st+"mfile").prop("checked", chkall); |
|||
// down button toggle |
|||
if (chkall || chknum > 2) { |
|||
chknum += 1 |
|||
} else { |
|||
chknum -= 1 |
|||
} |
|||
//2、标识的变量取反 |
|||
chkall = !chkall; |
|||
}) |
|||
|
|||
//同步操作 |
|||
$("#sybtn").on("click", function () { |
|||
// var st = $(this).data("st") |
|||
// $(".ssform").submit(); |
|||
// var ss = $("."+st+"mfile").hasClass("checked").val() |
|||
// console.log(ss) |
|||
// 获取选中的文件 或者文件夹 |
|||
// chkarr.push($("input[name='sfiles[]']:checked").val()); |
|||
|
|||
// console.log(chkarr) |
|||
// var ss = $("input[name='sfiles[]']:checked").val(); |
|||
//var ss = $(".mfile").has("checked").val() |
|||
// console.log(ss) |
|||
var ttsip = $("input[name='tsip']").val(); |
|||
if (ttsip == "") { |
|||
alert("老天鹅,你还没填写目标服务器地址。"); |
|||
} else { |
|||
|
|||
// 提交表单 |
|||
$(".ssform").submit(); |
|||
} |
|||
|
|||
}); |
|||
|
|||
// 勾选是否同步的选项 |
|||
$("#sw_sybtn").on("click", function () { |
|||
let swval = $(this).has("checked").val(); |
|||
// 设置相反的值 |
|||
alert(swval); |
|||
}); |
|||
|
|||
//base64 编码防止请求错误 |
|||
var bsrqst = function (path) { |
|||
return encodeURIComponent(btoa(path)); |
|||
} |
|||
//解码base64 |
|||
var dbsresp = function (bsStr) { |
|||
// console.log("respone base64 string ", bsStr) |
|||
if (bsStr == ".") { |
|||
return "." |
|||
} else { |
|||
return decodeURIComponent(atob(bsStr)) |
|||
} |
|||
} |
|||
// 另外的base64的解码 |
|||
function safeAtob(base64Str) { |
|||
// 检查输入字符串是否是有效的Base64编码 |
|||
const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/; |
|||
if (!base64Regex.test(base64Str)) { |
|||
throw new Error('The string to be decoded is not correctly encoded.'); |
|||
} |
|||
|
|||
// 如果输入字符串长度不是4的倍数,添加等号'=' |
|||
while (base64Str.length % 4 !== 0) { |
|||
base64Str += '='; |
|||
} |
|||
|
|||
return atob(base64Str); |
|||
} |
|||
|
|||
|
|||
}); |
|||
</script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,429 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<title>文件更新控制台</title> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|||
<link rel="stylesheet" href="./static/css/bootstrap.css"> |
|||
<link rel="icon" type="image/x-icon" href="/favicon.ico?v=2"> |
|||
<script type="text/javascript" src="./static/js/jquery.min.js"></script> |
|||
<script type="text/javascript" src="./static/js/bootstrap.min.js"></script> |
|||
<style> |
|||
.list-group>.list-group-item { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.optzone { |
|||
height: 60px; |
|||
} |
|||
|
|||
.stabox { |
|||
height: 260px; |
|||
overflow: scroll; |
|||
} |
|||
|
|||
.flist { |
|||
height: 360px; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.icon { |
|||
display: inline-block; |
|||
width: 24px; |
|||
height: 24px; |
|||
} |
|||
|
|||
.hsval { |
|||
font-size: 10px; |
|||
margin-left: 16px; |
|||
} |
|||
|
|||
.hschange { |
|||
/* background-color: #dabd16; */ |
|||
background: linear-gradient(0deg, #dabd16 60%, transparent 20%); |
|||
} |
|||
|
|||
.hschange a { |
|||
color: #fff !important; |
|||
} |
|||
|
|||
.hschange .icon:hover { |
|||
cursor: pointer; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.folder-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xMCA0SDRDMi45IDQgMiA0LjkgMiA2VjE4QzIgMTkuMSAyLjkgMjAgNCAyMEgyMEMyMS4xIDIwIDIyIDE5LjEgMjIgMThWOEMyMiA2LjkgMjEuMSA2IDIwIDZIMTJMMTAgNFoiIC8+PC9zdmc+"); |
|||
background-color: #c1972e; |
|||
|
|||
} |
|||
|
|||
.file-icon { |
|||
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
-webkit-mask-imagee: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyAgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pZFlNaWQgbWVldCcgIHZpZXdCb3g9IjAgMCAyNCAyNCIgPjxwYXRoIGQ9Ik0xNCAySDZDNC45IDIgNCAyLjkgNCA0VjIwQzQgMjEuMSA0LjkgMjIgNiAyMkgxOEMxOS4xIDIyIDIwIDIxLjEgMjAgMjBWOEwxNCAyTTEzIDlWMy41TDE4LjUgOUgxM1oiIC8+IDwvc3ZnPg=="); |
|||
background-repeat: no-repeat; |
|||
background-color: #0e0b8b; |
|||
} |
|||
|
|||
#rstatus { |
|||
height: 360px; |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.nav { |
|||
background-color: #ccc; |
|||
padding-top: 12px; |
|||
} |
|||
|
|||
.sticky { |
|||
position: fixed; |
|||
width: 100%; |
|||
left: 0; |
|||
bottom: 0; |
|||
z-index: 9; |
|||
border-top: 0; |
|||
background-color: #fff !important; |
|||
padding: 10px 0px; |
|||
border-bottom: none; |
|||
box-shadow: 0 10px 30px -10px rgb(0 64 128/20%); |
|||
} |
|||
</style> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<div class="jumbotron"> |
|||
<div class="container"> |
|||
<p>文件更新控制台</p> |
|||
<p>ver:3.04</p> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 输入服务器ip --> |
|||
<div class="container"> |
|||
|
|||
<div class="form-group col-md-6" style="display: none;"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">服务器ip</div> |
|||
<input type="text" class="form-control" name="sip" id="scip" value="0.0.0.0" |
|||
placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group col-md-10"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">监视目录</div> |
|||
<input type="text" class="form-control" name="sdir" placeholder="空白查询根目录.eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group col-md-2"> |
|||
<button type="button" id="scbtn" class="btn btn-primary">查看文件信息</button> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 目标服务器配置信息 --> |
|||
<div class="container"> |
|||
|
|||
<!-- 目标的服务器信息 --> |
|||
<div class="form-group col-md-4"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">目标ip</div> |
|||
<input type="text" class="form-control" name="tsip" id="tcip" placeholder="eg:192.168.66.99"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group col-md-4"> |
|||
<div class="input-group "> |
|||
<div class="input-group-addon">目标目录</div> |
|||
<input type="text" class="form-control" name="tsdir" id="" placeholder="eg :/www/wwwroot/aa_com/" /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group col-md-4"> |
|||
<div class="input-group"> |
|||
<div class="input-group-addon">来源ip</div> |
|||
<input type="text" class="form-control" name="masterip" readonly id="masteripd" value="" /> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 罗列文件的列表信息 --> |
|||
<div class="container" id="scfzone"> |
|||
<!-- 源服务器 --> |
|||
<div class="col-md-12"> |
|||
<div class="panel panel-default"> |
|||
<!-- Default panel contents --> |
|||
<div class="panel-heading" id="ssip">源站</div> |
|||
<div class="panel-body"> |
|||
<p>监听目录:<span class="sc01"></span></p> |
|||
<p>相对目录: <span class="sc02"></span> </p> |
|||
<div class="col-md-12"> |
|||
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall" data-st="ss">全选</a> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- List group --> |
|||
<form action="/sendZip" method="post" class="ssform"> |
|||
<ul class="list-group" id="scsc"></ul> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 状态信息 --> |
|||
<div class="container"> |
|||
<div class="col-md-12"> |
|||
<p>1、获取远程服务器的文件信息,2、校验hash值3、枚举出所有hash不同的文件4、勾选文件更新即可5、根据勾选的文件制作更新zip文件,发送到目标服务器。文件的参考HASH值,如何同步到几个平台?</p> |
|||
</div> |
|||
<div class="panel"> |
|||
<div class="panel-heading">运行状态</div> |
|||
<div class="panel-body"> |
|||
<ul class="list-group" id="rstatus"></ul> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<!-- 提交按钮 --> |
|||
<div class="nav"> |
|||
<div class="container"> |
|||
<!-- submit --> |
|||
<div class="col-md-12"> |
|||
<div class="form-group"> |
|||
<button class="btn btn-info btn-sm" onclick="dosync()">同步选中的文件</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
// add sticky 滚动黏贴效果 |
|||
$(document).ready(function () { |
|||
// grab the initial top offset of the navigation |
|||
// var stickyNavTop = $('.nav').offset().top; |
|||
var stickyNavTop = $('.nav').offset().top; |
|||
// console.log(stickyNavTop) |
|||
|
|||
// our function that decides weather the navigation bar should have "fixed" css position or not. |
|||
var stickyNav = function () { |
|||
var scrollTop = $(window).scrollTop(); // our current vertical position from the top |
|||
|
|||
// if we've scrolled more than the navigation, change its position to fixed to stick to top, |
|||
// otherwise change it back to relative |
|||
if (scrollTop < stickyNavTop) { |
|||
$('.nav').addClass('sticky'); |
|||
} else { |
|||
$('.nav').removeClass('sticky'); |
|||
} |
|||
}; |
|||
|
|||
stickyNav(); |
|||
// and run it again every time you scroll |
|||
$(window).scroll(function () { |
|||
stickyNav(); |
|||
}); |
|||
}) |
|||
</script> |
|||
<script type="text/javascript"> |
|||
// 控制全选与否 |
|||
var chkall = true; |
|||
var chknum = 0; |
|||
|
|||
var tgip = ""; //目标服务器ip |
|||
var masterip = ""; // 主控地址 |
|||
var urlpath = ".";// 当前的操作目录 |
|||
var chkarr = new Array; //选中的文件或目录 |
|||
//var bfsarr = new Array; // base file infomation array |
|||
|
|||
$(function () { |
|||
// read sessionStorage 当前 |
|||
var oscip = sessionStorage.getItem("scip"); |
|||
if (oscip != "" ) { |
|||
$("input[name='sip']").val(oscip); |
|||
} |
|||
|
|||
// 目标服务器的文件信息 |
|||
// st 源站 或 目标站 |
|||
var scfs = function (st) { |
|||
// |
|||
scip = $("input[name='sip']").val(); |
|||
// ip storage |
|||
sessionStorage.setItem("scip", scip); |
|||
//监视目录 |
|||
var jsdir = $("input[name='sdir']").val(); |
|||
if (jsdir != '') { |
|||
urlpath = bsrqst(jsdir) |
|||
//urlpath = encodeURIComponent(btoa(jsdir)); |
|||
} else { |
|||
urlpath = bsrqst(".") |
|||
} |
|||
// 输入框也显示东西 |
|||
$("input[name='sdir']").val(urlpath); |
|||
// |
|||
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|||
$("#ssip").text("源站(" + scip + ")"); |
|||
|
|||
// 获取信息 |
|||
gescinfo("#scsc", scip, urlpath, st); |
|||
|
|||
// |
|||
$("#rstatus").append(html); |
|||
} |
|||
|
|||
// button click function for TARGET SERVER |
|||
$("#scbtn").on("click", function () { |
|||
$("#mbip").text("目标站(" + scip + ")"); |
|||
// 检查目标ip 是否已经输入 |
|||
var ttsip = $("input[name='tsip']").val(); |
|||
if(ttsip==""){ |
|||
alert("输入目标ip信息"); |
|||
return false; |
|||
}else{ |
|||
localStorage.setItem("tgip",ttsip); |
|||
tgip = ttsip |
|||
scfs("ss"); |
|||
} |
|||
|
|||
}) |
|||
|
|||
// 获取目标服务器的信息 |
|||
var gescinfo = function (elemnt, scip, upath, st) { |
|||
// |
|||
upath = upath.replace("/\\/g", "\/"); |
|||
var url = ""; // 客户端的状态地址 |
|||
if (scip == '' || scip == "0.0.0.0" || scip == '127.0.0.1' || scip == "localhost") { |
|||
url = "./sc?p=" + upath; |
|||
} else { |
|||
url = "http://" + scip + ":9099/sc?p=" + upath; |
|||
} |
|||
|
|||
// |
|||
var html = ""; |
|||
$.getJSON(url, function (res) { |
|||
// 主控ip |
|||
// masterip = res.hostid |
|||
$("#masteripd").val(res.hostip) |
|||
// |
|||
var chgflag; |
|||
$.each(res.data.list, function (k, v) { |
|||
// 不存在这个字段的话 |
|||
if (typeof (v.rehash) != 'undefined') { |
|||
chgflag = "" |
|||
} |
|||
// 判读是否存在 变化 |
|||
if (!v.dirflag) { |
|||
// hash相同,未修改 |
|||
chgflag = v.rehash == v.hash ? " nochage" : " hschange"; |
|||
} else { |
|||
chgflag = "" |
|||
} |
|||
|
|||
// |
|||
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">"; |
|||
html += "<input type=\"checkbox\" class=" + st + 'mfile' + " name=\"sfiles\" value=" + v.fname + " />"; |
|||
if (v.dirflag) { //如果是文件夹 |
|||
html += "<span class=\"icon folder-icon\"></span>"; |
|||
html += v.fname |
|||
// html += "<a href=\"javascript:void(0);\" onclick='"+getDirList(elemnt, scip,v.fname)+"'>"+v.fname +"</a>"; |
|||
html += "</div>"; |
|||
} else { |
|||
|
|||
|
|||
html += "<span class=\"icon file-icon\"></span>" + |
|||
"<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='" |
|||
+ v.rehash + "'>" |
|||
+ v.fname + "</a></div>"; |
|||
|
|||
} |
|||
|
|||
html += "</li>"; |
|||
}) |
|||
// append to html |
|||
html += "<input type='hidden' name='curpath' value='" + upath + "'>"; |
|||
html += "<input type='hidden' name='serverip' value='" + tgip + "'>"; |
|||
// if (st == "tg") { |
|||
// html += "<input type='hidden' name='serverip' value='" + scip + "'>"; |
|||
// } else { |
|||
// html += "<input type='hidden' name='serverip' value='" + masterip + "'>"; |
|||
// } |
|||
|
|||
// $("#tgsc").html(html) |
|||
$(elemnt).html(html); |
|||
writelog(scip + "获取数据:" + res.data.list.length + "条数据") |
|||
// 客户端监控目录 |
|||
$(elemnt).parent().find(".sc01").text(res.workdir) |
|||
$(elemnt).parent().find(".sc02").text(dbsresp(res.curdir)) |
|||
}); |
|||
} |
|||
|
|||
// write log |
|||
var writelog = function (html) { |
|||
var hprex = "<li class=\"list-group-item\">" + html + "</li>"; |
|||
$("#rstatus").append(hprex); |
|||
} |
|||
|
|||
//全选按钮设置点击事件 |
|||
$("#slall").click(function () { |
|||
let st = $(this).data("st"); |
|||
//1、循环设置其它多选框选中状态,跟标识用的变量一样 |
|||
$("." + st + "mfile").prop("checked", chkall); |
|||
// down button toggle |
|||
if (chkall || chknum > 2) { |
|||
chknum += 1 |
|||
} else { |
|||
chknum -= 1 |
|||
} |
|||
//2、标识的变量取反 |
|||
chkall = !chkall; |
|||
}) |
|||
|
|||
|
|||
|
|||
//base64 编码防止请求错误 |
|||
var bsrqst = function (path) { |
|||
return encodeURIComponent(btoa(path)); |
|||
} |
|||
//解码base64 |
|||
var dbsresp = function (bsStr) { |
|||
// console.log("respone base64 string ", bsStr) |
|||
if (bsStr == ".") { |
|||
return "." |
|||
} else { |
|||
return decodeURIComponent(atob(bsStr)) |
|||
} |
|||
} |
|||
// 另外的base64的解码 |
|||
function safeAtob(base64Str) { |
|||
// 检查输入字符串是否是有效的Base64编码 |
|||
const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/; |
|||
if (!base64Regex.test(base64Str)) { |
|||
throw new Error('The string to be decoded is not correctly encoded.'); |
|||
} |
|||
|
|||
// 如果输入字符串长度不是4的倍数,添加等号'=' |
|||
while (base64Str.length % 4 !== 0) { |
|||
base64Str += '='; |
|||
} |
|||
|
|||
return atob(base64Str); |
|||
} |
|||
|
|||
|
|||
}); |
|||
|
|||
//同步操作 |
|||
var dosync = function () { |
|||
// var ttsip = $("input[name='tsip']").val(); |
|||
if (tgip == "") { |
|||
alert("老天鹅,你还没填写目标服务器地址。"); |
|||
} else { |
|||
// 提交表单 |
|||
$(".ssform").submit(); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
|
|||
</html> |
|||
File diff suppressed because one or more lines are too long
@ -1,36 +0,0 @@ |
|||
@charset "UTF-8"; |
|||
/* |
|||
* jQuery File Upload Plugin CSS 1.3.0 |
|||
* https://github.com/blueimp/jQuery-File-Upload |
|||
* |
|||
* Copyright 2013, Sebastian Tschan |
|||
* https://blueimp.net |
|||
* |
|||
* Licensed under the MIT license: |
|||
* http://www.opensource.org/licenses/MIT |
|||
*/ |
|||
|
|||
.fileinput-button { |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.fileinput-button input { |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
margin: 0; |
|||
opacity: 0; |
|||
-ms-filter: 'alpha(opacity=0)'; |
|||
font-size: 200px; |
|||
direction: ltr; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
/* Fixes for IE < 8 */ |
|||
@media screen\9 { |
|||
.fileinput-button input { |
|||
filter: alpha(opacity=0); |
|||
font-size: 100%; |
|||
height: 100%; |
|||
} |
|||
} |
|||
@ -1,97 +0,0 @@ |
|||
.row-file { |
|||
height: 40px; |
|||
} |
|||
|
|||
.column-icon { |
|||
width: 40px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.column-name { |
|||
} |
|||
|
|||
.column-size { |
|||
width: 100px; |
|||
text-align: right; |
|||
} |
|||
|
|||
.column-move { |
|||
width: 40px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.column-delete { |
|||
width: 40px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.column-path { |
|||
} |
|||
|
|||
.column-progress { |
|||
width: 200px; |
|||
} |
|||
|
|||
.footer { |
|||
color: #999; |
|||
text-align: center; |
|||
font-size: 0.9em; |
|||
} |
|||
|
|||
#reload { |
|||
float: right; |
|||
} |
|||
|
|||
#create-input { |
|||
width: 50%; |
|||
height: 20px; |
|||
} |
|||
|
|||
#move-input { |
|||
width: 80%; |
|||
height: 20px; |
|||
} |
|||
|
|||
/* Bootstrap overrides */ |
|||
|
|||
.btn:focus { |
|||
outline: none; |
|||
} |
|||
|
|||
.btn-toolbar { |
|||
margin-top: 30px; |
|||
margin-bottom: 20px; |
|||
} |
|||
|
|||
.table .progress { |
|||
margin-top: 0px; |
|||
margin-bottom: 0px; |
|||
height: 16px; |
|||
} |
|||
|
|||
.panel-default > .panel-heading { |
|||
color: #555; |
|||
} |
|||
|
|||
.breadcrumb { |
|||
background-color: transparent; |
|||
border-radius: 0px; |
|||
margin-bottom: 0px; |
|||
padding: 0px; |
|||
} |
|||
|
|||
.breadcrumb > .active { |
|||
color: #555; |
|||
} |
|||
|
|||
.breadcrumb > li + li:before { |
|||
color: #999; |
|||
} |
|||
|
|||
.table > tbody > tr > td { |
|||
vertical-align: middle; |
|||
} |
|||
|
|||
.table > tbody > tr > td > p { |
|||
margin: 0px; |
|||
} |
|||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@ |
|||
{"fontSize":"13px","theme":"monokai"} |
|||
@ -1,8 +0,0 @@ |
|||
define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f,l=!1,c=!1,h=!1,p="",d="",v="",m=0,g=0,y=0,b=0,w=0,E=0,S=0,x,T=0,N=0,C=[],k=!1,L,A=!1,O=!1,M=!1,_=!1,D={0:0},P=[],H=function(){f&&f.value&&f.type!=="string.regexp"&&(f.value=f.value.trim())},B=function(){p=p.replace(/ +$/,"")},j=function(){p=p.trimRight(),l=!1};while(s!==null){T=n.getCurrentTokenRow(),C=n.$rowTokens,f=n.stepForward();if(typeof s!="undefined"){d=s.value,w=0,M=v==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(O=!0,f&&(_=a.indexOf(f.value)!==-1),d==="</"&&(_&&!l&&N<1&&N++,M&&(N=1),w=1,_=!1)):i(s,"tag-close")?O=!1:i(s,"comment.start")?_=!0:i(s,"comment.end")&&(_=!1),!O&&!N&&s.type==="paren.rparen"&&s.value.substr(0,1)==="}"&&N++,T!==x&&(N=T,x&&(N-=x));if(N){j();for(;N>0;N--)p+="\n";l=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(d=d.trimLeft())}if(d){s.type==="keyword"&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(P[m]=d,H(),h=!0,d.match(/^(else|elseif)$/)&&p.match(/\}[\s]*$/)&&(j(),c=!0)):s.type==="paren.lparen"?(H(),d.substr(-1)==="{"&&(h=!0,A=!1,O||(N=1)),d.substr(0,1)==="{"&&(c=!0,p.substr(-1)!=="["&&p.trimRight().substr(-1)==="["?(j(),c=!1):p.trimRight().substr(-1)===")"?j():B())):s.type==="paren.rparen"?(w=1,d.substr(0,1)==="}"&&(P[m-1]==="case"&&w++,p.trimRight().substr(-1)==="{"?j():(c=!0,M&&(N+=2))),d.substr(0,1)==="]"&&p.substr(-1)!=="}"&&p.trimRight().substr(-1)==="}"&&(c=!1,b++,j()),d.substr(0,1)===")"&&p.substr(-1)!=="("&&p.trimRight().substr(-1)==="("&&(c=!1,b++,j()),B()):s.type!=="keyword.operator"&&s.type!=="keyword"||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&d===";"?(j(),H(),h=!0,M&&N++):s.type==="punctuation.operator"&&d.match(/^(:|,)$/)?(j(),H(),d.match(/^(,)$/)&&S>0&&E===0?N++:(h=!0,l=!1)):s.type==="support.php_tag"&&d==="?>"&&!l?(j(),c=!0):i(s,"attribute-name")&&p.substr(-1).match(/^\s$/)?c=!0:i(s,"attribute-equals")?(B(),H()):i(s,"tag-close")&&(B(),d==="/>"&&(c=!0)):(j(),H(),c=!0,h=!0);if(l&&(!s.type.match(/^(comment)$/)||!!d.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!d.substr(0,1).match(/^['"]$/))){b=y;if(m>g){b++;for(L=m;L>g;L--)D[L]=b}else m<g&&(b=D[m]);g=m,y=b,w&&(b-=w),A&&!E&&(b++,A=!1);for(L=0;L<b;L++)p+=o}s.type==="keyword"&&d.match(/^(case|default)$/)&&(P[m]=d,m++),s.type==="keyword"&&d.match(/^(break)$/)&&P[m-1]&&P[m-1].match(/^(case|default)$/)&&m--,s.type==="paren.lparen"&&(E+=(d.match(/\(/g)||[]).length,S+=(d.match(/\{/g)||[]).length,m+=d.length),s.type==="keyword"&&d.match(/^(if|else|elseif|for|while)$/)?(A=!0,E=0):!E&&d.trim()&&s.type!=="comment"&&(A=!1);if(s.type==="paren.rparen"){E-=(d.match(/\)/g)||[]).length,S-=(d.match(/\}/g)||[]).length;for(L=0;L<d.length;L++)m--,d.substr(L,1)==="}"&&P[m]==="case"&&m--}c&&!l&&(B(),p.substr(-1)!=="\n"&&(p+=" ")),p+=d,h&&(p+=" "),l=!1,c=!1,h=!1;if(i(s,"tag-close")&&(_||a.indexOf(v)!==-1)||i(s,"doctype")&&d===">")_&&f&&f.value==="</"?N=-1:N=1;i(s,"tag-open")&&d==="</"?m--:i(s,"tag-open")&&d==="<"&&u.indexOf(f.value)===-1?m++:i(s,"tag-name")?v=d:i(s,"tag-close")&&d==="/>"&&u.indexOf(v)===-1&&m--,x=T}}s=f}p=p.trim(),e.doc.setValue(p)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]}); (function() { |
|||
window.require(["ace/ext/beautify"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}); (function() { |
|||
window.require(["ace/ext/elastic_tabstops_lite"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
; (function() { |
|||
window.require(["ace/ext/error_marker"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1}); (function() { |
|||
window.require(["ace/ext/linking"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],BatchFile:["bat|cmd"],Bro:["bro"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Crystal:["cr"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nix:["nix"],Nim:["nim"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP_Laravel_blade:["blade.php"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Puppet:["epp|pp"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["latte|twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}}); (function() { |
|||
window.require(["ace/ext/modelist"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/ext/rtl",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function a(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function f(e,t){var n=t.session;n.$bidiHandler.currentRow=null;if(n.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var r=e.start.row;r<e.end.row;r++)n.getLine(r+1).charAt(0)!==n.$bidiHandler.RLE&&(n.doc.$lines[r+1]=n.$bidiHandler.RLE+n.getLine(r+1))}function l(e,t){var n=t.session,r=n.$bidiHandler,i=t.$textLayer.$lines.cells,s=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;r&&r.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=s):(t.direction="",t.textAlign="",t.width="")})}function c(e){function n(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var t=e.$textLayer.$lines;t.cells.forEach(n),t.cellCache.forEach(n)}var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],o=e("../editor").Editor;e("../config").defineOptions(o.prototype,"editor",{rtlText:{set:function(e){e?(this.on("change",f),this.on("changeSelection",u),this.renderer.on("afterRender",l),this.commands.on("exec",a),this.commands.addCommands(s)):(this.off("change",f),this.off("changeSelection",u),this.renderer.off("afterRender",l),this.commands.off("exec",a),this.commands.removeCommands(s),c(this.renderer)),this.renderer.updateFull()}},rtl:{set:function(e){this.session.$bidiHandler.$isRtl=e,e?(this.setOption("rtlText",!1),this.renderer.on("afterRender",l),this.session.$bidiHandler.seenBidi=!0):(this.renderer.off("afterRender",l),c(this.renderer)),this.renderer.updateFull()}}})}); (function() { |
|||
window.require(["ace/ext/rtl"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}); (function() { |
|||
window.require(["ace/ext/spellcheck"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),t.Split=f}),define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")}); (function() { |
|||
window.require(["ace/ext/split"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";function f(e){this.type=e,this.style={},this.textContent=""}var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;contain: none;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom"),a=e("../lib/lang").escapeHTML;f.prototype.cloneNode=function(){return this},f.prototype.appendChild=function(e){this.textContent+=e.toString()},f.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")};var l={createTextNode:function(e,t){return a(e)},createElement:function(e){return new f(e)},createFragment:function(){return new f("fragment")}},c=function(){this.config={},this.dom=l};c.prototype=i.prototype;var h=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l<e.childNodes.length;l++){var c=e.childNodes[l];c.nodeType==3?(f+=c.data.length,o+=c.data):a.push(f,c)}}else o=e.textContent,t.trim&&(o=o.trim());h.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};h.render=function(e,t,n,i,s,u){function c(){var r=h.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,f=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||c()}));var l;return t&&typeof t=="object"&&!t.getTokenizer&&(l=t,t=l.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!f[t]||l)f[t]=new e.Mode(l);t=f[t],--a||c()})),--a||c()},h.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var a=new c;a.setSession(u),Object.keys(a.$tabStrings).forEach(function(e){if(typeof a.$tabStrings[e]=="string"){var t=l.createFragment();t.textContent=a.$tabStrings[e],a.$tabStrings[e]=t}}),u.setValue(e);var f=u.getLength(),h=l.createElement("div");h.className=n.cssClass;var p=l.createElement("div");p.className="ace_static_highlight"+(o?"":" ace_show_gutter"),p.style["counter-reset"]="ace_line "+(i-1);for(var d=0;d<f;d++){var v=l.createElement("div");v.className="ace_line";if(!o){var m=l.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",v.appendChild(m)}a.$renderLine(v,d,!1),v.textContent+="\n",p.appendChild(v)}return h.appendChild(p),{css:s+n.cssText,html:h.toString(),session:u}},n.exports=h,n.exports.highlight=h}); (function() { |
|||
window.require(["ace/ext/static_highlight"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s}); (function() { |
|||
window.require(["ace/ext/statusbar"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]}); (function() { |
|||
window.require(["ace/ext/whitespace"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword.command.dosbatch",regex:"\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b",caseInsensitive:!0},{token:"keyword.control.statement.dosbatch",regex:"\\b(?:goto|call|exit)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.if.dosbatch",regex:"\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.dosbatch",regex:"\\b(?:if|else)\\b",caseInsensitive:!0},{token:"keyword.control.repeat.dosbatch",regex:"\\bfor\\b",caseInsensitive:!0},{token:"keyword.operator.dosbatch",regex:"\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b"},{token:["doc.comment","comment"],regex:"(?:^|\\b)(rem)($|\\s.*$)",caseInsensitive:!0},{token:"comment.line.colons.dosbatch",regex:"::.*$"},{include:"variable"},{token:"punctuation.definition.string.begin.shell",regex:'"',push:[{token:"punctuation.definition.string.end.shell",regex:'"',next:"pop"},{include:"variable"},{defaultToken:"string.quoted.double.dosbatch"}]},{token:"keyword.operator.pipe.dosbatch",regex:"[|]"},{token:"keyword.operator.redirect.shell",regex:"&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>"}],variable:[{token:"constant.numeric",regex:"%%\\w+|%[*\\d]|%\\w+%"},{token:"constant.numeric",regex:"%~\\d+"},{token:["markup.list","constant.other","markup.list"],regex:"(%)(\\w+)(%?)"}]},this.normalizeRules()};s.metaData={name:"Batch File",scopeName:"source.dosbatch",fileTypes:["bat"]},r.inherits(s,i),t.BatchFileHighlightRules=s}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./batchfile_highlight_rules").BatchFileHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="::",this.blockComment="",this.$id="ace/mode/batchfile"}.call(u.prototype),t.Mode=u}); (function() { |
|||
window.require(["ace/mode/batchfile"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/mode/ini_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s="\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})",o=function(){this.$rules={start:[{token:"punctuation.definition.comment.ini",regex:"#.*",push_:[{token:"comment.line.number-sign.ini",regex:"$|^",next:"pop"},{defaultToken:"comment.line.number-sign.ini"}]},{token:"punctuation.definition.comment.ini",regex:";.*",push_:[{token:"comment.line.semicolon.ini",regex:"$|^",next:"pop"},{defaultToken:"comment.line.semicolon.ini"}]},{token:["keyword.other.definition.ini","text","punctuation.separator.key-value.ini"],regex:"\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)"},{token:["punctuation.definition.entity.ini","constant.section.group-title.ini","punctuation.definition.entity.ini"],regex:"^(\\[)(.*?)(\\])"},{token:"punctuation.definition.string.begin.ini",regex:"'",push:[{token:"punctuation.definition.string.end.ini",regex:"'",next:"pop"},{token:"constant.language.escape",regex:s},{defaultToken:"string.quoted.single.ini"}]},{token:"punctuation.definition.string.begin.ini",regex:'"',push:[{token:"constant.language.escape",regex:s},{token:"punctuation.definition.string.end.ini",regex:'"',next:"pop"},{defaultToken:"string.quoted.double.ini"}]}]},this.normalizeRules()};o.metaData={fileTypes:["ini","conf"],keyEquivalent:"^~I",name:"Ini",scopeName:"source.ini"},r.inherits(o,i),t.IniHighlightRules=o}),define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^\s*\[([^\])]*)]\s*(?:$|[;#])/,this.getFoldWidgetRange=function(e,t,n){var r=this.foldingStartMarker,s=e.getLine(n),o=s.match(r);if(!o)return;var u=o[1]+".",a=s.length,f=e.getLength(),l=n,c=n;while(++n<f){s=e.getLine(n);if(/^\s*$/.test(s))continue;o=s.match(r);if(o&&o[1].lastIndexOf(u,0)!==0)break;c=n}if(c>l){var h=e.getLine(c).length;return new i(l,a,c,h)}}}.call(o.prototype)}),define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ini_highlight_rules","ace/mode/folding/ini"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./ini_highlight_rules").IniHighlightRules,o=e("./folding/ini").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart=";",this.blockComment=null,this.$id="ace/mode/ini"}.call(u.prototype),t.Mode=u}); (function() { |
|||
window.require(["ace/mode/ini"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant",t="true|false",n="avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",r="int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer",i=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t,"storage.type":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.SqlHighlightRules=s}),define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./sql_highlight_rules").SqlHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="--",this.$id="ace/mode/sql"}.call(o.prototype),t.Mode=o}); (function() { |
|||
window.require(["ace/mode/sql"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
; (function() { |
|||
window.require(["ace/mode/text"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/mode/verilog_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="always|and|assign|automatic|begin|buf|bufif0|bufif1|case|casex|casez|cell|cmos|config|deassign|default|defparam|design|disable|edge|else|end|endcase|endconfig|endfunction|endgenerate|endmodule|endprimitive|endspecify|endtable|endtask|event|for|force|forever|fork|function|generate|genvar|highz0|highz1|if|ifnone|incdir|include|initial|inout|input|instance|integer|join|large|liblist|library|localparam|macromodule|medium|module|nand|negedge|nmos|nor|noshowcancelled|not|notif0|notif1|or|output|parameter|pmos|posedge|primitive|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|rcmos|real|realtime|reg|release|repeat|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|showcancelled|signed|small|specify|specparam|strong0|strong1|supply0|supply1|table|task|time|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|unsigned|use|vectored|wait|wand|weak0|weak1|while|wire|wor|xnor|xorbegin|bufif0|bufif1|case|casex|casez|config|else|end|endcase|endconfig|endfunction|endgenerate|endmodule|endprimitive|endspecify|endtable|endtask|for|forever|function|generate|if|ifnone|macromodule|module|primitive|repeat|specify|table|task|while",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"//.*$"},{token:"comment.start",regex:"/\\*",next:[{token:"comment.end",regex:"\\*/",next:"start"},{defaultToken:"comment"}]},{token:"string.start",regex:'"',next:[{token:"constant.language.escape",regex:/\\(?:[ntvfa\\"]|[0-7]{1,3}|\x[a-fA-F\d]{1,2}|)/,consumeLineEnd:!0},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string",regex:"'^[']'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.VerilogHighlightRules=s}),define("ace/mode/verilog",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/verilog_highlight_rules","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./verilog_highlight_rules").VerilogHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"'},this.$id="ace/mode/verilog"}.call(u.prototype),t.Mode=u}); (function() { |
|||
window.require(["ace/mode/verilog"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/mode/yaml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"list.markup",regex:/^(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup",regex:/^\s*[\-?](?:$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword"],regex:/^(\s*\w.*?)(:(?=\s|$))/},{token:["meta.tag","keyword"],regex:/(\w+?)(\s*:(?=\s|$))/},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:/[|>][-+\d]*(?:$|\s+(?:$|#))/,onMatch:function(e,t,n,r){r=r.replace(/ #.*/,"");var i=/^ *((:\s*)?-(\s*[^|>])?)?/.exec(r)[0].replace(/\S\s*$/,"").length,s=parseInt(/\d+[\s+-]*$/.exec(r));return s?(i+=s-1,this.next="mlString"):this.next="mlStringPre",n.length?(n[0]=this.next,n[1]=i):(n.push(this.next),n.push(i)),this.token},next:"mlString"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:/(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)(?=[^\d-\w]|$)/},{token:"constant.numeric",regex:/[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/},{token:"constant.language.boolean",regex:"\\b(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:/[^\s,:\[\]\{\}]+/}],mlStringPre:[{token:"indent",regex:/^ *$/},{token:"indent",regex:/^ */,onMatch:function(e,t,n){var r=n[1];return r>=e.length?(this.next="start",n.shift(),n.shift()):(n[1]=e.length-1,this.next=n[0]="mlString"),this.token},next:"mlString"},{defaultToken:"string"}],mlString:[{token:"indent",regex:/^ *$/},{token:"indent",regex:/^ */,onMatch:function(e,t,n){var r=n[1];return r>=e.length?(this.next="start",n.splice(0)):this.next="mlString",this.token},next:"mlString"},{token:"string",regex:".+"}]},this.normalizeRules()};r.inherits(s,i),t.YamlHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++n<f){o=e.getLine(n);var h=o.search(i);if(h==-1)continue;if(o[h]!="#")break;c=n}if(c>l){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u<a?"start":"","";if(u==-1){if(i==a&&r[i]=="#"&&s[i]=="#")return e.foldWidgets[n-1]="",e.foldWidgets[n+1]="","start"}else if(u==i&&r[i]=="#"&&o[i]=="#"&&e.getLine(n-2).search(/\S/)==-1)return e.foldWidgets[n-1]="start",e.foldWidgets[n+1]="","";return u!=-1&&u<i?e.foldWidgets[n-1]="start":e.foldWidgets[n-1]="",i<a?"start":""}}.call(o.prototype)}),define("ace/mode/yaml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/yaml_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./yaml_highlight_rules").YamlHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./folding/coffee").FoldMode,a=function(){this.HighlightRules=s,this.$outdent=new o,this.foldingRules=new u,this.$behaviour=this.$defaultBehaviour};r.inherits(a,i),function(){this.lineCommentStart=["#"],this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start"){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/yaml"}.call(a.prototype),t.Mode=a}); (function() { |
|||
window.require(["ace/mode/yaml"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/snippets/apache_conf",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="apache_conf"}); (function() { |
|||
window.require(["ace/snippets/apache_conf"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/snippets/batchfile",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="batchfile"}); (function() { |
|||
window.require(["ace/snippets/batchfile"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/snippets/c_cpp",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="## STL Collections\n# std::array\nsnippet array\n std::array<${1:T}, ${2:N}> ${3};${4}\n# std::vector\nsnippet vector\n std::vector<${1:T}> ${2};${3}\n# std::deque\nsnippet deque\n std::deque<${1:T}> ${2};${3}\n# std::forward_list\nsnippet flist\n std::forward_list<${1:T}> ${2};${3}\n# std::list\nsnippet list\n std::list<${1:T}> ${2};${3}\n# std::set\nsnippet set\n std::set<${1:T}> ${2};${3}\n# std::map\nsnippet map\n std::map<${1:Key}, ${2:T}> ${3};${4}\n# std::multiset\nsnippet mset\n std::multiset<${1:T}> ${2};${3}\n# std::multimap\nsnippet mmap\n std::multimap<${1:Key}, ${2:T}> ${3};${4}\n# std::unordered_set\nsnippet uset\n std::unordered_set<${1:T}> ${2};${3}\n# std::unordered_map\nsnippet umap\n std::unordered_map<${1:Key}, ${2:T}> ${3};${4}\n# std::unordered_multiset\nsnippet umset\n std::unordered_multiset<${1:T}> ${2};${3}\n# std::unordered_multimap\nsnippet ummap\n std::unordered_multimap<${1:Key}, ${2:T}> ${3};${4}\n# std::stack\nsnippet stack\n std::stack<${1:T}> ${2};${3}\n# std::queue\nsnippet queue\n std::queue<${1:T}> ${2};${3}\n# std::priority_queue\nsnippet pqueue\n std::priority_queue<${1:T}> ${2};${3}\n##\n## Access Modifiers\n# private\nsnippet pri\n private\n# protected\nsnippet pro\n protected\n# public\nsnippet pub\n public\n# friend\nsnippet fr\n friend\n# mutable\nsnippet mu\n mutable\n## \n## Class\n# class\nsnippet cl\n class ${1:`Filename('$1', 'name')`} \n {\n public:\n $1(${2});\n ~$1();\n\n private:\n ${3:/* data */}\n };\n# member function implementation\nsnippet mfun\n ${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {\n ${5:/* code */}\n }\n# namespace\nsnippet ns\n namespace ${1:`Filename('', 'my')`} {\n ${2}\n } /* namespace $1 */\n##\n## Input/Output\n# std::cout\nsnippet cout\n std::cout << ${1} << std::endl;${2}\n# std::cin\nsnippet cin\n std::cin >> ${1};${2}\n##\n## Iteration\n# for i \nsnippet fori\n for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {\n ${4:/* code */}\n }${5}\n\n# foreach\nsnippet fore\n for (${1:auto} ${2:i} : ${3:container}) {\n ${4:/* code */}\n }${5}\n# iterator\nsnippet iter\n for (${1:std::vector}<${2:type}>::${3:const_iterator} ${4:i} = ${5:container}.begin(); $4 != $5.end(); ++$4) {\n ${6}\n }${7}\n\n# auto iterator\nsnippet itera\n for (auto ${1:i} = $1.begin(); $1 != $1.end(); ++$1) {\n ${2:std::cout << *$1 << std::endl;}\n }${3}\n##\n## Lambdas\n# lamda (one line)\nsnippet ld\n [${1}](${2}){${3:/* code */}}${4}\n# lambda (multi-line)\nsnippet lld\n [${1}](${2}){\n ${3:/* code */}\n }${4}\n",t.scope="c_cpp"}); (function() { |
|||
window.require(["ace/snippets/c_cpp"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
@ -1,8 +0,0 @@ |
|||
define("ace/snippets/csharp",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="csharp"}); (function() { |
|||
window.require(["ace/snippets/csharp"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
define("ace/snippets/django",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="# Model Fields\n\n# Note: Optional arguments are using defaults that match what Django will use\n# as a default, e.g. with max_length fields. Doing this as a form of self\n# documentation and to make it easy to know whether you should override the\n# default or not.\n\n# Note: Optional arguments that are booleans will use the opposite since you\n# can either not specify them, or override them, e.g. auto_now_add=False.\n\nsnippet auto\n ${1:FIELDNAME} = models.AutoField(${2})\nsnippet bool\n ${1:FIELDNAME} = models.BooleanField(${2:default=True})\nsnippet char\n ${1:FIELDNAME} = models.CharField(max_length=${2}${3:, blank=True})\nsnippet comma\n ${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2}${3:, blank=True})\nsnippet date\n ${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True})\nsnippet datetime\n ${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True})\nsnippet decimal\n ${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${3})\nsnippet email\n ${1:FIELDNAME} = models.EmailField(max_length=${2:75}${3:, blank=True})\nsnippet file\n ${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload}${3:, max_length=100})\nsnippet filepath\n ${1:FIELDNAME} = models.FilePathField(path=${2:\"/abs/path/to/dir\"}${3:, max_length=100}${4:, match=\"*.ext\"}${5:, recursive=True}${6:, blank=True, })\nsnippet float\n ${1:FIELDNAME} = models.FloatField(${2})\nsnippet image\n ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100})\nsnippet int\n ${1:FIELDNAME} = models.IntegerField(${2})\nsnippet ip\n ${1:FIELDNAME} = models.IPAddressField(${2})\nsnippet nullbool\n ${1:FIELDNAME} = models.NullBooleanField(${2})\nsnippet posint\n ${1:FIELDNAME} = models.PositiveIntegerField(${2})\nsnippet possmallint\n ${1:FIELDNAME} = models.PositiveSmallIntegerField(${2})\nsnippet slug\n ${1:FIELDNAME} = models.SlugField(max_length=${2:50}${3:, blank=True})\nsnippet smallint\n ${1:FIELDNAME} = models.SmallIntegerField(${2})\nsnippet text\n ${1:FIELDNAME} = models.TextField(${2:blank=True})\nsnippet time\n ${1:FIELDNAME} = models.TimeField(${2:auto_now_add=True, auto_now=True}${3:, blank=True, null=True})\nsnippet url\n ${1:FIELDNAME} = models.URLField(${2:verify_exists=False}${3:, max_length=200}${4:, blank=True})\nsnippet xml\n ${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${3:, blank=True})\n# Relational Fields\nsnippet fk\n ${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, to_field=''})\nsnippet m2m\n ${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${7:, db_table=''})\nsnippet o2o\n ${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}${3:, parent_link=True}${4:, related_name=''}${5:, limit_choices_to=}${6:, to_field=''})\n\n# Code Skeletons\n\nsnippet form\n class ${1:FormName}(forms.Form):\n \"\"\"${2:docstring}\"\"\"\n ${3}\n\nsnippet model\n class ${1:ModelName}(models.Model):\n \"\"\"${2:docstring}\"\"\"\n ${3}\n \n class Meta:\n ${4}\n \n def __unicode__(self):\n ${5}\n \n def save(self, force_insert=False, force_update=False):\n ${6}\n \n @models.permalink\n def get_absolute_url(self):\n return ('${7:view_or_url_name}' ${8})\n\nsnippet modeladmin\n class ${1:ModelName}Admin(admin.ModelAdmin):\n ${2}\n \n admin.site.register($1, $1Admin)\n \nsnippet tabularinline\n class ${1:ModelName}Inline(admin.TabularInline):\n model = $1\n\nsnippet stackedinline\n class ${1:ModelName}Inline(admin.StackedInline):\n model = $1\n\nsnippet r2r\n return render_to_response('${1:template.html}', {\n ${2}\n }${3:, context_instance=RequestContext(request)}\n )\n",t.scope="django"}); (function() { |
|||
window.require(["ace/snippets/django"], function(m) { |
|||
if (typeof module == "object" && typeof exports == "object" && module) { |
|||
module.exports = m; |
|||
} |
|||
}); |
|||
})(); |
|||
|
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue