You've already forked CasaOS
mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-07-15 23:54:17 +02:00
暂存
This commit is contained in:
@ -3,9 +3,9 @@
|
||||
package route
|
||||
|
||||
import (
|
||||
_ "github.com/IceWhaleTech/CasaOS/docs"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
"github.com/swaggo/gin-swagger/swaggerFiles"
|
||||
_ "oasis/docs"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -1,13 +1,13 @@
|
||||
package route
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/middleware"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/config"
|
||||
jwt2 "github.com/IceWhaleTech/CasaOS/pkg/utils/jwt"
|
||||
v1 "github.com/IceWhaleTech/CasaOS/route/v1"
|
||||
"github.com/IceWhaleTech/CasaOS/web"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/middleware"
|
||||
"oasis/pkg/config"
|
||||
jwt2 "oasis/pkg/utils/jwt"
|
||||
v1 "oasis/route/v1"
|
||||
"oasis/web"
|
||||
)
|
||||
|
||||
var swagHandler gin.HandlerFunc
|
||||
@ -19,9 +19,10 @@ func InitRouter(swagHandler gin.HandlerFunc) *gin.Engine {
|
||||
gin.SetMode(config.ServerInfo.RunMode)
|
||||
|
||||
r.StaticFS("/ui", http.FS(web.Static))
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
c.Redirect(http.StatusMovedPermanently, "ui/")
|
||||
})
|
||||
r.GET("/", WebUIHome)
|
||||
//r.GET("/", func(c *gin.Context) {
|
||||
// c.Redirect(http.StatusMovedPermanently, "ui/")
|
||||
//})
|
||||
if swagHandler != nil {
|
||||
r.GET("/swagger/*any", swagHandler)
|
||||
}
|
||||
|
14
route/ui.go
Normal file
14
route/ui.go
Normal file
@ -0,0 +1,14 @@
|
||||
package route
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/web"
|
||||
"github.com/gin-gonic/gin"
|
||||
"html/template"
|
||||
)
|
||||
|
||||
func WebUIHome(c *gin.Context) {
|
||||
c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
index, _ := template.ParseFS(web.Static, "index.html")
|
||||
index.Execute(c.Writer, nil)
|
||||
return
|
||||
}
|
@ -1,14 +1,14 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
port2 "github.com/IceWhaleTech/CasaOS/pkg/utils/port"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/sort"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/file"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
port2 "oasis/pkg/utils/port"
|
||||
"oasis/pkg/utils/sort"
|
||||
"oasis/service"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
@ -2,14 +2,14 @@ package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
ip_helper2 "github.com/IceWhaleTech/CasaOS/pkg/utils/ip_helper"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
||||
"github.com/forease/gotld"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
ip_helper2 "oasis/pkg/utils/ip_helper"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
model2 "oasis/service/model"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/shirou/gopsutil/v3/disk"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
@ -3,23 +3,23 @@ package v1
|
||||
import (
|
||||
"bytes"
|
||||
json2 "encoding/json"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/docker"
|
||||
upnp2 "github.com/IceWhaleTech/CasaOS/pkg/upnp"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
|
||||
ip_helper2 "github.com/IceWhaleTech/CasaOS/pkg/utils/ip_helper"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
port2 "github.com/IceWhaleTech/CasaOS/pkg/utils/port"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/random"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/IceWhaleTech/CasaOS/service/docker_base"
|
||||
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
||||
"github.com/IceWhaleTech/CasaOS/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/jinzhu/copier"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/docker"
|
||||
upnp2 "oasis/pkg/upnp"
|
||||
"oasis/pkg/utils/file"
|
||||
ip_helper2 "oasis/pkg/utils/ip_helper"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
port2 "oasis/pkg/utils/port"
|
||||
"oasis/pkg/utils/random"
|
||||
"oasis/service"
|
||||
"oasis/service/docker_base"
|
||||
model2 "oasis/service/model"
|
||||
"oasis/types"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -4,14 +4,14 @@ import (
|
||||
"bufio"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/file"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
@ -2,13 +2,13 @@ package v1
|
||||
|
||||
import (
|
||||
json2 "encoding/json"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/IceWhaleTech/CasaOS/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
"oasis/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
model2 "oasis/service/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
model2 "oasis/service/model"
|
||||
)
|
||||
|
||||
// @Summary 获取短链列表
|
||||
|
@ -2,15 +2,15 @@ package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/config"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/version"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
||||
"github.com/IceWhaleTech/CasaOS/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/config"
|
||||
"oasis/pkg/utils/oasis_err"
|
||||
"oasis/pkg/utils/version"
|
||||
"oasis/service"
|
||||
model2 "oasis/service/model"
|
||||
"oasis/types"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
@ -51,8 +51,10 @@ func CheckVersion(c *gin.Context) {
|
||||
// @Success 200 {string} string "ok"
|
||||
// @Router /sys/update [post]
|
||||
func SystemUpdate(c *gin.Context) {
|
||||
fmt.Println("开始更新")
|
||||
need, version := version.IsNeedUpdate()
|
||||
if need {
|
||||
fmt.Println("进入更新")
|
||||
service.MyService.System().UpdateSystemVersion(version.Version)
|
||||
}
|
||||
c.JSON(http.StatusOK, model.Result{Success: oasis_err.SUCCESS, Message: oasis_err.GetMsg(oasis_err.SUCCESS)})
|
||||
|
@ -1,13 +1,13 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
||||
"github.com/IceWhaleTech/CasaOS/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
model2 "oasis/service/model"
|
||||
"oasis/types"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
@ -2,13 +2,13 @@ package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/config"
|
||||
jwt2 "github.com/IceWhaleTech/CasaOS/pkg/utils/jwt"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/config"
|
||||
jwt2 "oasis/pkg/utils/jwt"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
)
|
||||
|
||||
var user_service service.UserService
|
||||
|
@ -2,12 +2,12 @@ package v1
|
||||
|
||||
import (
|
||||
json2 "encoding/json"
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/config"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
"oasis/pkg/config"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
)
|
||||
|
||||
// @Summary 登录zerotier获取token
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/IceWhaleTech/CasaOS/model"
|
||||
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/shirou/gopsutil/v3/disk"
|
||||
"net/http"
|
||||
"oasis/model"
|
||||
oasis_err2 "oasis/pkg/utils/oasis_err"
|
||||
"oasis/service"
|
||||
"strings"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
Reference in New Issue
Block a user