fix: 移除调试打印信息

This commit is contained in:
ssongliu
2023-03-15 12:58:56 +08:00
committed by ssongliu
parent 2462ffdbab
commit e55af04568
17 changed files with 16 additions and 35 deletions

View File

@@ -3,6 +3,14 @@ package v1
import ( import (
"errors" "errors"
"fmt" "fmt"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" "github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/app/dto/request" "github.com/1Panel-dev/1Panel/backend/app/dto/request"
@@ -14,13 +22,6 @@ import (
websocket2 "github.com/1Panel-dev/1Panel/backend/utils/websocket" websocket2 "github.com/1Panel-dev/1Panel/backend/utils/websocket"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
) )
// @Tags File // @Tags File
@@ -584,7 +585,6 @@ func (b *BaseApi) UploadChunkFiles(c *gin.Context) {
if chunkIndex+1 == chunkCount { if chunkIndex+1 == chunkCount {
err = mergeChunks(filename, fileDir, c.PostForm("path"), chunkCount) err = mergeChunks(filename, fileDir, c.PostForm("path"), chunkCount)
if err != nil { if err != nil {
fmt.Println(err.Error())
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrAppDelete, err) helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrAppDelete, err)
return return
} }

View File

@@ -134,7 +134,7 @@ func (u *BackupService) DownloadRecord(info dto.DownloadRecord) (string, error)
tempPath := fmt.Sprintf("%sdownload%s", constant.DataDir, info.FileDir) tempPath := fmt.Sprintf("%sdownload%s", constant.DataDir, info.FileDir)
if _, err := os.Stat(tempPath); err != nil && os.IsNotExist(err) { if _, err := os.Stat(tempPath); err != nil && os.IsNotExist(err) {
if err = os.MkdirAll(tempPath, os.ModePerm); err != nil { if err = os.MkdirAll(tempPath, os.ModePerm); err != nil {
fmt.Println(err) global.LOG.Errorf("mkdir %s failed, err: %v", tempPath, err)
} }
} }
targetPath := tempPath + info.FileName targetPath := tempPath + info.FileName

View File

@@ -2,7 +2,6 @@ package service
import ( import (
"context" "context"
"fmt"
"sort" "sort"
"strings" "strings"
"time" "time"
@@ -122,12 +121,8 @@ func (u *ContainerService) CreateVolume(req dto.VolumeCreat) error {
DriverOpts: stringsToMap(req.Options), DriverOpts: stringsToMap(req.Options),
Labels: stringsToMap(req.Labels), Labels: stringsToMap(req.Labels),
} }
stat, err := client.VolumeCreate(context.TODO(), options) if _, err := client.VolumeCreate(context.TODO(), options); err != nil {
if err != nil {
return err return err
} }
// if len(stat.CreatedAt) != 0 {
fmt.Println(stat)
// }
return nil return nil
} }

View File

@@ -122,7 +122,7 @@ func (u *CronjobService) Download(down dto.CronjobDownload) (string, error) {
tempPath := fmt.Sprintf("%s/download/%s", constant.DataDir, commonDir) tempPath := fmt.Sprintf("%s/download/%s", constant.DataDir, commonDir)
if _, err := os.Stat(tempPath); err != nil && os.IsNotExist(err) { if _, err := os.Stat(tempPath); err != nil && os.IsNotExist(err) {
if err = os.MkdirAll(tempPath, os.ModePerm); err != nil { if err = os.MkdirAll(tempPath, os.ModePerm); err != nil {
fmt.Println(err) global.LOG.Errorf("mkdir %s failed, err: %v", tempPath, err)
} }
} }

View File

@@ -1,7 +1,6 @@
package app package app
import ( import (
"fmt"
"path" "path"
"github.com/1Panel-dev/1Panel/backend/constant" "github.com/1Panel-dev/1Panel/backend/constant"
@@ -35,12 +34,12 @@ func createDir(fileOp files.FileOp, dirPath string) {
func createDefaultDockerNetwork() { func createDefaultDockerNetwork() {
cli, err := docker.NewClient() cli, err := docker.NewClient()
if err != nil { if err != nil {
fmt.Println("init docker client error", err.Error()) global.LOG.Errorf("init docker client error", err.Error())
return return
} }
if !cli.NetworkExist("1panel-network") { if !cli.NetworkExist("1panel-network") {
if err := cli.CreateNetwork("1panel-network"); err != nil { if err := cli.CreateNetwork("1panel-network"); err != nil {
fmt.Println("init docker client error", err.Error()) global.LOG.Errorf("init docker client error", err.Error())
return return
} }
} }

View File

@@ -1,7 +1,6 @@
package business package business
import ( import (
"fmt"
"github.com/1Panel-dev/1Panel/backend/app/service" "github.com/1Panel-dev/1Panel/backend/app/service"
"github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/global"
) )
@@ -13,7 +12,6 @@ func Init() {
return return
} }
if setting.AppStoreVersion != "" { if setting.AppStoreVersion != "" {
fmt.Println(setting.AppStoreVersion)
global.LOG.Info("do not sync") global.LOG.Info("do not sync")
return return
} }

View File

@@ -1,9 +1,6 @@
package log package log
import ( import (
"fmt"
"github.com/1Panel-dev/1Panel/backend/global"
"github.com/1Panel-dev/1Panel/backend/utils/files"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
@@ -14,6 +11,9 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"unsafe" "unsafe"
"github.com/1Panel-dev/1Panel/backend/global"
"github.com/1Panel-dev/1Panel/backend/utils/files"
) )
type Writer struct { type Writer struct {
@@ -261,7 +261,6 @@ func (w *Writer) CompressFile(logFile string) error {
comFileName := path.Base(logFile) + ".gz" comFileName := path.Base(logFile) + ".gz"
filePath := path.Dir(logFile) filePath := path.Dir(logFile)
fmt.Println(path.Dir(logFile))
if err := op.Compress([]string{logFile}, filePath, comFileName, files.Gz); err != nil { if err := op.Compress([]string{logFile}, filePath, comFileName, files.Gz); err != nil {
return err return err
} }

View File

@@ -96,7 +96,6 @@ func OperationLog() gin.HandlerFunc {
var names []string var names []string
if funcs.IsList { if funcs.IsList {
sql := fmt.Sprintf("SELECT %s FROM %s where %s in (?);", funcs.OutputColume, funcs.DB, funcs.InputColume) sql := fmt.Sprintf("SELECT %s FROM %s where %s in (?);", funcs.OutputColume, funcs.DB, funcs.InputColume)
fmt.Println(value)
_ = global.DB.Raw(sql, value).Scan(&names) _ = global.DB.Raw(sql, value).Scan(&names)
} else { } else {
_ = global.DB.Raw(fmt.Sprintf("select %s from %s where %s = ?;", funcs.OutputColume, funcs.DB, funcs.InputColume), value).Scan(&names) _ = global.DB.Raw(fmt.Sprintf("select %s from %s where %s = ?;", funcs.OutputColume, funcs.DB, funcs.InputColume), value).Scan(&names)

View File

@@ -53,7 +53,6 @@ defineProps({
const emit = defineEmits(['search', 'update:selects']); const emit = defineEmits(['search', 'update:selects']);
const condition = ref({}); const condition = ref({});
function search(conditions: any, e: any) { function search(conditions: any, e: any) {
console.log(conditions);
if (conditions) { if (conditions) {
condition.value = conditions; condition.value = conditions;
} }

View File

@@ -100,7 +100,6 @@ const props = defineProps({
const em = defineEmits(['choose']); const em = defineEmits(['choose']);
const checkFile = (row: any) => { const checkFile = (row: any) => {
console.log(row.path);
rowName.value = row.name; rowName.value = row.name;
em('choose', row.path); em('choose', row.path);
popoverVisible.value = false; popoverVisible.value = false;

View File

@@ -101,7 +101,6 @@ const get = async () => {
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.forEach((d) => { res.data.forEach((d) => {
if (d.edit) { if (d.edit) {
console.log(d.edit);
canEdit.value = true; canEdit.value = true;
} }
let value = d.value; let value = d.value;

View File

@@ -306,7 +306,6 @@ const buttons = [
{ {
label: i18n.global.t('container.rename'), label: i18n.global.t('container.rename'),
click: (row: Container.ContainerInfo) => { click: (row: Container.ContainerInfo) => {
console.log(row.name);
dialogReNameRef.value!.acceptParams({ container: row.name }); dialogReNameRef.value!.acceptParams({ container: row.name });
}, },
disabled: (row: any) => { disabled: (row: any) => {

View File

@@ -272,7 +272,6 @@ const onSubmitSave = async () => {
const loadDockerConf = async () => { const loadDockerConf = async () => {
const res = await loadDaemonJsonFile(); const res = await loadDaemonJsonFile();
if (res.data === 'daemon.json is not find in path') { if (res.data === 'daemon.json is not find in path') {
console.log(res.data);
showDaemonJsonAlert.value = true; showDaemonJsonAlert.value = true;
} else { } else {
dockerConf.value = res.data; dockerConf.value = res.data;

View File

@@ -401,7 +401,6 @@ function hasScript() {
function checkScript() { function checkScript() {
let row = dialogData.value.rowData; let row = dialogData.value.rowData;
console.log(row.specType, row.week, row.day, row.hour, row.minute);
switch (row.specType) { switch (row.specType) {
case 'perMonth': case 'perMonth':
return row.day > 0 && row.day < 32 && row.hour >= 0 && row.hour < 24 && row.minute >= 0 && row.minute < 60; return row.day > 0 && row.day < 32 && row.hour >= 0 && row.hour < 24 && row.minute >= 0 && row.minute < 60;

View File

@@ -244,7 +244,6 @@ const onChangePort = async (formEl: FormInstance | undefined) => {
if (!formEl) return; if (!formEl) return;
const result = await formEl.validateField('port', callback); const result = await formEl.validateField('port', callback);
if (!result) { if (!result) {
console.log('daqdwq');
return; return;
} }
let params = { let params = {

View File

@@ -44,7 +44,6 @@ let items = ref([]);
const acceptParams = async (props: InstallRrops) => { const acceptParams = async (props: InstallRrops) => {
items.value = props.items; items.value = props.items;
open.value = true; open.value = true;
console.log(items);
}; };
const handleClose = () => { const handleClose = () => {

View File

@@ -261,7 +261,6 @@ const changeType = (type: string) => {
if (type == 'deployemnt') { if (type == 'deployemnt') {
if (appInstalles.value && appInstalles.value.length > 0) { if (appInstalles.value && appInstalles.value.length > 0) {
website.value.appInstallId = appInstalles.value[0].id; website.value.appInstallId = appInstalles.value[0].id;
console.log(website.value);
} }
} else { } else {
website.value.appInstallId = undefined; website.value.appInstallId = undefined;