add onedrive icon

This commit is contained in:
LinkLeong 2023-08-22 05:01:40 +01:00
parent 5f1df76dbf
commit d6a9ba65ed
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,8 @@ import (
"github.com/IceWhaleTech/CasaOS/internal/driver" "github.com/IceWhaleTech/CasaOS/internal/driver"
) )
const ICONURL = "./img/driver/OneDrive.svg"
type Host struct { type Host struct {
Oauth string Oauth string
Api string Api string

View file

@ -6,6 +6,7 @@ import (
"github.com/IceWhaleTech/CasaOS-Common/utils/logger" "github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/drivers/dropbox" "github.com/IceWhaleTech/CasaOS/drivers/dropbox"
"github.com/IceWhaleTech/CasaOS/drivers/google_drive" "github.com/IceWhaleTech/CasaOS/drivers/google_drive"
"github.com/IceWhaleTech/CasaOS/drivers/onedrive"
"github.com/IceWhaleTech/CasaOS/model" "github.com/IceWhaleTech/CasaOS/model"
"github.com/IceWhaleTech/CasaOS/pkg/utils/common_err" "github.com/IceWhaleTech/CasaOS/pkg/utils/common_err"
"github.com/IceWhaleTech/CasaOS/pkg/utils/httper" "github.com/IceWhaleTech/CasaOS/pkg/utils/httper"
@ -51,6 +52,10 @@ func ListStorages(c *gin.Context) {
if dataMap["type"] == "dropbox" { if dataMap["type"] == "dropbox" {
r.MountPoints[i].Icon = dropbox.ICONURL r.MountPoints[i].Icon = dropbox.ICONURL
} }
if dataMap["type"] == "onedrive" {
r.MountPoints[i].Icon = onedrive.ICONURL
}
r.MountPoints[i].Name = dataMap["username"] r.MountPoints[i].Name = dataMap["username"]
} }
list := []httper.MountPoint{} list := []httper.MountPoint{}