@@ -1,13 +1,14 @@ | |||||
package models | package models | ||||
import ( | import ( | ||||
"code.gitea.io/gitea/modules/util" | |||||
"encoding/json" | "encoding/json" | ||||
"fmt" | "fmt" | ||||
"strconv" | "strconv" | ||||
"strings" | "strings" | ||||
"time" | "time" | ||||
"code.gitea.io/gitea/modules/util" | |||||
"xorm.io/builder" | "xorm.io/builder" | ||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
@@ -1362,7 +1363,7 @@ func CloudbrainsVersionList(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int, e | |||||
func CreateCloudbrain(cloudbrain *Cloudbrain) (err error) { | func CreateCloudbrain(cloudbrain *Cloudbrain) (err error) { | ||||
cloudbrain.TrainJobDuration = DURATION_STR_ZERO | cloudbrain.TrainJobDuration = DURATION_STR_ZERO | ||||
if _, err = x.Insert(cloudbrain); err != nil { | |||||
if _, err = x.NoAutoTime().Insert(cloudbrain); err != nil { | |||||
return err | return err | ||||
} | } | ||||
return nil | return nil | ||||
@@ -1577,7 +1578,7 @@ func RestartCloudbrain(old *Cloudbrain, new *Cloudbrain) (err error) { | |||||
return err | return err | ||||
} | } | ||||
if _, err = sess.Insert(new); err != nil { | |||||
if _, err = sess.NoAutoTime().Insert(new); err != nil { | |||||
sess.Rollback() | sess.Rollback() | ||||
return err | return err | ||||
} | } | ||||
@@ -1588,3 +1589,64 @@ func RestartCloudbrain(old *Cloudbrain, new *Cloudbrain) (err error) { | |||||
return nil | return nil | ||||
} | } | ||||
func CloudbrainAll(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { | |||||
sess := x.NewSession() | |||||
defer sess.Close() | |||||
var cond = builder.NewCond() | |||||
if (opts.Type) >= 0 { | |||||
cond = cond.And( | |||||
builder.Eq{"cloudbrain.type": opts.Type}, | |||||
) | |||||
} | |||||
var count int64 | |||||
var err error | |||||
condition := "cloudbrain.user_id = `user`.id" | |||||
if len(opts.Keyword) == 0 { | |||||
count, err = sess.Where(cond).Count(new(Cloudbrain)) | |||||
} else { | |||||
lowerKeyWord := strings.ToLower(opts.Keyword) | |||||
cond = cond.And(builder.Or(builder.Like{"LOWER(cloudbrain.job_name)", lowerKeyWord}, builder.Like{"LOWER(cloudbrain.display_job_name)", lowerKeyWord}, builder.Like{"`user`.lower_name", lowerKeyWord})) | |||||
count, err = sess.Table(&Cloudbrain{}).Where(cond). | |||||
Join("left", "`user`", condition).Count(new(CloudbrainInfo)) | |||||
} | |||||
if err != nil { | |||||
return nil, 0, fmt.Errorf("Count: %v", err) | |||||
} | |||||
if opts.Page >= 0 && opts.PageSize > 0 { | |||||
var start int | |||||
if opts.Page == 0 { | |||||
start = 0 | |||||
} else { | |||||
start = (opts.Page - 1) * opts.PageSize | |||||
} | |||||
sess.Limit(opts.PageSize, start) | |||||
} | |||||
sess.OrderBy("cloudbrain.created_unix DESC") | |||||
cloudbrains := make([]*CloudbrainInfo, 0, setting.UI.IssuePagingNum) | |||||
if err := sess.Table(&Cloudbrain{}).Unscoped().Where(cond). | |||||
Join("left", "`user`", condition). | |||||
Find(&cloudbrains); err != nil { | |||||
return nil, 0, fmt.Errorf("Find: %v", err) | |||||
} | |||||
if opts.NeedRepoInfo { | |||||
var ids []int64 | |||||
for _, task := range cloudbrains { | |||||
ids = append(ids, task.RepoID) | |||||
} | |||||
repositoryMap, err := GetRepositoriesMapByIDs(ids) | |||||
if err == nil { | |||||
for _, task := range cloudbrains { | |||||
task.Repo = repositoryMap[task.RepoID] | |||||
} | |||||
} | |||||
} | |||||
return cloudbrains, count, nil | |||||
} |
@@ -63,19 +63,20 @@ func (datasets DatasetList) loadAttributes(e Engine) error { | |||||
} | } | ||||
set := make(map[int64]struct{}) | set := make(map[int64]struct{}) | ||||
userIdSet := make(map[int64]struct{}) | |||||
datasetIDs := make([]int64, len(datasets)) | datasetIDs := make([]int64, len(datasets)) | ||||
for i := range datasets { | for i := range datasets { | ||||
set[datasets[i].UserID] = struct{}{} | |||||
userIdSet[datasets[i].UserID] = struct{}{} | |||||
set[datasets[i].RepoID] = struct{}{} | set[datasets[i].RepoID] = struct{}{} | ||||
datasetIDs[i] = datasets[i].ID | datasetIDs[i] = datasets[i].ID | ||||
} | } | ||||
// Load owners. | // Load owners. | ||||
users := make(map[int64]*User, len(set)) | |||||
users := make(map[int64]*User, len(userIdSet)) | |||||
repos := make(map[int64]*Repository, len(set)) | repos := make(map[int64]*Repository, len(set)) | ||||
if err := e. | if err := e. | ||||
Where("id > 0"). | Where("id > 0"). | ||||
In("id", keysInt64(set)). | |||||
In("id", keysInt64(userIdSet)). | |||||
Find(&users); err != nil { | Find(&users); err != nil { | ||||
return fmt.Errorf("find users: %v", err) | return fmt.Errorf("find users: %v", err) | ||||
} | } | ||||
@@ -193,22 +193,22 @@ func (org *User) getOrgStatistics() (int, error) { | |||||
} | } | ||||
func FindTopNStarsOrgs(n int) ([]*OrgScore, error) { | func FindTopNStarsOrgs(n int) ([]*OrgScore, error) { | ||||
sql := "select a.id,sum(b.num_stars) score from \"user\" a ,repository b where a.id=b.owner_id and a.type=1 group by a.id order by score desc limit " + strconv.Itoa(n) | |||||
sql := "select a.id,sum(b.num_stars) score from \"user\" a ,repository b where a.id=b.owner_id and a.type=1 and a.visibility=0 group by a.id order by score desc limit " + strconv.Itoa(n) | |||||
return findTopNOrgs(sql) | return findTopNOrgs(sql) | ||||
} | } | ||||
func FindTopNMembersOrgs(n int) ([]*OrgScore, error) { | func FindTopNMembersOrgs(n int) ([]*OrgScore, error) { | ||||
sql := "select id, count(user_id) score from" + | sql := "select id, count(user_id) score from" + | ||||
" (select org_id as id, uid as user_id from org_user " + | |||||
" (select org_id as id, uid as user_id from org_user o, \"user\" u where o.org_id=u.id and u.visibility=0 " + | |||||
"union select a.id,b.user_id from \"user\" a,collaboration b,repository c " + | "union select a.id,b.user_id from \"user\" a,collaboration b,repository c " + | ||||
"where a.type=1 and a.id=c.owner_id and b.repo_id=c.id) d " + | |||||
"where a.type=1 and a.visibility=0 and a.id=c.owner_id and b.repo_id=c.id) d " + | |||||
"group by id order by score desc limit " + strconv.Itoa(n) | "group by id order by score desc limit " + strconv.Itoa(n) | ||||
return findTopNOrgs(sql) | return findTopNOrgs(sql) | ||||
} | } | ||||
func FindTopNOpenIOrgs(n int) ([]*OrgScore, error) { | func FindTopNOpenIOrgs(n int) ([]*OrgScore, error) { | ||||
sql := "select org_id id,num_score score from org_statistic order by num_score desc limit 10" + strconv.Itoa(n) | |||||
sql := "select org_id id,num_score score from org_statistic a, \"user\" b where a.org_id=b.id and b.visibility=0 order by num_score desc limit " + strconv.Itoa(n) | |||||
return findTopNOrgs(sql) | return findTopNOrgs(sql) | ||||
} | } | ||||
@@ -1,6 +1,7 @@ | |||||
package cloudbrain | package cloudbrain | ||||
import ( | import ( | ||||
"code.gitea.io/gitea/modules/timeutil" | |||||
"encoding/json" | "encoding/json" | ||||
"errors" | "errors" | ||||
"strconv" | "strconv" | ||||
@@ -230,6 +231,7 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, | |||||
datasetName = attach.Name | datasetName = attach.Name | ||||
} | } | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := CreateJob(jobName, models.CreateJobParams{ | jobResult, err := CreateJob(jobName, models.CreateJobParams{ | ||||
JobName: jobName, | JobName: jobName, | ||||
RetryCount: 1, | RetryCount: 1, | ||||
@@ -330,6 +332,8 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, | |||||
BootFile: bootFile, | BootFile: bootFile, | ||||
DatasetName: datasetName, | DatasetName: datasetName, | ||||
Parameters: params, | Parameters: params, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
}) | }) | ||||
if err != nil { | if err != nil { | ||||
@@ -377,6 +381,7 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e | |||||
return errors.New("no such resourceSpec") | return errors.New("no such resourceSpec") | ||||
} | } | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := CreateJob(jobName, models.CreateJobParams{ | jobResult, err := CreateJob(jobName, models.CreateJobParams{ | ||||
JobName: jobName, | JobName: jobName, | ||||
RetryCount: 1, | RetryCount: 1, | ||||
@@ -468,6 +473,8 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e | |||||
GpuQueue: task.GpuQueue, | GpuQueue: task.GpuQueue, | ||||
ResourceSpecId: task.ResourceSpecId, | ResourceSpecId: task.ResourceSpecId, | ||||
ComputeResource: task.ComputeResource, | ComputeResource: task.ComputeResource, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
} | } | ||||
err = models.RestartCloudbrain(task, newTask) | err = models.RestartCloudbrain(task, newTask) | ||||
@@ -1,6 +1,7 @@ | |||||
package modelarts | package modelarts | ||||
import ( | import ( | ||||
"code.gitea.io/gitea/modules/timeutil" | |||||
"encoding/json" | "encoding/json" | ||||
"errors" | "errors" | ||||
"fmt" | "fmt" | ||||
@@ -197,6 +198,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin | |||||
if poolInfos == nil { | if poolInfos == nil { | ||||
json.Unmarshal([]byte(setting.PoolInfos), &poolInfos) | json.Unmarshal([]byte(setting.PoolInfos), &poolInfos) | ||||
} | } | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := CreateJob(models.CreateNotebookParams{ | jobResult, err := CreateJob(models.CreateNotebookParams{ | ||||
JobName: jobName, | JobName: jobName, | ||||
Description: description, | Description: description, | ||||
@@ -235,6 +237,8 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin | |||||
Type: models.TypeCloudBrainTwo, | Type: models.TypeCloudBrainTwo, | ||||
Uuid: uuid, | Uuid: uuid, | ||||
ComputeResource: models.NPUResource, | ComputeResource: models.NPUResource, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
}) | }) | ||||
if err != nil { | if err != nil { | ||||
@@ -254,7 +258,7 @@ func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, desc | |||||
log.Error("GetNotebookImageName failed: %v", err.Error()) | log.Error("GetNotebookImageName failed: %v", err.Error()) | ||||
return err | return err | ||||
} | } | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := createNotebook2(models.CreateNotebook2Params{ | jobResult, err := createNotebook2(models.CreateNotebook2Params{ | ||||
JobName: jobName, | JobName: jobName, | ||||
Description: description, | Description: description, | ||||
@@ -288,6 +292,8 @@ func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, desc | |||||
ComputeResource: models.NPUResource, | ComputeResource: models.NPUResource, | ||||
Image: imageName, | Image: imageName, | ||||
Description: description, | Description: description, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
}) | }) | ||||
if err != nil { | if err != nil { | ||||
@@ -304,6 +310,7 @@ func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, desc | |||||
} | } | ||||
func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error) { | func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error) { | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := createTrainJob(models.CreateTrainJobParams{ | jobResult, err := createTrainJob(models.CreateTrainJobParams{ | ||||
JobName: req.JobName, | JobName: req.JobName, | ||||
Description: req.Description, | Description: req.Description, | ||||
@@ -364,6 +371,8 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error | |||||
EngineName: req.EngineName, | EngineName: req.EngineName, | ||||
VersionCount: req.VersionCount, | VersionCount: req.VersionCount, | ||||
TotalVersionCount: req.TotalVersionCount, | TotalVersionCount: req.TotalVersionCount, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
}) | }) | ||||
if err != nil { | if err != nil { | ||||
@@ -375,6 +384,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error | |||||
} | } | ||||
func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, jobId string) (err error) { | func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, jobId string) (err error) { | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := createTrainJobVersion(models.CreateTrainJobVersionParams{ | jobResult, err := createTrainJobVersion(models.CreateTrainJobVersionParams{ | ||||
Description: req.Description, | Description: req.Description, | ||||
Config: models.TrainJobVersionConfig{ | Config: models.TrainJobVersionConfig{ | ||||
@@ -451,6 +461,8 @@ func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, job | |||||
EngineName: req.EngineName, | EngineName: req.EngineName, | ||||
TotalVersionCount: VersionTaskList[0].TotalVersionCount + 1, | TotalVersionCount: VersionTaskList[0].TotalVersionCount + 1, | ||||
VersionCount: VersionListCount + 1, | VersionCount: VersionListCount + 1, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
}) | }) | ||||
if err != nil { | if err != nil { | ||||
log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) | log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) | ||||
@@ -526,6 +538,7 @@ func GetOutputPathByCount(TotalVersionCount int) (VersionOutputPath string) { | |||||
} | } | ||||
func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (err error) { | func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (err error) { | ||||
createTime := timeutil.TimeStampNow() | |||||
jobResult, err := createInferenceJob(models.CreateInferenceJobParams{ | jobResult, err := createInferenceJob(models.CreateInferenceJobParams{ | ||||
JobName: req.JobName, | JobName: req.JobName, | ||||
Description: req.Description, | Description: req.Description, | ||||
@@ -591,6 +604,8 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e | |||||
ModelVersion: req.ModelVersion, | ModelVersion: req.ModelVersion, | ||||
CkptName: req.CkptName, | CkptName: req.CkptName, | ||||
ResultUrl: req.ResultUrl, | ResultUrl: req.ResultUrl, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
}) | }) | ||||
if err != nil { | if err != nil { | ||||
@@ -40,6 +40,7 @@ var ( | |||||
DisabledRepoUnits []string | DisabledRepoUnits []string | ||||
DefaultRepoUnits []string | DefaultRepoUnits []string | ||||
PrefixArchiveFiles bool | PrefixArchiveFiles bool | ||||
RepoMaxSize int64 | |||||
// Repository editor settings | // Repository editor settings | ||||
Editor struct { | Editor struct { | ||||
@@ -54,6 +55,7 @@ var ( | |||||
AllowedTypes []string `delim:"|"` | AllowedTypes []string `delim:"|"` | ||||
FileMaxSize int64 | FileMaxSize int64 | ||||
MaxFiles int | MaxFiles int | ||||
TotalMaxSize int64 | |||||
} `ini:"-"` | } `ini:"-"` | ||||
// Repository local settings | // Repository local settings | ||||
@@ -104,6 +106,7 @@ var ( | |||||
DisabledRepoUnits: []string{}, | DisabledRepoUnits: []string{}, | ||||
DefaultRepoUnits: []string{}, | DefaultRepoUnits: []string{}, | ||||
PrefixArchiveFiles: true, | PrefixArchiveFiles: true, | ||||
RepoMaxSize: 1024, | |||||
// Repository editor settings | // Repository editor settings | ||||
Editor: struct { | Editor: struct { | ||||
@@ -121,12 +124,14 @@ var ( | |||||
AllowedTypes []string `delim:"|"` | AllowedTypes []string `delim:"|"` | ||||
FileMaxSize int64 | FileMaxSize int64 | ||||
MaxFiles int | MaxFiles int | ||||
TotalMaxSize int64 | |||||
}{ | }{ | ||||
Enabled: true, | Enabled: true, | ||||
TempPath: "data/tmp/uploads", | TempPath: "data/tmp/uploads", | ||||
AllowedTypes: []string{}, | AllowedTypes: []string{}, | ||||
FileMaxSize: 3, | |||||
MaxFiles: 5, | |||||
FileMaxSize: 30, | |||||
MaxFiles: 10, | |||||
TotalMaxSize: 1024, | |||||
}, | }, | ||||
// Repository local settings | // Repository local settings | ||||
@@ -480,7 +480,7 @@ func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { | |||||
filename = key[comma+1:] | filename = key[comma+1:] | ||||
} | } | ||||
reqParams := make(map[string]string) | reqParams := make(map[string]string) | ||||
filename = url.QueryEscape(filename) | |||||
filename = url.PathEscape(filename) | |||||
reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\"" | reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\"" | ||||
input.QueryParams = reqParams | input.QueryParams = reqParams | ||||
output, err := ObsCli.CreateSignedUrl(input) | output, err := ObsCli.CreateSignedUrl(input) | ||||
@@ -503,6 +503,7 @@ func ObsGetPreSignedUrl(uuid, fileName string) (string, error) { | |||||
input.Bucket = setting.Bucket | input.Bucket = setting.Bucket | ||||
input.Expires = 60 * 60 | input.Expires = 60 * 60 | ||||
fileName = url.PathEscape(fileName) | |||||
reqParams := make(map[string]string) | reqParams := make(map[string]string) | ||||
reqParams["response-content-disposition"] = "attachment; filename=\"" + fileName + "\"" | reqParams["response-content-disposition"] = "attachment; filename=\"" + fileName + "\"" | ||||
input.QueryParams = reqParams | input.QueryParams = reqParams | ||||
@@ -919,6 +919,10 @@ cloudbrain_helper=Use GPU/NPU resources to open notebooks, model training tasks, | |||||
cloudbrain.exitinfo=Exit Information | cloudbrain.exitinfo=Exit Information | ||||
cloudbrain.platform=Platform | cloudbrain.platform=Platform | ||||
cloudbrain.endtime=End Time | cloudbrain.endtime=End Time | ||||
cloudbrain.runinfo=Task Runtime Information | |||||
cloudbrain.time.starttime=Start run time | |||||
cloudbrain.time.endtime=End run time | |||||
cloudbrain.datasetdownload=Dataset download url | |||||
model_manager = Model | model_manager = Model | ||||
model_noright=No right | model_noright=No right | ||||
model_rename=Duplicate model name, please modify model name. | model_rename=Duplicate model name, please modify model name. | ||||
@@ -1272,6 +1276,10 @@ editor.cannot_commit_to_protected_branch = Cannot commit to protected branch '%s | |||||
editor.no_commit_to_branch = Unable to commit directly to branch because: | editor.no_commit_to_branch = Unable to commit directly to branch because: | ||||
editor.user_no_push_to_branch = User cannot push to branch | editor.user_no_push_to_branch = User cannot push to branch | ||||
editor.require_signed_commit = Branch requires a signed commit | editor.require_signed_commit = Branch requires a signed commit | ||||
editor.repo_too_large = Repository can not exceed %d MB | |||||
editor.repo_file_invalid = Upload files are invalid | |||||
editor.upload_file_too_much = Can not upload more than %d files at a time | |||||
commits.desc = Browse source code change history. | commits.desc = Browse source code change history. | ||||
commits.commits = Commits | commits.commits = Commits | ||||
@@ -2880,6 +2888,8 @@ uploading = Uploading | |||||
upload_complete = Uploading complete | upload_complete = Uploading complete | ||||
failed = Upload Failed | failed = Upload Failed | ||||
enable_minio_support = Enable minio support to use the dataset service | enable_minio_support = Enable minio support to use the dataset service | ||||
max_file_tooltips= Upload a maximum of ? files at a time, each file does not exceed ? MB. | |||||
max_size_tooltips= You can only upload a maximum of ? files at a time. The upload limit has been reached, please do not add more files. | |||||
[notification] | [notification] | ||||
notifications = Notifications | notifications = Notifications | ||||
@@ -983,6 +983,10 @@ cloudbrain.mirror_description = 镜像描述 | |||||
cloudbrain.exitinfo=退出信息 | cloudbrain.exitinfo=退出信息 | ||||
cloudbrain.platform=平台 | cloudbrain.platform=平台 | ||||
cloudbrain.endtime=结束时间 | cloudbrain.endtime=结束时间 | ||||
cloudbrain.runinfo=任务运行简况 | |||||
cloudbrain.time.starttime=开始运行时间 | |||||
cloudbrain.time.endtime=结束运行时间 | |||||
cloudbrain.datasetdownload=数据集下载地址 | |||||
record_begintime_get_err=无法获取统计开始时间。 | record_begintime_get_err=无法获取统计开始时间。 | ||||
parameter_is_wrong=输入参数错误,请检查输入参数。 | parameter_is_wrong=输入参数错误,请检查输入参数。 | ||||
total_count_get_error=查询总页数失败。 | total_count_get_error=查询总页数失败。 | ||||
@@ -1028,7 +1032,9 @@ modelarts.train_job.basic_info=基本信息 | |||||
modelarts.train_job.job_status=任务状态 | modelarts.train_job.job_status=任务状态 | ||||
modelarts.train_job.job_name=任务名称 | modelarts.train_job.job_name=任务名称 | ||||
modelarts.train_job.version=任务版本 | modelarts.train_job.version=任务版本 | ||||
modelarts.train_job.start_time=开始时间 | |||||
modelarts.train_job.start_time=开始运行时间 | |||||
modelarts.train_job.end_time=运行结束时间 | |||||
modelarts.train_job.wait_time=等待时间 | |||||
modelarts.train_job.dura_time=运行时长 | modelarts.train_job.dura_time=运行时长 | ||||
modelarts.train_job.description=任务描述 | modelarts.train_job.description=任务描述 | ||||
modelarts.train_job.parameter_setting=参数设置 | modelarts.train_job.parameter_setting=参数设置 | ||||
@@ -1280,6 +1286,9 @@ editor.cannot_commit_to_protected_branch=不可以提交到受保护的分支 '% | |||||
editor.no_commit_to_branch=无法直接提交分支,因为: | editor.no_commit_to_branch=无法直接提交分支,因为: | ||||
editor.user_no_push_to_branch=用户不能推送到分支 | editor.user_no_push_to_branch=用户不能推送到分支 | ||||
editor.require_signed_commit=分支需要签名提交 | editor.require_signed_commit=分支需要签名提交 | ||||
editor.repo_too_large = 代码仓总大小不能超过%dMB | |||||
editor.repo_file_invalid = 提交的文件非法 | |||||
editor.upload_file_too_much = 不能同时提交超过%d个文件 | |||||
commits.desc=浏览代码修改历史 | commits.desc=浏览代码修改历史 | ||||
commits.commits=次代码提交 | commits.commits=次代码提交 | ||||
@@ -2887,6 +2896,8 @@ uploading=正在上传 | |||||
upload_complete=上传完成 | upload_complete=上传完成 | ||||
failed=上传失败 | failed=上传失败 | ||||
enable_minio_support=启用minio支持以使用数据集服务 | enable_minio_support=启用minio支持以使用数据集服务 | ||||
max_file_tooltips=单次最多上传?个文件,每个文件不超过? MB。 | |||||
max_size_tooltips=一次最多只能上传?个文件, 上传已达到上限,请勿再添加文件。 | |||||
[notification] | [notification] | ||||
notifications=通知 | notifications=通知 | ||||
@@ -557,6 +557,10 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
m.Get("/query_user_last_month", operationReq, repo_ext.QueryUserStaticLastMonth) | m.Get("/query_user_last_month", operationReq, repo_ext.QueryUserStaticLastMonth) | ||||
m.Get("/query_user_yesterday", operationReq, repo_ext.QueryUserStaticYesterday) | m.Get("/query_user_yesterday", operationReq, repo_ext.QueryUserStaticYesterday) | ||||
m.Get("/query_user_all", operationReq, repo_ext.QueryUserStaticAll) | m.Get("/query_user_all", operationReq, repo_ext.QueryUserStaticAll) | ||||
//cloudbrain board | |||||
m.Group("/cloudbrainboard", func() { | |||||
m.Get("/downloadAll", repo.DownloadCloudBrainBoard) | |||||
}, operationReq) | |||||
// Users | // Users | ||||
m.Group("/users", func() { | m.Group("/users", func() { | ||||
m.Get("/search", user.Search) | m.Get("/search", user.Search) | ||||
@@ -0,0 +1,135 @@ | |||||
package repo | |||||
import ( | |||||
"net/http" | |||||
"net/url" | |||||
"time" | |||||
"code.gitea.io/gitea/models" | |||||
"code.gitea.io/gitea/modules/context" | |||||
"code.gitea.io/gitea/modules/log" | |||||
"github.com/360EntSecGroup-Skylar/excelize/v2" | |||||
) | |||||
func DownloadCloudBrainBoard(ctx *context.Context) { | |||||
page := 1 | |||||
pageSize := 300 | |||||
var cloudBrain = ctx.Tr("repo.cloudbrain") | |||||
fileName := getCloudbrainFileName(cloudBrain) | |||||
_, total, err := models.CloudbrainAll(&models.CloudbrainsOptions{ | |||||
ListOptions: models.ListOptions{ | |||||
Page: page, | |||||
PageSize: 1, | |||||
}, | |||||
Type: models.TypeCloudBrainAll, | |||||
NeedRepoInfo: false, | |||||
}) | |||||
if err != nil { | |||||
log.Warn("Can not get cloud brain info", err) | |||||
ctx.Error(http.StatusBadRequest, ctx.Tr("repo.cloudbrain_query_fail")) | |||||
return | |||||
} | |||||
totalPage := getTotalPage(total, pageSize) | |||||
f := excelize.NewFile() | |||||
index := f.NewSheet(cloudBrain) | |||||
f.DeleteSheet("Sheet1") | |||||
for k, v := range allCloudbrainHeader(ctx) { | |||||
f.SetCellValue(cloudBrain, k, v) | |||||
} | |||||
var row = 2 | |||||
for i := 0; i < totalPage; i++ { | |||||
pageRecords, _, err := models.CloudbrainAll(&models.CloudbrainsOptions{ | |||||
ListOptions: models.ListOptions{ | |||||
Page: page, | |||||
PageSize: pageSize, | |||||
}, | |||||
Type: models.TypeCloudBrainAll, | |||||
NeedRepoInfo: true, | |||||
}) | |||||
if err != nil { | |||||
log.Warn("Can not get cloud brain info", err) | |||||
continue | |||||
} | |||||
for _, record := range pageRecords { | |||||
for k, v := range allCloudbrainValues(row, record, ctx) { | |||||
f.SetCellValue(cloudBrain, k, v) | |||||
} | |||||
row++ | |||||
} | |||||
page++ | |||||
} | |||||
f.SetActiveSheet(index) | |||||
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+url.QueryEscape(fileName)) | |||||
ctx.Resp.Header().Set("Content-Type", "application/octet-stream") | |||||
f.WriteTo(ctx.Resp) | |||||
} | |||||
func getCloudbrainFileName(baseName string) string { | |||||
return baseName + "_" + time.Now().Format(EXCEL_DATE_FORMAT) + ".xlsx" | |||||
} | |||||
func allCloudbrainHeader(ctx *context.Context) map[string]string { | |||||
return map[string]string{"A1": ctx.Tr("repo.cloudbrain_task"), "B1": ctx.Tr("repo.cloudbrain_task_type"), "C1": ctx.Tr("repo.modelarts.status"), | |||||
"D1": ctx.Tr("repo.modelarts.createtime"), "E1": ctx.Tr("repo.modelarts.train_job.wait_time"), "F1": ctx.Tr("repo.modelarts.train_job.dura_time"), | |||||
"G1": ctx.Tr("repo.modelarts.train_job.start_time"), | |||||
"H1": ctx.Tr("repo.modelarts.train_job.end_time"), "I1": ctx.Tr("repo.modelarts.computing_resources"), | |||||
"J1": ctx.Tr("repo.cloudbrain_creator"), "K1": ctx.Tr("repo.repo_name"), "L1": ctx.Tr("repo.cloudbrain_task_name")} | |||||
} | |||||
func allCloudbrainValues(row int, rs *models.CloudbrainInfo, ctx *context.Context) map[string]string { | |||||
return map[string]string{getCellName("A", row): rs.DisplayJobName, getCellName("B", row): rs.JobType, getCellName("C", row): rs.Status, | |||||
getCellName("D", row): time.Unix(int64(rs.Cloudbrain.CreatedUnix), 0).Format(CREATE_TIME_FORMAT), getCellName("E", row): getBrainWaitTime(rs), | |||||
getCellName("F", row): rs.TrainJobDuration, getCellName("G", row): getBrainStartTime(rs), | |||||
getCellName("H", row): getBrainEndTime(rs), | |||||
getCellName("I", row): rs.ComputeResource, getCellName("J", row): rs.Name, getCellName("K", row): getBrainRepo(rs), | |||||
getCellName("L", row): rs.JobName, | |||||
} | |||||
} | |||||
func getBrainRepo(rs *models.CloudbrainInfo) string { | |||||
if rs.Repo != nil { | |||||
return rs.Repo.OwnerName + "/" + rs.Repo.Alias | |||||
} | |||||
return "" | |||||
} | |||||
func getBrainStartTime(rs *models.CloudbrainInfo) string { | |||||
timeString := time.Unix(int64(rs.Cloudbrain.StartTime), 0).Format(CREATE_TIME_FORMAT) | |||||
if timeString != "1970/01/01 08:00:00" { | |||||
return timeString | |||||
} else { | |||||
return "0" | |||||
} | |||||
} | |||||
func getBrainEndTime(rs *models.CloudbrainInfo) string { | |||||
timeString := time.Unix(int64(rs.Cloudbrain.EndTime), 0).Format(CREATE_TIME_FORMAT) | |||||
if timeString != "1970/01/01 08:00:00" { | |||||
return timeString | |||||
} else { | |||||
return "0" | |||||
} | |||||
} | |||||
func getBrainWaitTime(rs *models.CloudbrainInfo) string { | |||||
waitTime := rs.Cloudbrain.StartTime - rs.Cloudbrain.CreatedUnix | |||||
if waitTime <= 0 { | |||||
return "0" | |||||
} else { | |||||
return models.ConvertDurationToStr(int64(waitTime)) | |||||
} | |||||
} |
@@ -441,15 +441,29 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||||
return | return | ||||
} | } | ||||
if cloudbrain.ResourceSpecs == nil { | |||||
json.Unmarshal([]byte(setting.ResourceSpecs), &cloudbrain.ResourceSpecs) | |||||
} | |||||
for _, tmp := range cloudbrain.ResourceSpecs.ResourceSpec { | |||||
if tmp.Id == task.ResourceSpecId { | |||||
ctx.Data["GpuNum"] = tmp.GpuNum | |||||
ctx.Data["CpuNum"] = tmp.CpuNum | |||||
ctx.Data["MemMiB"] = tmp.MemMiB | |||||
ctx.Data["ShareMemMiB"] = tmp.ShareMemMiB | |||||
if task.JobType == string(models.JobTypeTrain) { | |||||
if cloudbrain.TrainResourceSpecs == nil { | |||||
json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) | |||||
} | |||||
for _, tmp := range cloudbrain.TrainResourceSpecs.ResourceSpec { | |||||
if tmp.Id == task.ResourceSpecId { | |||||
ctx.Data["GpuNum"] = tmp.GpuNum | |||||
ctx.Data["CpuNum"] = tmp.CpuNum | |||||
ctx.Data["MemMiB"] = tmp.MemMiB | |||||
ctx.Data["ShareMemMiB"] = tmp.ShareMemMiB | |||||
} | |||||
} | |||||
} else { | |||||
if cloudbrain.ResourceSpecs == nil { | |||||
json.Unmarshal([]byte(setting.ResourceSpecs), &cloudbrain.ResourceSpecs) | |||||
} | |||||
for _, tmp := range cloudbrain.ResourceSpecs.ResourceSpec { | |||||
if tmp.Id == task.ResourceSpecId { | |||||
ctx.Data["GpuNum"] = tmp.GpuNum | |||||
ctx.Data["CpuNum"] = tmp.CpuNum | |||||
ctx.Data["MemMiB"] = tmp.MemMiB | |||||
ctx.Data["ShareMemMiB"] = tmp.ShareMemMiB | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -5,6 +5,7 @@ | |||||
package repo | package repo | ||||
import ( | import ( | ||||
repo_service "code.gitea.io/gitea/services/repository" | |||||
"encoding/json" | "encoding/json" | ||||
"fmt" | "fmt" | ||||
"io/ioutil" | "io/ioutil" | ||||
@@ -614,6 +615,19 @@ func UploadFilePost(ctx *context.Context, form auth.UploadRepoFileForm) { | |||||
message += "\n\n" + form.CommitMessage | message += "\n\n" + form.CommitMessage | ||||
} | } | ||||
if err := repo_service.CheckPushSizeLimit4Web(ctx.Repo.Repository, form.Files); err != nil { | |||||
if repo_service.IsRepoTooLargeErr(err) { | |||||
ctx.RenderWithErr(ctx.Tr("repo.editor.repo_too_large", setting.Repository.RepoMaxSize), tplUploadFile, &form) | |||||
} else if repo_service.IsUploadFileInvalidErr(err) { | |||||
ctx.RenderWithErr(ctx.Tr("repo.editor.repo_file_invalid"), tplUploadFile, &form) | |||||
} else if repo_service.IsUploadFileTooMuchErr(err) { | |||||
ctx.RenderWithErr(ctx.Tr("repo.editor.upload_file_too_much", setting.Repository.Upload.MaxFiles), tplUploadFile, &form) | |||||
} else { | |||||
ctx.RenderWithErr(err.Error(), tplUploadFile, &form) | |||||
} | |||||
return | |||||
} | |||||
if err := repofiles.UploadRepoFiles(ctx.Repo.Repository, ctx.User, &repofiles.UploadRepoFileOptions{ | if err := repofiles.UploadRepoFiles(ctx.Repo.Repository, ctx.User, &repofiles.UploadRepoFileOptions{ | ||||
LastCommitID: ctx.Repo.CommitID, | LastCommitID: ctx.Repo.CommitID, | ||||
OldBranch: oldBranchName, | OldBranch: oldBranchName, | ||||
@@ -279,7 +279,7 @@ func NotebookShow(ctx *context.Context) { | |||||
} | } | ||||
} | } | ||||
datasetDownloadLink := "-" | |||||
datasetDownloadLink := "" | |||||
if ctx.IsSigned { | if ctx.IsSigned { | ||||
if task.Uuid != "" && task.UserID == ctx.User.ID { | if task.Uuid != "" && task.UserID == ctx.User.ID { | ||||
attachment, err := models.GetAttachmentByUUID(task.Uuid) | attachment, err := models.GetAttachmentByUUID(task.Uuid) | ||||
@@ -439,6 +439,7 @@ func NotebookManage(ctx *context.Context) { | |||||
param := models.NotebookAction{ | param := models.NotebookAction{ | ||||
Action: action, | Action: action, | ||||
} | } | ||||
createTime := timeutil.TimeStampNow() | |||||
res, err := modelarts.ManageNotebook2(task.JobID, param) | res, err := modelarts.ManageNotebook2(task.JobID, param) | ||||
if err != nil { | if err != nil { | ||||
log.Error("ManageNotebook2(%s) failed:%v", task.JobName, err.Error(), ctx.Data["MsgID"]) | log.Error("ManageNotebook2(%s) failed:%v", task.JobName, err.Error(), ctx.Data["MsgID"]) | ||||
@@ -465,6 +466,8 @@ func NotebookManage(ctx *context.Context) { | |||||
Image: task.Image, | Image: task.Image, | ||||
ComputeResource: task.ComputeResource, | ComputeResource: task.ComputeResource, | ||||
Description: task.Description, | Description: task.Description, | ||||
CreatedUnix: createTime, | |||||
UpdatedUnix: createTime, | |||||
} | } | ||||
err = models.RestartCloudbrain(task, newTask) | err = models.RestartCloudbrain(task, newTask) | ||||
@@ -8,6 +8,7 @@ import ( | |||||
"fmt" | "fmt" | ||||
"io/ioutil" | "io/ioutil" | ||||
"net/http" | "net/http" | ||||
"os" | |||||
"strings" | "strings" | ||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
@@ -172,3 +173,137 @@ func RecommendFromPromote(url string) ([]string, error) { | |||||
} | } | ||||
return result, nil | return result, nil | ||||
} | } | ||||
func CheckPushSizeLimit4Web(repo *models.Repository, fileIds []string) error { | |||||
if err := CheckRepoNumOnceLimit(len(fileIds)); err != nil { | |||||
return err | |||||
} | |||||
totalSize, err := CountUploadFileSizeByIds(fileIds) | |||||
if err != nil { | |||||
return UploadFileInvalidErr{} | |||||
} | |||||
if err := CheckRepoTotalSizeLimit(repo, totalSize); err != nil { | |||||
return err | |||||
} | |||||
return nil | |||||
} | |||||
func CheckPushSizeLimit4Http(repo *models.Repository, uploadFileSize int64) error { | |||||
if err := CheckRepoOnceTotalSizeLimit(uploadFileSize); err != nil { | |||||
return err | |||||
} | |||||
if err := CheckRepoTotalSizeLimit(repo, uploadFileSize); err != nil { | |||||
return err | |||||
} | |||||
return nil | |||||
} | |||||
func CheckRepoTotalSizeLimit(repo *models.Repository, uploadFileSize int64) error { | |||||
if repo.Size+uploadFileSize > setting.Repository.RepoMaxSize*1024*1024 { | |||||
return RepoTooLargeErr{} | |||||
} | |||||
return nil | |||||
} | |||||
func CheckRepoOnceTotalSizeLimit(uploadFileSize int64) error { | |||||
if uploadFileSize > setting.Repository.Upload.TotalMaxSize*1024*1024 { | |||||
return UploadFileTooLargeErr{} | |||||
} | |||||
return nil | |||||
} | |||||
func CheckRepoNumOnceLimit(uploadFileNum int) error { | |||||
if uploadFileNum > setting.Repository.Upload.MaxFiles { | |||||
return UploadFileTooMuchErr{} | |||||
} | |||||
return nil | |||||
} | |||||
func CountUploadFileSizeByIds(fileIds []string) (int64, error) { | |||||
if len(fileIds) == 0 { | |||||
return 0, nil | |||||
} | |||||
uploads, err := models.GetUploadsByUUIDs(fileIds) | |||||
if err != nil { | |||||
return 0, fmt.Errorf("CountUploadFileSizeByIds error [uuids: %v]: %v", fileIds, err) | |||||
} | |||||
var totalSize int64 | |||||
for _, upload := range uploads { | |||||
size, err := GetUploadFileSize(upload) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
totalSize += size | |||||
} | |||||
return totalSize, nil | |||||
} | |||||
func GetUploadFileSize(upload *models.Upload) (int64, error) { | |||||
info, err := os.Lstat(upload.LocalPath()) | |||||
if err != nil { | |||||
return 0, err | |||||
} | |||||
return info.Size(), nil | |||||
} | |||||
type RepoTooLargeErr struct { | |||||
} | |||||
func (RepoTooLargeErr) Error() string { | |||||
return fmt.Sprintf("Repository can not exceed %d MB. Please remove some unnecessary files and try again", setting.Repository.RepoMaxSize) | |||||
} | |||||
func IsRepoTooLargeErr(err error) bool { | |||||
_, ok := err.(RepoTooLargeErr) | |||||
return ok | |||||
} | |||||
type UploadFileTooLargeErr struct { | |||||
} | |||||
func (UploadFileTooLargeErr) Error() string { | |||||
return fmt.Sprintf("Upload files can not exceed %d MB at a time", setting.Repository.Upload.TotalMaxSize) | |||||
} | |||||
func IsUploadFileTooLargeErr(err error) bool { | |||||
_, ok := err.(UploadFileTooLargeErr) | |||||
return ok | |||||
} | |||||
type RepoFileTooLargeErr struct { | |||||
} | |||||
func (RepoFileTooLargeErr) Error() string { | |||||
return "repository file is too large" | |||||
} | |||||
func IsRepoFileTooLargeErr(err error) bool { | |||||
_, ok := err.(RepoFileTooLargeErr) | |||||
return ok | |||||
} | |||||
type UploadFileTooMuchErr struct { | |||||
} | |||||
func (UploadFileTooMuchErr) Error() string { | |||||
return "upload files are too lmuch" | |||||
} | |||||
func IsUploadFileTooMuchErr(err error) bool { | |||||
_, ok := err.(UploadFileTooMuchErr) | |||||
return ok | |||||
} | |||||
type UploadFileInvalidErr struct { | |||||
} | |||||
func (UploadFileInvalidErr) Error() string { | |||||
return "upload files are invalid" | |||||
} | |||||
func IsUploadFileInvalidErr(err error) bool { | |||||
_, ok := err.(UploadFileInvalidErr) | |||||
return ok | |||||
} |
@@ -1,7 +1,7 @@ | |||||
{{if not .IsCourse}} | {{if not .IsCourse}} | ||||
{{ if .notices}} | {{ if .notices}} | ||||
<div class="notic_content" id ="notic_content" style="display: block; position: relative"> | <div class="notic_content" id ="notic_content" style="display: block; position: relative"> | ||||
<diV class="ui container"> | |||||
<div class="ui container"> | |||||
<marquee behavior="scroll" direction="left"> | <marquee behavior="scroll" direction="left"> | ||||
{{ $firstTag := true }} | {{ $firstTag := true }} | ||||
{{range .notices.Notices}} | {{range .notices.Notices}} | ||||
@@ -25,7 +25,7 @@ | |||||
<div class="item right" style="position:absolute;right: 1px;top:0px;"> | <div class="item right" style="position:absolute;right: 1px;top:0px;"> | ||||
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i> | <i class="ri-close-fill x_icon" onclick="closeNoice()"></i> | ||||
</div> | </div> | ||||
</diV> | |||||
</div> | |||||
</div> | </div> | ||||
{{end}} | {{end}} |
@@ -135,4 +135,4 @@ | |||||
</el-dialog> | </el-dialog> | ||||
</div> | |||||
</div> |
@@ -0,0 +1,134 @@ | |||||
<div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" data-cloudranin-type="{{.cloudbraintype}}"></div> | |||||
<div class="inline required unite min_title field" id="dataset-base" style="margin-bottom: 0 !important;"> | |||||
<label style="font-weight: normal;">{{.i18n.Tr "dataset.dataset"}}</label> | |||||
<input type="hidden" name="attachment" :value="dataset_uuid"> | |||||
<input class="disabled" type="text" :value="dataset_name" required onfocus="this.blur();" style="width: 35.5%;"> | |||||
<el-button type="text" @click="dialogVisible = true" icon="el-icon-plus" style="color: #0366d6;"> {{.i18n.Tr "dataset.select_dataset"}}</el-button> | |||||
<el-dialog | |||||
title="{{.i18n.Tr "dataset.select_dataset"}}" | |||||
:visible.sync="dialogVisible" | |||||
width="50%" | |||||
> | |||||
<div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;"> | |||||
<i class="search icon" style="cursor: pointer;pointer-events:auto" @click="searchDataset()"></i> | |||||
<input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem" @keyup.enter="searchDataset()"> | |||||
</div> | |||||
<el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||||
<el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first"> | |||||
<div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||||
<div style="width: 90%;"> | |||||
<div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias} </span><span class="panel_dataset_name">${dataset.Name} </span></div> | |||||
<div style="margin-top: 8px;display: flex;"> | |||||
<a :title="dataset.UserName" style="cursor: default;"> | |||||
<img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||||
</a> | |||||
<span class="panel_datset_desc">${dataset.Description}</span> | |||||
</div> | |||||
</div> | |||||
<div> | |||||
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||||
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||||
<i class="CREATING"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||||
</span> | |||||
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||||
<i class="FAILED"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</el-tab-pane> | |||||
<el-tab-pane label="{{.i18n.Tr "dataset.owner_dataset"}}" name="second"> | |||||
<div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in myDataset" :key="index"> | |||||
<div style="width: 90%;"> | |||||
<div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><span class="panel_dataset_name">${dataset.Name}</span></div> | |||||
<div style="margin-top: 8px;display: flex;"> | |||||
<a :title="dataset.UserName" style="cursor: default;"> | |||||
<img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||||
</a> | |||||
<span class="panel_datset_desc">${dataset.Description}</span> | |||||
</div> | |||||
</div> | |||||
<div> | |||||
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||||
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||||
<i class="CREATING"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||||
</span> | |||||
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||||
<i class="FAILED"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</el-tab-pane> | |||||
<el-tab-pane label="{{.i18n.Tr "dataset.public_dataset"}}" name="third"> | |||||
<div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in publicDataset" :key="index"> | |||||
<div style="width: 90%;"> | |||||
<div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><span class="panel_dataset_name">${dataset.Name}</span></div> | |||||
<div style="margin-top: 8px;display: flex;"> | |||||
<a :title="dataset.UserName" style="cursor: default;"> | |||||
<img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||||
</a> | |||||
<span class="panel_datset_desc">${dataset.Description}</span> | |||||
</div> | |||||
</div> | |||||
<div> | |||||
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||||
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||||
<i class="CREATING"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||||
</span> | |||||
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||||
<i class="FAILED"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</el-tab-pane> | |||||
<el-tab-pane label="{{.i18n.Tr "dataset.I_liked"}}" name="fourth"> | |||||
<div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in myFavoriteDataset" :key="index"> | |||||
<div style="width: 90%;"> | |||||
<div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><span class="panel_dataset_name">${dataset.Name}</span></div> | |||||
<div style="margin-top: 8px;display: flex;"> | |||||
<a :title="dataset.UserName" style="cursor: default;"> | |||||
<img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||||
</a> | |||||
<span class="panel_datset_desc">${dataset.Description}</span> | |||||
</div> | |||||
</div> | |||||
<div> | |||||
<button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||||
<span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||||
<i class="CREATING"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||||
</span> | |||||
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||||
<i class="FAILED"></i> | |||||
<span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</el-tab-pane> | |||||
</el-tabs> | |||||
<div class="center"> | |||||
<el-pagination | |||||
background | |||||
@current-change="handleCurrentChange" | |||||
:current-page="page" | |||||
:page-size="5" | |||||
layout="total,prev, pager, next" | |||||
:total="totalnums"> | |||||
</el-pagination> | |||||
</div> | |||||
</el-dialog> | |||||
</div> |
@@ -121,10 +121,10 @@ | |||||
<i class="dropdown icon"></i> | <i class="dropdown icon"></i> | ||||
</span> | </span> | ||||
<div class="menu"> | <div class="menu"> | ||||
<a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> | |||||
<a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||||
<a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||||
<a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||||
<a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> | |||||
<a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||||
<a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||||
<a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||||
<!-- <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> --> | <!-- <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> --> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -184,9 +184,15 @@ | |||||
</div> | </div> | ||||
<div class="extra content" style="border-top: none !important;"> | <div class="extra content" style="border-top: none !important;"> | ||||
<div style="display: flex;align-items: center;"> | <div style="display: flex;align-items: center;"> | ||||
{{if eq .UserID 0}} | |||||
<a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}"> | <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}"> | ||||
<img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.Repo.OwnerName}}/-1"> | <img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.Repo.OwnerName}}/-1"> | ||||
</a> | </a> | ||||
{{else}} | |||||
<a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"> | |||||
<img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.User.Name}}/-1"> | |||||
</a> | |||||
{{end}} | |||||
<span style="color: #999999;font-size: 14px;;">创建于:{{TimeSinceUnix1 .CreatedUnix}}</span> | <span style="color: #999999;font-size: 14px;;">创建于:{{TimeSinceUnix1 .CreatedUnix}}</span> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -215,4 +221,4 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
{{template "base/footer" .}} | |||||
{{template "base/footer" .}} |
@@ -83,35 +83,43 @@ | |||||
<div class="ui three doubling cards"> | <div class="ui three doubling cards"> | ||||
<div class="card_list" > | <div class="card_list" > | ||||
<div class="list_title star_title"> | <div class="list_title star_title"> | ||||
<p class="p_text"> <i class="ri-star-line"> </i>{{$.i18n.Tr "org.star"}}</p> | |||||
<p class="p_text"> <i class="ri-star-line title_icon"> </i> {{$.i18n.Tr "org.star"}} </p> | |||||
</div> | </div> | ||||
<li style="list-style:none"> | <li style="list-style:none"> | ||||
{{ range $i,$user :=.StarOrgs}} | {{ range $i,$user :=.StarOrgs}} | ||||
<ul class="orgs" style="display: flex;"> | |||||
<ul class="orgs" style="display: flex;position: relative;"> | |||||
{{if eq $i 0}} | {{if eq $i 0}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><defs><path id="rank1_svg__a" d="M13.69 20V9.616h-1.598l-3.139 2.61 1.027 1.218 1.95-1.804V20z"></path></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h32v32H0z"></path><g transform="translate(4 2.667)"><path fill="#D16C11" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#F7C049" cx="12" cy="14.667" r="12"></circle><circle fill="#FEE6AD" cx="12" cy="14.667" r="9.333"></circle><g fill-rule="nonzero"><use fill="#FFF" xlink:href="#rank1_svg__a"></use><use fill="#D74D03" xlink:href="#rank1_svg__a"></use></g></g></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><defs><path id="rank1_svg__a" d="M13.69 20V9.616h-1.598l-3.139 2.61 1.027 1.218 1.95-1.804V20z"></path></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h32v32H0z"></path><g transform="translate(4 2.667)"><path fill="#D16C11" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#F7C049" cx="12" cy="14.667" r="12"></circle><circle fill="#FEE6AD" cx="12" cy="14.667" r="9.333"></circle><g fill-rule="nonzero"><use fill="#FFF" xlink:href="#rank1_svg__a"></use><use fill="#D74D03" xlink:href="#rank1_svg__a"></use></g></g></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else if eq $i 1}} | {{else if eq $i 1}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#305269" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#BDD8F0" cx="12" cy="14.667" r="12"></circle><circle fill="#E1E9FC" cx="12" cy="14.667" r="9.333"></circle><path d="M15.817 20v-1.584h-4.81l3.212-2.977c.469-.43.853-.883 1.151-1.357.298-.474.447-1.039.447-1.694 0-.499-.088-.934-.264-1.305a2.525 2.525 0 00-.718-.917 3.169 3.169 0 00-1.064-.543 4.531 4.531 0 00-1.312-.183c-.47 0-.905.064-1.306.19-.4.128-.753.314-1.056.558-.303.244-.55.55-.74.917-.191.366-.306.79-.345 1.268l1.848.147c.059-.43.23-.772.513-1.027.284-.254.646-.381 1.086-.381.205 0 .398.032.579.095.18.064.34.154.477.272a1.262 1.262 0 01.455.997c0 .176-.035.345-.103.506a2.52 2.52 0 01-.257.462 3.476 3.476 0 01-.345.418c-.127.132-.249.257-.366.374l-4.034 3.901V20h6.952z" fill="#305269" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#305269" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#BDD8F0" cx="12" cy="14.667" r="12"></circle><circle fill="#E1E9FC" cx="12" cy="14.667" r="9.333"></circle><path d="M15.817 20v-1.584h-4.81l3.212-2.977c.469-.43.853-.883 1.151-1.357.298-.474.447-1.039.447-1.694 0-.499-.088-.934-.264-1.305a2.525 2.525 0 00-.718-.917 3.169 3.169 0 00-1.064-.543 4.531 4.531 0 00-1.312-.183c-.47 0-.905.064-1.306.19-.4.128-.753.314-1.056.558-.303.244-.55.55-.74.917-.191.366-.306.79-.345 1.268l1.848.147c.059-.43.23-.772.513-1.027.284-.254.646-.381 1.086-.381.205 0 .398.032.579.095.18.064.34.154.477.272a1.262 1.262 0 01.455.997c0 .176-.035.345-.103.506a2.52 2.52 0 01-.257.462 3.476 3.476 0 01-.345.418c-.127.132-.249.257-.366.374l-4.034 3.901V20h6.952z" fill="#305269" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else if eq $i 2}} | {{else if eq $i 2}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#865B45" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#E7C5AC" cx="12" cy="14.667" r="12"></circle><circle fill="#FEDDC7" cx="12" cy="14.667" r="9.333"></circle><path d="M12.239 20.176c.46 0 .902-.066 1.327-.198.425-.132.8-.328 1.122-.587.323-.259.58-.579.77-.96.19-.382.286-.822.286-1.32 0-.646-.171-1.203-.513-1.672-.343-.47-.846-.753-1.511-.851v-.03c.557-.136.992-.422 1.305-.857.313-.435.47-.932.47-1.489 0-.46-.09-.863-.272-1.21a2.547 2.547 0 00-.726-.865 3.232 3.232 0 00-1.056-.521 4.521 4.521 0 00-1.276-.176 4.52 4.52 0 00-1.1.132 3.404 3.404 0 00-.968.403 2.79 2.79 0 00-.762.697 3.181 3.181 0 00-.499.997l1.863.499c.127-.362.33-.643.608-.843.279-.2.594-.301.946-.301.44 0 .797.127 1.071.381.274.255.41.582.41.983 0 .313-.058.562-.175.748a1.17 1.17 0 01-.462.425 1.903 1.903 0 01-.646.191 6.09 6.09 0 01-.74.044h-.455v1.584h.425c.264 0 .533.02.807.059.274.039.52.115.74.227.22.112.402.274.543.484.142.21.213.482.213.814a1.533 1.533 0 01-.52 1.18 1.772 1.772 0 01-.558.33 1.88 1.88 0 01-.667.118c-.47 0-.841-.117-1.115-.352s-.464-.567-.572-.997l-1.877.498c.117.43.288.8.513 1.108.225.308.491.56.8.755.307.196.652.34 1.033.433a5.13 5.13 0 001.218.139z" fill="#865B45" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#865B45" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#E7C5AC" cx="12" cy="14.667" r="12"></circle><circle fill="#FEDDC7" cx="12" cy="14.667" r="9.333"></circle><path d="M12.239 20.176c.46 0 .902-.066 1.327-.198.425-.132.8-.328 1.122-.587.323-.259.58-.579.77-.96.19-.382.286-.822.286-1.32 0-.646-.171-1.203-.513-1.672-.343-.47-.846-.753-1.511-.851v-.03c.557-.136.992-.422 1.305-.857.313-.435.47-.932.47-1.489 0-.46-.09-.863-.272-1.21a2.547 2.547 0 00-.726-.865 3.232 3.232 0 00-1.056-.521 4.521 4.521 0 00-1.276-.176 4.52 4.52 0 00-1.1.132 3.404 3.404 0 00-.968.403 2.79 2.79 0 00-.762.697 3.181 3.181 0 00-.499.997l1.863.499c.127-.362.33-.643.608-.843.279-.2.594-.301.946-.301.44 0 .797.127 1.071.381.274.255.41.582.41.983 0 .313-.058.562-.175.748a1.17 1.17 0 01-.462.425 1.903 1.903 0 01-.646.191 6.09 6.09 0 01-.74.044h-.455v1.584h.425c.264 0 .533.02.807.059.274.039.52.115.74.227.22.112.402.274.543.484.142.21.213.482.213.814a1.533 1.533 0 01-.52 1.18 1.772 1.772 0 01-.558.33 1.88 1.88 0 01-.667.118c-.47 0-.841-.117-1.115-.352s-.464-.567-.572-.997l-1.877.498c.117.43.288.8.513 1.108.225.308.491.56.8.755.307.196.652.34 1.033.433a5.13 5.13 0 001.218.139z" fill="#865B45" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else }} | {{else }} | ||||
<div class="org_icon org_icon_num" > | |||||
{{Add $i 1}} | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon" > | |||||
{{Add $i 1}} | |||||
</div> | |||||
</li> | |||||
{{end}} | {{end}} | ||||
<li class="li_avatar"> | <li class="li_avatar"> | ||||
<img class="ui avatar image" src="{{$user.RelAvatarLink}}" > | <img class="ui avatar image" src="{{$user.RelAvatarLink}}" > | ||||
</li> | </li> | ||||
<li class="li_name"> | <li class="li_name"> | ||||
<p class="org_line_hight">{{$user.Name}}</p> | |||||
<a class="org_line_hight re_style nowrap" href="{{$user.HomeLink}}">{{$user.Name}}</a> | |||||
</li> | </li> | ||||
<ul> | |||||
<ul class = 'score'> | |||||
<li class="li_score" > | <li class="li_score" > | ||||
<i class="ri-star-line org_line_hight org_icon_color"></i> <p class="p_score">{{$user.Score}}</p> | <i class="ri-star-line org_line_hight org_icon_color"></i> <p class="p_score">{{$user.Score}}</p> | ||||
</li> | </li> | ||||
@@ -122,36 +130,44 @@ | |||||
</li> | </li> | ||||
</div> | </div> | ||||
<div class="card_list" > | <div class="card_list" > | ||||
<div class="list_title star_title"> | |||||
<p class="p_text"> <i class="ri-user-2-line"> </i>{{$.i18n.Tr "org.member"}}</p> | |||||
<div class="list_title memb_title"> | |||||
<p class="p_text"> <i class="ri-user-2-line title_icon"> </i> {{$.i18n.Tr "org.member"}} </p> | |||||
</div> | </div> | ||||
<li style="list-style:none"> | <li style="list-style:none"> | ||||
{{ range $i,$user :=.StarOrgs}} | |||||
<ul class="orgs" style="display: flex;"> | |||||
{{ range $i,$user :=.MemberOrgs}} | |||||
<ul class="orgs" style="display: flex;;position: relative;"> | |||||
{{if eq $i 0}} | {{if eq $i 0}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><defs><path id="rank1_svg__a" d="M13.69 20V9.616h-1.598l-3.139 2.61 1.027 1.218 1.95-1.804V20z"></path></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h32v32H0z"></path><g transform="translate(4 2.667)"><path fill="#D16C11" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#F7C049" cx="12" cy="14.667" r="12"></circle><circle fill="#FEE6AD" cx="12" cy="14.667" r="9.333"></circle><g fill-rule="nonzero"><use fill="#FFF" xlink:href="#rank1_svg__a"></use><use fill="#D74D03" xlink:href="#rank1_svg__a"></use></g></g></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><defs><path id="rank1_svg__a" d="M13.69 20V9.616h-1.598l-3.139 2.61 1.027 1.218 1.95-1.804V20z"></path></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h32v32H0z"></path><g transform="translate(4 2.667)"><path fill="#D16C11" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#F7C049" cx="12" cy="14.667" r="12"></circle><circle fill="#FEE6AD" cx="12" cy="14.667" r="9.333"></circle><g fill-rule="nonzero"><use fill="#FFF" xlink:href="#rank1_svg__a"></use><use fill="#D74D03" xlink:href="#rank1_svg__a"></use></g></g></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else if eq $i 1}} | {{else if eq $i 1}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#305269" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#BDD8F0" cx="12" cy="14.667" r="12"></circle><circle fill="#E1E9FC" cx="12" cy="14.667" r="9.333"></circle><path d="M15.817 20v-1.584h-4.81l3.212-2.977c.469-.43.853-.883 1.151-1.357.298-.474.447-1.039.447-1.694 0-.499-.088-.934-.264-1.305a2.525 2.525 0 00-.718-.917 3.169 3.169 0 00-1.064-.543 4.531 4.531 0 00-1.312-.183c-.47 0-.905.064-1.306.19-.4.128-.753.314-1.056.558-.303.244-.55.55-.74.917-.191.366-.306.79-.345 1.268l1.848.147c.059-.43.23-.772.513-1.027.284-.254.646-.381 1.086-.381.205 0 .398.032.579.095.18.064.34.154.477.272a1.262 1.262 0 01.455.997c0 .176-.035.345-.103.506a2.52 2.52 0 01-.257.462 3.476 3.476 0 01-.345.418c-.127.132-.249.257-.366.374l-4.034 3.901V20h6.952z" fill="#305269" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#305269" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#BDD8F0" cx="12" cy="14.667" r="12"></circle><circle fill="#E1E9FC" cx="12" cy="14.667" r="9.333"></circle><path d="M15.817 20v-1.584h-4.81l3.212-2.977c.469-.43.853-.883 1.151-1.357.298-.474.447-1.039.447-1.694 0-.499-.088-.934-.264-1.305a2.525 2.525 0 00-.718-.917 3.169 3.169 0 00-1.064-.543 4.531 4.531 0 00-1.312-.183c-.47 0-.905.064-1.306.19-.4.128-.753.314-1.056.558-.303.244-.55.55-.74.917-.191.366-.306.79-.345 1.268l1.848.147c.059-.43.23-.772.513-1.027.284-.254.646-.381 1.086-.381.205 0 .398.032.579.095.18.064.34.154.477.272a1.262 1.262 0 01.455.997c0 .176-.035.345-.103.506a2.52 2.52 0 01-.257.462 3.476 3.476 0 01-.345.418c-.127.132-.249.257-.366.374l-4.034 3.901V20h6.952z" fill="#305269" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else if eq $i 2}} | {{else if eq $i 2}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#865B45" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#E7C5AC" cx="12" cy="14.667" r="12"></circle><circle fill="#FEDDC7" cx="12" cy="14.667" r="9.333"></circle><path d="M12.239 20.176c.46 0 .902-.066 1.327-.198.425-.132.8-.328 1.122-.587.323-.259.58-.579.77-.96.19-.382.286-.822.286-1.32 0-.646-.171-1.203-.513-1.672-.343-.47-.846-.753-1.511-.851v-.03c.557-.136.992-.422 1.305-.857.313-.435.47-.932.47-1.489 0-.46-.09-.863-.272-1.21a2.547 2.547 0 00-.726-.865 3.232 3.232 0 00-1.056-.521 4.521 4.521 0 00-1.276-.176 4.52 4.52 0 00-1.1.132 3.404 3.404 0 00-.968.403 2.79 2.79 0 00-.762.697 3.181 3.181 0 00-.499.997l1.863.499c.127-.362.33-.643.608-.843.279-.2.594-.301.946-.301.44 0 .797.127 1.071.381.274.255.41.582.41.983 0 .313-.058.562-.175.748a1.17 1.17 0 01-.462.425 1.903 1.903 0 01-.646.191 6.09 6.09 0 01-.74.044h-.455v1.584h.425c.264 0 .533.02.807.059.274.039.52.115.74.227.22.112.402.274.543.484.142.21.213.482.213.814a1.533 1.533 0 01-.52 1.18 1.772 1.772 0 01-.558.33 1.88 1.88 0 01-.667.118c-.47 0-.841-.117-1.115-.352s-.464-.567-.572-.997l-1.877.498c.117.43.288.8.513 1.108.225.308.491.56.8.755.307.196.652.34 1.033.433a5.13 5.13 0 001.218.139z" fill="#865B45" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#865B45" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#E7C5AC" cx="12" cy="14.667" r="12"></circle><circle fill="#FEDDC7" cx="12" cy="14.667" r="9.333"></circle><path d="M12.239 20.176c.46 0 .902-.066 1.327-.198.425-.132.8-.328 1.122-.587.323-.259.58-.579.77-.96.19-.382.286-.822.286-1.32 0-.646-.171-1.203-.513-1.672-.343-.47-.846-.753-1.511-.851v-.03c.557-.136.992-.422 1.305-.857.313-.435.47-.932.47-1.489 0-.46-.09-.863-.272-1.21a2.547 2.547 0 00-.726-.865 3.232 3.232 0 00-1.056-.521 4.521 4.521 0 00-1.276-.176 4.52 4.52 0 00-1.1.132 3.404 3.404 0 00-.968.403 2.79 2.79 0 00-.762.697 3.181 3.181 0 00-.499.997l1.863.499c.127-.362.33-.643.608-.843.279-.2.594-.301.946-.301.44 0 .797.127 1.071.381.274.255.41.582.41.983 0 .313-.058.562-.175.748a1.17 1.17 0 01-.462.425 1.903 1.903 0 01-.646.191 6.09 6.09 0 01-.74.044h-.455v1.584h.425c.264 0 .533.02.807.059.274.039.52.115.74.227.22.112.402.274.543.484.142.21.213.482.213.814a1.533 1.533 0 01-.52 1.18 1.772 1.772 0 01-.558.33 1.88 1.88 0 01-.667.118c-.47 0-.841-.117-1.115-.352s-.464-.567-.572-.997l-1.877.498c.117.43.288.8.513 1.108.225.308.491.56.8.755.307.196.652.34 1.033.433a5.13 5.13 0 001.218.139z" fill="#865B45" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else }} | {{else }} | ||||
<div class="org_icon org_icon_num" > | |||||
{{Add $i 1}} | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon" > | |||||
{{Add $i 1}} | |||||
</div> | |||||
</li> | |||||
{{end}} | {{end}} | ||||
<li class="li_avatar"> | <li class="li_avatar"> | ||||
<img class="ui avatar image" src="{{$user.RelAvatarLink}}" > | <img class="ui avatar image" src="{{$user.RelAvatarLink}}" > | ||||
</li> | </li> | ||||
<li class="li_name"> | <li class="li_name"> | ||||
<p class="org_line_hight">{{$user.Name}}</p> | |||||
<a class="org_line_hight re_style nowrap" href="{{$user.HomeLink}}">{{$user.Name}}</a> | |||||
</li> | </li> | ||||
<ul> | |||||
<ul class = 'score'> | |||||
<li class="li_score"> | <li class="li_score"> | ||||
<i class="ri-user-2-line org_line_hight org_icon_color"></i> <p class="p_score">{{$user.Score}}</p> | <i class="ri-user-2-line org_line_hight org_icon_color"></i> <p class="p_score">{{$user.Score}}</p> | ||||
</li> | </li> | ||||
@@ -162,34 +178,43 @@ | |||||
</li> | </li> | ||||
</div> | </div> | ||||
<div class="card_list" > | <div class="card_list" > | ||||
<div class="list_title star_title"> | |||||
<p class="p_text"> <i class="ri-blaze-fill"> </i>{{$.i18n.Tr "org.active"}}</p> | |||||
<div class="list_title act_title"> | |||||
<p class="p_text"> <i class="ri-blaze-fill title_icon"> </i> {{$.i18n.Tr "org.active"}} </p> | |||||
</div> | </div> | ||||
<li style="list-style:none"> | <li style="list-style:none"> | ||||
{{ range $i,$user :=.StarOrgs}} | |||||
<ul class="orgs" style="display: flex;"> | |||||
{{ range $i,$user :=.ActiveOrgs }} | |||||
<ul class="orgs" style="display: flex;position: relative;"> | |||||
{{if eq $i 0}} | {{if eq $i 0}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><defs><path id="rank1_svg__a" d="M13.69 20V9.616h-1.598l-3.139 2.61 1.027 1.218 1.95-1.804V20z"></path></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h32v32H0z"></path><g transform="translate(4 2.667)"><path fill="#D16C11" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#F7C049" cx="12" cy="14.667" r="12"></circle><circle fill="#FEE6AD" cx="12" cy="14.667" r="9.333"></circle><g fill-rule="nonzero"><use fill="#FFF" xlink:href="#rank1_svg__a"></use><use fill="#D74D03" xlink:href="#rank1_svg__a"></use></g></g></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><defs><path id="rank1_svg__a" d="M13.69 20V9.616h-1.598l-3.139 2.61 1.027 1.218 1.95-1.804V20z"></path></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h32v32H0z"></path><g transform="translate(4 2.667)"><path fill="#D16C11" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#F7C049" cx="12" cy="14.667" r="12"></circle><circle fill="#FEE6AD" cx="12" cy="14.667" r="9.333"></circle><g fill-rule="nonzero"><use fill="#FFF" xlink:href="#rank1_svg__a"></use><use fill="#D74D03" xlink:href="#rank1_svg__a"></use></g></g></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else if eq $i 1}} | {{else if eq $i 1}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#305269" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#BDD8F0" cx="12" cy="14.667" r="12"></circle><circle fill="#E1E9FC" cx="12" cy="14.667" r="9.333"></circle><path d="M15.817 20v-1.584h-4.81l3.212-2.977c.469-.43.853-.883 1.151-1.357.298-.474.447-1.039.447-1.694 0-.499-.088-.934-.264-1.305a2.525 2.525 0 00-.718-.917 3.169 3.169 0 00-1.064-.543 4.531 4.531 0 00-1.312-.183c-.47 0-.905.064-1.306.19-.4.128-.753.314-1.056.558-.303.244-.55.55-.74.917-.191.366-.306.79-.345 1.268l1.848.147c.059-.43.23-.772.513-1.027.284-.254.646-.381 1.086-.381.205 0 .398.032.579.095.18.064.34.154.477.272a1.262 1.262 0 01.455.997c0 .176-.035.345-.103.506a2.52 2.52 0 01-.257.462 3.476 3.476 0 01-.345.418c-.127.132-.249.257-.366.374l-4.034 3.901V20h6.952z" fill="#305269" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#305269" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#BDD8F0" cx="12" cy="14.667" r="12"></circle><circle fill="#E1E9FC" cx="12" cy="14.667" r="9.333"></circle><path d="M15.817 20v-1.584h-4.81l3.212-2.977c.469-.43.853-.883 1.151-1.357.298-.474.447-1.039.447-1.694 0-.499-.088-.934-.264-1.305a2.525 2.525 0 00-.718-.917 3.169 3.169 0 00-1.064-.543 4.531 4.531 0 00-1.312-.183c-.47 0-.905.064-1.306.19-.4.128-.753.314-1.056.558-.303.244-.55.55-.74.917-.191.366-.306.79-.345 1.268l1.848.147c.059-.43.23-.772.513-1.027.284-.254.646-.381 1.086-.381.205 0 .398.032.579.095.18.064.34.154.477.272a1.262 1.262 0 01.455.997c0 .176-.035.345-.103.506a2.52 2.52 0 01-.257.462 3.476 3.476 0 01-.345.418c-.127.132-.249.257-.366.374l-4.034 3.901V20h6.952z" fill="#305269" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else if eq $i 2}} | {{else if eq $i 2}} | ||||
<div class="org_icon"> | |||||
<svg width="1em" height="1em" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#865B45" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#E7C5AC" cx="12" cy="14.667" r="12"></circle><circle fill="#FEDDC7" cx="12" cy="14.667" r="9.333"></circle><path d="M12.239 20.176c.46 0 .902-.066 1.327-.198.425-.132.8-.328 1.122-.587.323-.259.58-.579.77-.96.19-.382.286-.822.286-1.32 0-.646-.171-1.203-.513-1.672-.343-.47-.846-.753-1.511-.851v-.03c.557-.136.992-.422 1.305-.857.313-.435.47-.932.47-1.489 0-.46-.09-.863-.272-1.21a2.547 2.547 0 00-.726-.865 3.232 3.232 0 00-1.056-.521 4.521 4.521 0 00-1.276-.176 4.52 4.52 0 00-1.1.132 3.404 3.404 0 00-.968.403 2.79 2.79 0 00-.762.697 3.181 3.181 0 00-.499.997l1.863.499c.127-.362.33-.643.608-.843.279-.2.594-.301.946-.301.44 0 .797.127 1.071.381.274.255.41.582.41.983 0 .313-.058.562-.175.748a1.17 1.17 0 01-.462.425 1.903 1.903 0 01-.646.191 6.09 6.09 0 01-.74.044h-.455v1.584h.425c.264 0 .533.02.807.059.274.039.52.115.74.227.22.112.402.274.543.484.142.21.213.482.213.814a1.533 1.533 0 01-.52 1.18 1.772 1.772 0 01-.558.33 1.88 1.88 0 01-.667.118c-.47 0-.841-.117-1.115-.352s-.464-.567-.572-.997l-1.877.498c.117.43.288.8.513 1.108.225.308.491.56.8.755.307.196.652.34 1.033.433a5.13 5.13 0 001.218.139z" fill="#865B45" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon"> | |||||
<svg width="20px" height="20px" viewBox="0 0 32 32" class="contribution-item-img__2-fih"><g transform="translate(4 2.667)" fill="none" fill-rule="evenodd"><path fill="#865B45" d="M0 0h6.976l5.49 7.642L17.063 0H24L12 16z"></path><circle fill="#E7C5AC" cx="12" cy="14.667" r="12"></circle><circle fill="#FEDDC7" cx="12" cy="14.667" r="9.333"></circle><path d="M12.239 20.176c.46 0 .902-.066 1.327-.198.425-.132.8-.328 1.122-.587.323-.259.58-.579.77-.96.19-.382.286-.822.286-1.32 0-.646-.171-1.203-.513-1.672-.343-.47-.846-.753-1.511-.851v-.03c.557-.136.992-.422 1.305-.857.313-.435.47-.932.47-1.489 0-.46-.09-.863-.272-1.21a2.547 2.547 0 00-.726-.865 3.232 3.232 0 00-1.056-.521 4.521 4.521 0 00-1.276-.176 4.52 4.52 0 00-1.1.132 3.404 3.404 0 00-.968.403 2.79 2.79 0 00-.762.697 3.181 3.181 0 00-.499.997l1.863.499c.127-.362.33-.643.608-.843.279-.2.594-.301.946-.301.44 0 .797.127 1.071.381.274.255.41.582.41.983 0 .313-.058.562-.175.748a1.17 1.17 0 01-.462.425 1.903 1.903 0 01-.646.191 6.09 6.09 0 01-.74.044h-.455v1.584h.425c.264 0 .533.02.807.059.274.039.52.115.74.227.22.112.402.274.543.484.142.21.213.482.213.814a1.533 1.533 0 01-.52 1.18 1.772 1.772 0 01-.558.33 1.88 1.88 0 01-.667.118c-.47 0-.841-.117-1.115-.352s-.464-.567-.572-.997l-1.877.498c.117.43.288.8.513 1.108.225.308.491.56.8.755.307.196.652.34 1.033.433a5.13 5.13 0 001.218.139z" fill="#865B45" fill-rule="nonzero"></path></g></svg> | |||||
</div> | |||||
</li> | |||||
{{else }} | {{else }} | ||||
<div class="org_icon org_icon_num" > | |||||
{{Add $i 1}} | |||||
</div> | |||||
<li class="wi"> | |||||
<div class="org_icon "> | |||||
{{Add $i 1}} | |||||
</div> | |||||
</li> | |||||
{{end}} | {{end}} | ||||
<li class="li_avatar"> | <li class="li_avatar"> | ||||
<img class="ui avatar image" src="{{$user.RelAvatarLink}}" > | <img class="ui avatar image" src="{{$user.RelAvatarLink}}" > | ||||
</li> | </li> | ||||
<li class="li_name"> | <li class="li_name"> | ||||
<p class="org_line_hight">{{$user.Name}}</p> | |||||
<a class="org_line_hight re_style nowrap" href="{{$user.HomeLink}}">{{$user.Name}}</a> | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -249,3 +274,6 @@ window.onload = function() { | |||||
} | } | ||||
</script> | </script> | ||||
<style> | |||||
</style> |
@@ -4,18 +4,19 @@ | |||||
<div class="ui container"> | <div class="ui container"> | ||||
{{template "base/alert" .}} | {{template "base/alert" .}} | ||||
{{template "org/navber" .}} | {{template "org/navber" .}} | ||||
<div class="ui stackable grid"> | |||||
<div class="ui stackable grid"> | |||||
<div class="ui sixteen wide computer column list"> | <div class="ui sixteen wide computer column list"> | ||||
{{ range .Members}} | {{ range .Members}} | ||||
<div class="item ui grid"> | <div class="item ui grid"> | ||||
<div class="ui two wide column"> | <div class="ui two wide column"> | ||||
<img class="ui avatar" src="{{.SizedRelAvatarLink 48}}"> | <img class="ui avatar" src="{{.SizedRelAvatarLink 48}}"> | ||||
</div><div class="ui three wide column"> | |||||
</div> | |||||
<div class="ui three wide column"> | |||||
<div class="meta"><a href="{{.HomeLink}}">{{.Name}}</a></div> | <div class="meta"><a href="{{.HomeLink}}">{{.Name}}</a></div> | ||||
<div class="meta">{{.FullName}}</div> | <div class="meta">{{.FullName}}</div> | ||||
</div><div class="ui four wide column center"> | |||||
</div> | |||||
<div class="ui four wide column center"> | |||||
<div class="meta"> | <div class="meta"> | ||||
{{$.i18n.Tr "org.members.membership_visibility"}} | {{$.i18n.Tr "org.members.membership_visibility"}} | ||||
</div> | </div> | ||||
@@ -29,14 +30,16 @@ | |||||
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.i18n.Tr "org.members.private_helper"}}</a>){{end}} | {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{$.i18n.Tr "org.members.private_helper"}}</a>){{end}} | ||||
{{end}} | {{end}} | ||||
</div> | </div> | ||||
</div><div class="ui three wide column center"> | |||||
</div> | |||||
<div class="ui three wide column center"> | |||||
<div class="meta"> | <div class="meta"> | ||||
{{$.i18n.Tr "org.members.member_role"}} | {{$.i18n.Tr "org.members.member_role"}} | ||||
</div> | </div> | ||||
<div class="meta"> | <div class="meta"> | ||||
<strong>{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock" 16}} {{$.i18n.Tr "org.members.owner"}}{{else}}{{$.i18n.Tr "org.members.member"}}{{end}}</strong> | <strong>{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock" 16}} {{$.i18n.Tr "org.members.owner"}}{{else}}{{$.i18n.Tr "org.members.member"}}{{end}}</strong> | ||||
</div> | </div> | ||||
</div><div class="ui one wide column center"> | |||||
</div> | |||||
<div class="ui one wide column center"> | |||||
<div class="meta"> | <div class="meta"> | ||||
2FA | 2FA | ||||
</div> | </div> | ||||
@@ -49,7 +52,8 @@ | |||||
{{end}} | {{end}} | ||||
</strong> | </strong> | ||||
</div> | </div> | ||||
</div><div class="ui three wide column"> | |||||
</div> | |||||
<div class="ui three wide column"> | |||||
<div class="text right"> | <div class="text right"> | ||||
{{if eq $.SignedUser.ID .ID}} | {{if eq $.SignedUser.ID .ID}} | ||||
<form method="post" action="{{$.OrgLink}}/members/action/leave"> | <form method="post" action="{{$.OrgLink}}/members/action/leave"> | ||||
@@ -42,18 +42,15 @@ | |||||
.active{ | .active{ | ||||
color:#0366D6 !important; | color:#0366D6 !important; | ||||
} | } | ||||
.mleft{ | |||||
margin-left: 30% !important; | |||||
} | |||||
.mbom{ | .mbom{ | ||||
margin-bottom: 10px !important; | margin-bottom: 10px !important; | ||||
} | } | ||||
</style> | </style> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="ui secondary pointing tabular top attached borderless menu navbar mbom"> | |||||
<div class="ui secondary tiny pointing borderless menu center aligned grid mbom"> | |||||
{{with .Org}} | {{with .Org}} | ||||
<a class="{{if $.PageIsOrgHome}}active{{end}} item mleft" href="{{.HomeLink}}"> | |||||
<a class="{{if $.PageIsOrgHome}}active{{end}} item" href="{{.HomeLink}}"> | |||||
{{svg "octicon-home" 16}} {{$.i18n.Tr "org.home"}} | {{svg "octicon-home" 16}} {{$.i18n.Tr "org.home"}} | ||||
</a> | </a> | ||||
{{end}} | {{end}} | ||||
@@ -83,47 +83,36 @@ | |||||
{{ range .tags}} | {{ range .tags}} | ||||
{{if eq .TagName "精选项目"}} | {{if eq .TagName "精选项目"}} | ||||
<div class="ui three cards" style="margin-bottom: 10px;"> | |||||
<div class="ui three stackable cards" style="margin-bottom: 10px;"> | |||||
{{ range .RepoList}} | {{ range .RepoList}} | ||||
<div class="card" > | |||||
<div class="ui raised card"> | |||||
<div class="extra full_height cor" > | |||||
<div class=" header header_card omit" > | |||||
<a class="header_card image poping up " href="{{.Link}}" data-content="{{if .Alias}}{{.Alias}}{{else}}{{.Name}}{{end}}" data-position="top left" data-variation="tiny inverted">{{if .Alias}}{{.Alias}}{{else}}{{.Name}}{{end}}</a> | |||||
<div class="content" style="padding-bottom: 0;"> | |||||
<div class="header" > | |||||
<a href="{{.Link}}">{{if .Alias}}{{.Alias}}{{else}}{{.Name}}{{end}}</a> | |||||
</div> | </div> | ||||
<div class='content descript_height nowrap-2'> | |||||
<div class="description"> | |||||
<p class="nowrap-2"> | |||||
{{.Description}} | {{.Description}} | ||||
</div> | |||||
<div class="content " > | |||||
</p> | |||||
{{if .Topics }} | {{if .Topics }} | ||||
<div class=" tags " style="position: relative;"> | |||||
{{range .Topics}} | |||||
{{if ne . "" }}<a style="max-width:100%;display:inline-flex;" href="{{AppSubUrl}}/explore/repos?q={{.}}&topic={{$.Topic}}" ><span class="ui small label topic omit" >{{.}}</span></a>{{end}} | |||||
{{end}} | |||||
</div> | |||||
{{end}} | |||||
<p> | |||||
{{range .Topics}} | |||||
{{if ne . "" }}<a href="{{AppSubUrl}}/explore/repos?q={{.}}&topic={{$.Topic}}" class="ui small label topic omit" >{{.}}</a>{{end}} | |||||
{{end}} | |||||
</p> | |||||
{{end}} | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class=" extra " style="color:#888888;border-top: none !important;padding-top: 0"> | |||||
<div class="ui mini right compact marg" > | |||||
<a class="item marg "> | |||||
{{svg "octicon-eye" 16}} {{.NumWatches}} | |||||
</a> | |||||
<a class="item marg"> | |||||
{{svg "octicon-star" 16}} {{.NumStars}} | |||||
</a> | |||||
<a class="item marg"> | |||||
{{svg "octicon-git-branch" 16}} {{.NumForks}} | |||||
</a> | |||||
</div> | |||||
<div class="extra content"> | |||||
<span class="right floated date"> | |||||
{{svg "octicon-eye" 16}} {{.NumWatches}}     | |||||
{{svg "octicon-star" 16}} {{.NumStars}}     | |||||
{{svg "octicon-git-branch" 16}} {{.NumForks}} | |||||
</span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
</div> | </div> | ||||
@@ -56,7 +56,7 @@ | |||||
margin:10px 5px ; | margin:10px 5px ; | ||||
} | } | ||||
.tab_2_content { | .tab_2_content { | ||||
min-height: 560px; | |||||
min-height: 380px; | |||||
margin-left: 10px; | margin-left: 10px; | ||||
} | } | ||||
.ac-grid { | .ac-grid { | ||||
@@ -167,6 +167,8 @@ td, th { | |||||
padding-top: 0.5rem ; | padding-top: 0.5rem ; | ||||
} | } | ||||
</style> | </style> | ||||
<div id="mask"> | <div id="mask"> | ||||
<div id="loadingPage"> | <div id="loadingPage"> | ||||
<div class="rect1"></div> | <div class="rect1"></div> | ||||
@@ -198,7 +200,7 @@ td, th { | |||||
<div class="{{if eq $k 0}}active{{end}} title padding0"> | <div class="{{if eq $k 0}}active{{end}} title padding0"> | ||||
<div class="according-panel-heading"> | <div class="according-panel-heading"> | ||||
<div class="accordion-panel-title"> | <div class="accordion-panel-title"> | ||||
<i class="dropdown icon"></i> | |||||
<!--<i class="dropdown icon"></i> --> | |||||
<span class="accordion-panel-title-content"> | <span class="accordion-panel-title-content"> | ||||
<span> | <span> | ||||
<div class="ac-display-inblock title_text acc-margin-bottom"> | <div class="ac-display-inblock title_text acc-margin-bottom"> | ||||
@@ -226,6 +228,7 @@ td, th { | |||||
<div class="content-pad"> | <div class="content-pad"> | ||||
<div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | ||||
<a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | <a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | ||||
<a class="item" data-tab="second{{$k}}" onclick="javascript:parseLog()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||||
</div> | </div> | ||||
<div class="ui tab active" data-tab="first{{$k}}"> | <div class="ui tab active" data-tab="first{{$k}}"> | ||||
<div style="padding-top: 10px;"> | <div style="padding-top: 10px;"> | ||||
@@ -255,184 +258,203 @@ td, th { | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.start_time"}} | |||||
</td> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain_creator"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
<span style="font-size: 12px;" class=""> | |||||
{{if not (eq .StartTime 0)}} | |||||
{{TimeSinceUnix1 .StartTime}} | |||||
{{else}} | |||||
{{TimeSinceUnix1 .CreatedUnix}} | |||||
{{end}} | |||||
</span> | |||||
</div> | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.User.Name}} | |||||
</div> | |||||
</td> | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-duration"> | |||||
{{$.duration}} | |||||
</div> | |||||
</td> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.computing_resources"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-computeresource"> | |||||
{{.ComputeResource}} | |||||
</div> | |||||
</td> | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.mirror"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.Image}} | |||||
</div> | |||||
</td> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.task_type"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-computeresource"> | |||||
{{.JobType}} | |||||
</div> | |||||
</td> | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.dataset_storage_path"}} | |||||
</td> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.gpu_type"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="dataset_storage_path"> | |||||
{{$.dataset_path}} | |||||
</div> | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
{{$.resource_type}} | |||||
</div> | |||||
</td> | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.createtime"}} | |||||
</td> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.code_storage_path"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-createtime"> | |||||
{{TimeSinceUnix1 .CreatedUnix}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-duration"> | |||||
{{$.duration}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="code_storage_path"> | |||||
{{$.code_path}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
<div class="ac-grid-col"> | <div class="ac-grid-col"> | ||||
<table class="ti-form"> | <table class="ti-form"> | ||||
<tbody class="ti-text-form"> | <tbody class="ti-text-form"> | ||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.mirror"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.Image}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "cloudbrain.gpu_type"}} | |||||
{{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w"> | |||||
{{$.resource_type}} | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||||
{{$.datasetname}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
ExitCode | |||||
{{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w"> | <div class="text-span text-span-w"> | ||||
{{$.result.JobStatus.AppExitCode}} | |||||
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{$.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{$.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{$.ShareMemMiB}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "repo.cloudbrain.endtime"}} | |||||
{{$.i18n.Tr "cloudbrain.dataset_storage_path"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||||
{{if not (eq .EndTime 0)}} | |||||
{{TimeSinceUnix1 .EndTime}} | |||||
{{else}} | |||||
-- | |||||
{{end}} | |||||
<div class="text-span text-span-w" id="dataset_storage_path"> | |||||
{{$.dataset_path}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||||
{{$.i18n.Tr "cloudbrain.model_storage_path"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||||
{{$.datasetname}} | |||||
<div class="text-span text-span-w" id="model_storage_path"> | |||||
{{$.model_path}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||||
{{$.i18n.Tr "cloudbrain.code_storage_path"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w"> | |||||
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{$.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{$.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{$.ShareMemMiB}} | |||||
<div class="text-span text-span-w" id="code_storage_path"> | |||||
{{$.code_path}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "repo.cloudbrain_creator"}} | |||||
{{$.i18n.Tr "repo.cloudbrain.time.starttime"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.User.Name}} | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-startTime"> | |||||
{{if not (eq .StartTime 0)}} | |||||
{{TimeSinceUnix1 .StartTime}} | |||||
{{else}} | |||||
-- | |||||
{{end}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "cloudbrain.model_storage_path"}} | |||||
{{$.i18n.Tr "repo.cloudbrain.time.endtime"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="model_storage_path"> | |||||
{{$.model_path}} | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-EndTime"> | |||||
{{if not (eq .EndTime 0)}} | |||||
{{TimeSinceUnix1 .EndTime}} | |||||
{{else}} | |||||
-- | |||||
{{end}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="ac-grid ac-grid-col2"> | |||||
<div class="ac-grid-col"> | |||||
<span class="ti-text-form-label">{{$.i18n.Tr "repo.cloudbrain.exitinfo"}}</span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="ui tab" data-tab="second{{$k}}"> | |||||
<div> | |||||
<div class="ui message message{{.VersionName}}" style="display: none;"> | |||||
<div id="header"></div> | |||||
</div> | |||||
<div class="ui attached log" id="log{{.VersionName}}" style="height: 390px !important; overflow: auto;"> | |||||
<input type="hidden" id="json_value" value="{{$.result.JobStatus.AppExitDiagnostics}}"> | |||||
<span id="info_display" class="info_text"> | |||||
</div> | |||||
</div> | |||||
<div class="ac-grid-col"> | |||||
<span class="info_text"> | |||||
{{$.result.JobStatus.AppExitDiagnostics}} | |||||
</span> | |||||
</div> | |||||
</span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -466,7 +488,6 @@ td, th { | |||||
<script> | <script> | ||||
$('.menu .item').tab() | $('.menu .item').tab() | ||||
$(document).ready(function(){ | $(document).ready(function(){ | ||||
$('.ui.accordion').accordion({selector:{trigger:'.icon'}}); | $('.ui.accordion').accordion({selector:{trigger:'.icon'}}); | ||||
}); | }); | ||||
@@ -474,28 +495,31 @@ td, th { | |||||
$('.secondary.menu .item').tab(); | $('.secondary.menu .item').tab(); | ||||
}); | }); | ||||
let userName | |||||
let repoPath | |||||
let jobName | |||||
$(document).ready(function(){ | |||||
let url = window.location.href; | |||||
let urlArr = url.split('/') | |||||
userName = urlArr.slice(-5)[0] | |||||
repoPath = urlArr.slice(-4)[0] | |||||
jobName = urlArr.slice(-1)[0] | |||||
}) | |||||
function loadLog(version_name){ | |||||
document.getElementById("mask").style.display = "block" | |||||
$.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobName}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { | |||||
$('input[name=end_line]').val(data.EndLine) | |||||
$('input[name=start_line]').val(data.StartLine) | |||||
$(`#log_file${version_name}`).text(data.Content) | |||||
document.getElementById("mask").style.display = "none" | |||||
}).fail(function(err) { | |||||
console.log(err); | |||||
document.getElementById("mask").style.display = "none" | |||||
}); | |||||
function parseLog(){ | |||||
let jsonValue = document.getElementById("json_value").value; | |||||
let jsonObj = JSON.parse(jsonValue); | |||||
let podRoleName = jsonObj["podRoleName"]; | |||||
let html = ""; | |||||
if (podRoleName != null){ | |||||
let task0 = podRoleName["task1-0"]; | |||||
let podEvents = jsonObj["podEvents"]; | |||||
let podEventArray = podEvents[task0]; | |||||
if(podEventArray != null){ | |||||
for(var i=0; i < podEventArray.length;i++){ | |||||
html +="<p><b>[" +podEventArray[i]["reason"] + "]</b></p>"; | |||||
html +="<p>" +podEventArray[i]["message"] + "</p>"; | |||||
html +="<p>" +podEventArray[i]["action"] + "</p>"; | |||||
} | |||||
} | |||||
let extras= jsonObj["extras"]; | |||||
if(extras != null){ | |||||
for(var i=0; i < extras.length;i++){ | |||||
html +="<p><b>[" +extras[i]["reason"] + "]</b></p>"; | |||||
html +="<p>" +extras[i]["message"] + "</p>"; | |||||
html +="<p>" +extras[i]["action"] + "</p>"; | |||||
} | |||||
} | |||||
} | } | ||||
</script> | |||||
document.getElementById("info_display").innerHTML=html; | |||||
} | |||||
</script> |
@@ -173,9 +173,9 @@ | |||||
<div class="inline unite min_title field required"> | <div class="inline unite min_title field required"> | ||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | ||||
{{if .bootFile}} | {{if .bootFile}} | ||||
<input style="width: 33.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | |||||
<input style="width: 35.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | |||||
{{else}} | {{else}} | ||||
<input style="width: 33.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" > | |||||
<input style="width: 35.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" > | |||||
{{end}} | {{end}} | ||||
<span> | <span> | ||||
<i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | ||||
@@ -183,17 +183,9 @@ | |||||
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a> | <a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a> | ||||
</div> | </div> | ||||
<div class="required unite min_title inline field" style="position: relative;"> | |||||
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.dataset"}}</label> | |||||
<select id="cloudbrain_dataset" class="ui search dropdown width80" placeholder="选择数据集" style='width:385px' name="attachment" required> | |||||
{{range .attachments}} | |||||
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option> | |||||
{{end}} | |||||
</select> | |||||
<span class="tooltips">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> | |||||
</div> | |||||
{{template "custom/select_dataset_train" .}} | |||||
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> | |||||
<div class="inline unite min_title field"> | <div class="inline unite min_title field"> | ||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | ||||
<span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | <span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | ||||
@@ -286,7 +286,7 @@ td, th { | |||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w"> | <div class="text-span text-span-w"> | ||||
{{$.resource_spec}} | |||||
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{$.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{$.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{$.ShareMemMiB}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
@@ -299,7 +299,7 @@ td, th { | |||||
<tbody class="ti-text-form"> | <tbody class="ti-text-form"> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
镜像 | |||||
{{$.i18n.Tr "cloudbrain.mirror"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
@@ -27,10 +27,10 @@ | |||||
</div> | </div> | ||||
<div class="field"> | <div class="field"> | ||||
<div class="files"></div> | <div class="files"></div> | ||||
<div class="ui dropzone" id="dropzone" data-upload-url="{{.RepoLink}}/upload-file" data-remove-url="{{.RepoLink}}/upload-remove" data-csrf="{{.CsrfToken}}" data-accepts="{{.UploadAllowedTypes}}" data-max-file="{{.UploadMaxFiles}}" data-max-size="{{.UploadMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div> | |||||
<div class="ui dropzone" id="dropzone" data-upload-url="{{.RepoLink}}/upload-file" data-remove-url="{{.RepoLink}}/upload-remove" data-csrf="{{.CsrfToken}}" data-accepts="{{.UploadAllowedTypes}}" data-max-file="{{.UploadMaxFiles}}" data-max-size="{{.UploadMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}" data-max-file-tooltips="{{.i18n.Tr "dropzone.max_file_tooltips"}}" data-max-size-tooltips="{{.i18n.Tr "dropzone.max_size_tooltips"}}"><div class="maxfilesize ui red message" style="display: none;margin: 2.5rem;"></div></div> | |||||
</div> | </div> | ||||
{{template "repo/editor/commit_form" .}} | {{template "repo/editor/commit_form" .}} | ||||
</form> | </form> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
{{template "base/footer" .}} | |||||
{{template "base/footer" .}} |
@@ -169,24 +169,10 @@ | |||||
</select> | </select> | ||||
</div> | </div> | ||||
<!-- 数据集 --> | <!-- 数据集 --> | ||||
<div class="required unite min_title inline field"> | |||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label> | |||||
<select class="ui dropdown width35" id="trainjob_datasets" name="attachment" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}" required> | |||||
{{if $.uuid}} | |||||
<option name="attachment" value="{{$.uuid}}">{{$.datasetName}}</option> | |||||
{{end}} | |||||
{{range .attachments}} | |||||
<option value="">{{$.i18n.Tr "cloudbrain.select_dataset"}}</option> | |||||
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option> | |||||
{{end}} | |||||
</select> | |||||
<span> | |||||
<i class="question circle icon" data-content="{{.i18n.Tr "cloudbrain.dataset_path_rule"}}" data-position="top center" data-variation="inverted mini"></i> | |||||
</span> | |||||
</div> | |||||
<!-- 启动文件 --> | |||||
{{template "custom/select_dataset_train" .}} | |||||
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span> | |||||
<div class="inline unite min_title field required"> | <div class="inline unite min_title field required"> | ||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | |||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | |||||
{{if .bootFile}} | {{if .bootFile}} | ||||
<input style="width: 35.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | <input style="width: 35.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | ||||
{{else}} | {{else}} | ||||
@@ -101,6 +101,7 @@ | |||||
line-height: 30px; | line-height: 30px; | ||||
padding-bottom: 20px; | padding-bottom: 20px; | ||||
} | } | ||||
.ti-form>tbody>tr>td { | .ti-form>tbody>tr>td { | ||||
vertical-align: top; | vertical-align: top; | ||||
white-space: normal; | white-space: normal; | ||||
@@ -114,6 +115,13 @@ td, th { | |||||
text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
white-space: nowrap; | white-space: nowrap; | ||||
} | } | ||||
.text-span-new { | |||||
width: 800px; | |||||
overflow: hidden; | |||||
text-overflow: ellipsis; | |||||
height: 20%; | |||||
word-break: break-all; | |||||
} | |||||
.redo-color{ | .redo-color{ | ||||
color: #3291F8; | color: #3291F8; | ||||
} | } | ||||
@@ -199,7 +207,7 @@ td, th { | |||||
<div class="active title padding0"> | <div class="active title padding0"> | ||||
<div class="according-panel-heading"> | <div class="according-panel-heading"> | ||||
<div class="accordion-panel-title"> | <div class="accordion-panel-title"> | ||||
<i class="dropdown icon"></i> | |||||
<!-- <i class="dropdown icon"></i> --> | |||||
<span class="accordion-panel-title-content"> | <span class="accordion-panel-title-content"> | ||||
<span> | <span> | ||||
<div class="ac-display-inblock title_text acc-margin-bottom"> | <div class="ac-display-inblock title_text acc-margin-bottom"> | ||||
@@ -256,41 +264,38 @@ td, th { | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.train_job.start_time"}} | |||||
</td> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain_creator"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
<span style="font-size: 12px;" class=""> | |||||
{{if not (eq .StartTime 0)}} | |||||
{{TimeSinceUnix1 .StartTime}} | |||||
{{else}} | |||||
{{TimeSinceUnix1 .CreatedUnix}} | |||||
{{end}} | |||||
</span> | |||||
</div> | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.User.Name}} | |||||
</div> | |||||
</td> | |||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "admin.auths.updated"}} | |||||
{{$.i18n.Tr "repo.modelarts.computing_resources"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-computeresource"> | |||||
{{.ComputeResource}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.modelarts.createtime"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="updateTime"> | |||||
{{if not (eq .EndTime 0)}} | |||||
{{TimeSinceUnix1 .EndTime}} | |||||
{{else}} | |||||
{{TimeSinceUnix1 .UpdatedUnix}} | |||||
{{end}} | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-createtime"> | |||||
{{TimeSinceUnix1 .CreatedUnix}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | <tr class="ti-no-ng-animate"> | ||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
@@ -303,8 +308,29 @@ td, th { | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain.datasetdownload"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span-new" id="model_description"> | |||||
{{$.datasetDownloadLink}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "cloudbrain.description"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span-new" id="model_description"> | |||||
{{.Description}} | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
@@ -351,29 +377,41 @@ td, th { | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain.time.starttime"}} | |||||
</td> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||||
{{$.i18n.Tr "repo.cloudbrain_creator"}} | |||||
</td> | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||||
{{.User.Name}} | |||||
<td class="ti-text-form-content"> | |||||
<div class="text-span text-span-w"> | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-startTime"> | |||||
{{if not (eq .StartTime 0)}} | |||||
{{TimeSinceUnix1 .StartTime}} | |||||
{{else}} | |||||
-- | |||||
{{end}} | |||||
</div> | </div> | ||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
<tr class="ti-no-ng-animate"> | |||||
<td class="ti-no-ng-animate ti-text-form-label text-width80"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
{{$.i18n.Tr "cloudbrain.description"}} | |||||
{{$.i18n.Tr "repo.cloudbrain.time.endtime"}} | |||||
</td> | </td> | ||||
<td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
<div class="text-span text-span-w" id="model_storage_path"> | |||||
{{.Description}} | |||||
<div class="text-span text-span-w" id="{{.VersionName}}-EndTime"> | |||||
{{if not (eq .EndTime 0)}} | |||||
{{TimeSinceUnix1 .EndTime}} | |||||
{{else}} | |||||
-- | |||||
{{end}} | |||||
</div> | </div> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
@@ -158,29 +158,18 @@ | |||||
<div class="inline unite min_title field required"> | <div class="inline unite min_title field required"> | ||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | ||||
{{if .bootFile}} | {{if .bootFile}} | ||||
<input style="width: 33.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | |||||
<input style="width: 35.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | |||||
{{else}} | {{else}} | ||||
<input style="width: 33.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" > | |||||
<input style="width: 35.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" > | |||||
{{end}} | {{end}} | ||||
<span> | <span> | ||||
<i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | ||||
</span> | </span> | ||||
<a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a> | <a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a> | ||||
</div> | </div> | ||||
<div class="required unite min_title inline field"> | |||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label> | |||||
<select class="ui dropdown width80" id="trainjob_datasets" name="attachment" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}"> | |||||
{{if $.uuid}} | |||||
<option name="attachment" value="{{$.uuid}}">{{$.datasetName}}</option> | |||||
{{end}} | |||||
{{range .attachments}} | |||||
<option value="">{{$.i18n.Tr "cloudbrain.select_dataset"}}</option> | |||||
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option> | |||||
{{end}} | |||||
</select> | |||||
<span class="tooltips">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span> | |||||
</div> | |||||
{{template "custom/select_dataset_train" .}} | |||||
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span> | |||||
<div class="inline unite min_title field"> | <div class="inline unite min_title field"> | ||||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | ||||
<span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | <span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | ||||
@@ -0,0 +1,86 @@ | |||||
<template> | |||||
<div style="width: 100%;"> | |||||
<div id = "pro_main"> | |||||
<div style="margin-top: 10px;"> | |||||
<b class="pro_item">云脑分析</b> <span class="update_time">数据更新时间:</span> <span style="font-size: 12px;">{{lastUpdatedTime}} / 从有记录起开始统计</span> | |||||
</div> | |||||
<bar-label :width="'95%'" :height="'500px'"></bar-label> | |||||
<div style="margin-top: 20px;"> | |||||
<span class="sta_iterm">统计周期:</span> | |||||
<button type="button" class='btnLast' id = "all" v-bind:class="{colorChange:7==dynamic}" @click="resetPage(),getAllProList('all',7)">所有</button> | |||||
<span style="float:right; margin-right: 20px;"> | |||||
<div style="display:inline-block;margin-left: 40px; "> | |||||
<a class="el-icon-download" v-if="tableData!=''" :href= "'../api/v1/cloudbrainboard/downloadAll'"></a> | |||||
<i class="el-icon-download" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i> | |||||
<!-- <span ><a id = "download_file" :href= "'../api/v1/projectboard/downloadAll'" >下载报告</a> </span> --> | |||||
<span > | |||||
<a id = "download_file" v-if="tableData!=''" :href= "'../api/v1/cloudbrainboard/downloadAll'">下载报告</a> | |||||
<a id = "download_file" v-else="tableData=''" href= "#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'>下载报告</a> | |||||
</span> | |||||
</div> | |||||
</span> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
// import barLabel from './basic/barLabel.vue'; | |||||
const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | |||||
import { export2Excel } from '../excel/util.js' | |||||
export default{ | |||||
name:'ProAnalysis', | |||||
components: { | |||||
// barLabel, | |||||
}, | |||||
methods: { | |||||
popMark(){ | |||||
alert("数据为空时,不能下载!") | |||||
}, | |||||
exportData(){ | |||||
// this.getOneProList(this.pro_id,'all',true,7) | |||||
// this.getOneProList(this.pro_id,'all',false,7) | |||||
// this.fileName() | |||||
if (this.tableDataID!=''){ | |||||
this.currentPage=1 | |||||
var saveFileName = this.getFileName() | |||||
export2Excel(this.columns,this.tableDataID,saveFileName) | |||||
}else{ | |||||
alert("数据为空时,不能下载!") | |||||
} | |||||
}, | |||||
}, | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
.pro_item{ | |||||
font-size: 16px; | |||||
color: rgba(16, 16, 16, 100); | |||||
font-family: SourceHanSansSC-bold; | |||||
} | |||||
.update_time{ | |||||
line-height: 17px; | |||||
font-size: 12px; | |||||
color:rgba(187, 187, 187, 100); | |||||
margin-left: 10px; | |||||
} | |||||
.btnLast{ | |||||
line-height: 1.5; | |||||
margin: -3.5px; | |||||
border: 1px solid rgba(22, 132, 252, 100); | |||||
/* border-right: none; */ | |||||
background: #FFFF; | |||||
color: #1684FC; | |||||
width: 60px; | |||||
height: 30px; | |||||
border-radius:0px 4px 4px 0px; | |||||
} | |||||
</style> |
@@ -26,6 +26,14 @@ | |||||
</span> | </span> | ||||
<UserAnalysis ref='UserAnalysis' v-if="isRouterAlive1" id ="usr"></UserAnalysis> | <UserAnalysis ref='UserAnalysis' v-if="isRouterAlive1" id ="usr"></UserAnalysis> | ||||
</el-tab-pane> | </el-tab-pane> | ||||
<el-tab-pane name="four" id='four' > | |||||
<BrainAnalysis ref='BrainAnalysis'id="brain" v-if="isRouterAlive"></BrainAnalysis> | |||||
<span slot="label"> | |||||
<el-image style="width: 13px; height: 13px" src="/img/pro_rgb.svg"> | |||||
</el-image> | |||||
云脑分析 | |||||
</span> | |||||
</el-tab-pane> | |||||
</el-tabs> | </el-tabs> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -33,12 +41,14 @@ | |||||
<script> | <script> | ||||
import ProAnalysis from './ProAnalysis.vue' | import ProAnalysis from './ProAnalysis.vue' | ||||
import UserAnalysis from './UserAnalysis.vue' | import UserAnalysis from './UserAnalysis.vue' | ||||
import BrainAnalysis from './BrainAnalysis.vue' | |||||
export default { | export default { | ||||
components:{ | components:{ | ||||
'ProAnalysis':ProAnalysis, | 'ProAnalysis':ProAnalysis, | ||||
'UserAnalysis':UserAnalysis, | 'UserAnalysis':UserAnalysis, | ||||
'BrainAnalysis':BrainAnalysis, | |||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
@@ -2752,12 +2752,30 @@ $(document).ready(async () => { | |||||
$('td[data-href]').click(function () { | $('td[data-href]').click(function () { | ||||
window.location = $(this).data('href'); | window.location = $(this).data('href'); | ||||
}); | }); | ||||
// 在String原型对象上添加format方法 | |||||
String.prototype.format = function(){ | |||||
let str = this; | |||||
if(arguments.length == 0){ | |||||
return str; | |||||
}else{ | |||||
Object.keys(arguments).forEach((item,index)=>{ | |||||
str = str.replace(/\?/,arguments[item]) | |||||
}) | |||||
return str | |||||
} | |||||
} | |||||
// Dropzone | // Dropzone | ||||
const $dropzone = $('#dropzone'); | const $dropzone = $('#dropzone'); | ||||
if ($dropzone.length > 0) { | if ($dropzone.length > 0) { | ||||
const filenameDict = {}; | const filenameDict = {}; | ||||
let maxFileTooltips | |||||
let maxSizeTooltips | |||||
if($dropzone.data('max-file-tooltips')&&$dropzone.data('max-size-tooltips')){ | |||||
maxFileTooltips=$dropzone.data('max-file-tooltips').format($dropzone.data('max-file'),$dropzone.data('max-size')) | |||||
maxSizeTooltips=$dropzone.data('max-size-tooltips').format($dropzone.data('max-file')) | |||||
} | |||||
await createDropzone('#dropzone', { | await createDropzone('#dropzone', { | ||||
url: $dropzone.data('upload-url'), | url: $dropzone.data('upload-url'), | ||||
headers: {'X-Csrf-Token': csrf}, | headers: {'X-Csrf-Token': csrf}, | ||||
@@ -2789,6 +2807,28 @@ $(document).ready(async () => { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
this.on('addedfile',(file)=>{ | |||||
if(file.size/(1000*1000)>$dropzone.data('max-size')){ | |||||
this.removeFile(file) | |||||
if(maxFileTooltips){ | |||||
$('.maxfilesize.ui.red.message').text(maxFileTooltips) | |||||
$('.maxfilesize.ui.red.message').css('display','block') | |||||
} | |||||
}else{ | |||||
if(maxFileTooltips){ | |||||
$('.maxfilesize.ui.red.message').css('display','none') | |||||
} | |||||
} | |||||
}); | |||||
this.on('maxfilesexceeded',(file)=>{ | |||||
this.removeFile(file) | |||||
if(maxSizeTooltips){ | |||||
$('.maxfilesize.ui.red.message').text(maxSizeTooltips) | |||||
$('.maxfilesize.ui.red.message').css('display','block') | |||||
} | |||||
}) | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
@@ -12,6 +12,11 @@ a { | |||||
.ui .text.yellow a:hover { | .ui .text.yellow a:hover { | ||||
color: #f2711c!important | color: #f2711c!important | ||||
} | } | ||||
.ui.small.label.topic{ | |||||
margin-bottom: 0; | |||||
font-weight: 400; | |||||
} | |||||
.mb-1 { | .mb-1 { | ||||
margin-bottom: 8px !important; | margin-bottom: 8px !important; | ||||
} | } | ||||
@@ -142,6 +147,11 @@ footer { | |||||
width:auto; | width:auto; | ||||
margin:10px auto; | margin:10px auto; | ||||
} | } | ||||
.ui.card>.extra, .ui.cards>.card>.extra{ | |||||
border-top:none !important; | |||||
padding: .5em .5em 1em; | |||||
} | |||||
#index-project .ui.card>.content, #index-project.ui.cards>.card>.content{ | #index-project .ui.card>.content, #index-project.ui.cards>.card>.content{ | ||||
padding: 0.5em 0.2em; | padding: 0.5em 0.2em; | ||||
} | } | ||||
@@ -707,7 +717,7 @@ display: block; | |||||
#repo-files-table .age, | #repo-files-table .age, | ||||
#repo-files-table .ui.sha.label, | #repo-files-table .ui.sha.label, | ||||
#repo-files-table .commit-button, | #repo-files-table .commit-button, | ||||
.members | |||||
.repository .members | |||||
{ | { | ||||
display: none !important; | display: none !important; | ||||
} | } | ||||
@@ -820,6 +830,7 @@ display: block; | |||||
font-size: 14px; | font-size: 14px; | ||||
text-align: center; | text-align: center; | ||||
font-family: SourceHanSansSC-light; | font-family: SourceHanSansSC-light; | ||||
font-weight: normal !important; | |||||
} | } | ||||
.title_re{ | .title_re{ | ||||
margin-top: 50px !important; | margin-top: 50px !important; | ||||
@@ -871,13 +882,16 @@ display: block; | |||||
line-height: 28px; | line-height: 28px; | ||||
} | } | ||||
.org_icon{ | .org_icon{ | ||||
margin-top: 10px; | |||||
margin-top: 2px; | |||||
margin-right: 10px; | margin-right: 10px; | ||||
padding-left: 15px; | padding-left: 15px; | ||||
width: 100% ; | |||||
text-align: center ; | |||||
} | } | ||||
.org_icon_num{ | |||||
margin-left: 2px; | |||||
margin-right: 13px; | |||||
.re_style{ | |||||
color: rgba(3, 102, 214, 100) !important; | |||||
font-family:SourceHanSansSC-medium; | |||||
font-weight: 700; | |||||
} | } | ||||
.org_icon_color{ | .org_icon_color{ | ||||
color: #FA8C16; | color: #FA8C16; | ||||
@@ -894,6 +908,26 @@ display: block; | |||||
list-style:none; | list-style:none; | ||||
margin-left: 2px; | margin-left: 2px; | ||||
} | } | ||||
.score{ | |||||
position:absolute; | |||||
width: 50px; | |||||
right:50px; | |||||
text-align: center; | |||||
} | |||||
.wi{ | |||||
width: 15%; | |||||
line-height: 20px; | |||||
} | |||||
.title_icon{ | |||||
vertical-align: sub; | |||||
font-size: 24px; | |||||
} | |||||
.title_word{ | |||||
vertical-align: middle; | |||||
font-size: 18px; | |||||
margin-top:1px; | |||||
} | |||||
/**seach**/ | /**seach**/ | ||||
/**搜索导航条适配窄屏**/ | /**搜索导航条适配窄屏**/ | ||||
.seachnav{ | .seachnav{ | ||||
@@ -934,6 +968,7 @@ display: block; | |||||
.highlight{ | .highlight{ | ||||
color: red; | color: red; | ||||
} | } | ||||
.ui.list .list>.item>img.image+.content, .ui.list>.item>img.image+.content { | .ui.list .list>.item>img.image+.content, .ui.list>.item>img.image+.content { | ||||
width: calc(100% - 4.0em); | width: calc(100% - 4.0em); | ||||
margin-left: 0; | margin-left: 0; | ||||