|
|
@@ -88,17 +88,18 @@ func CloudBrainNew(ctx *context.Context) { |
|
|
|
result, err := cloudbrain.GetImages() |
|
|
|
if err != nil { |
|
|
|
ctx.Data["error"] = err.Error() |
|
|
|
log.Error("cloudbrain.GetImages failed:", err.Error()) |
|
|
|
} |
|
|
|
|
|
|
|
for i, payload := range result.Payload { |
|
|
|
if strings.HasPrefix(result.Payload[i].Place, "192.168") { |
|
|
|
result.Payload[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] |
|
|
|
for i, payload := range result.Payload.ImageInfo { |
|
|
|
if strings.HasPrefix(result.Payload.ImageInfo[i].Place, "192.168") { |
|
|
|
result.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] |
|
|
|
} else { |
|
|
|
result.Payload[i].PlaceView = payload.Place |
|
|
|
result.Payload.ImageInfo[i].PlaceView = payload.Place |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["images"] = result.Payload |
|
|
|
ctx.Data["images"] = result.Payload.ImageInfo |
|
|
|
|
|
|
|
attachs, err := models.GetAllUserAttachments(ctx.User.ID) |
|
|
|
if err != nil { |
|
|
|