pull/420/head
midoks 2 years ago
parent 2a8958ab84
commit aa8fec2b7e
  1. 18
      plugins/docker/index.py
  2. 29
      plugins/docker/js/docker.js

@ -282,20 +282,20 @@ def dockerLogin():
def repoList(): def repoList():
path = getServerDir()
repostory_info = [] repostory_info = []
user_file = path + '/user.json' user_file = path + '/user.json'
if os.path.exists(user_file): if os.path.exists(user_file):
user_info = mw.readFile(user_file) user_info = mw.readFile(user_file)
if user_info: user_info = json.loads(user_info)
user_info = json.loads(user_info) for i in user_info:
for i in user_info: tmp = {}
tmp = {} tmp["hub_name"] = i["hub_name"]
tmp["hub_name"] = i["hub_name"] tmp["registry"] = i["registry"]
tmp["registry"] = i["registry"] tmp["namespace"] = i["namespace"]
tmp["namespace"] = i["namespace"] tmp['repository_name'] = i["repository_name"]
tmp['repository_name'] = i["repository_name"] repostory_info.append(tmp)
repostory_info.append(tmp)
return mw.returnJson(True, 'ok', repostory_info) return mw.returnJson(True, 'ok', repostory_info)

@ -254,11 +254,10 @@ function repoList(){
<div class="tablescroll">\ <div class="tablescroll">\
<table id="con_list" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\ <table id="con_list" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\
<thead><tr>\ <thead><tr>\
<th>名称</th>\ <th>Name</th>\
<th>版本</th>\ <th>Repository Name</th>\
<th>大小</th>\ <th>NameSpace</th>\
<th>证书</th>\ <th>地址</th>\
<th>描述</th>\
<th style="text-align:right;">操作</th></tr></thead>\ <th style="text-align:right;">操作</th></tr></thead>\
<tbody>\ <tbody>\
' + '</tbody></table>\ ' + '</tbody></table>\
@ -274,7 +273,7 @@ function repoList(){
repoLogin(); repoLogin();
}); });
dPost('image_list', '', {}, function(rdata){ dPost('repo_list', '', {}, function(rdata){
var rdata = $.parseJSON(rdata.data); var rdata = $.parseJSON(rdata.data);
console.log(rdata); console.log(rdata);
if (!rdata.status){ if (!rdata.status){
@ -287,21 +286,11 @@ function repoList(){
for (var i = 0; i < rlist.length; i++) { for (var i = 0; i < rlist.length; i++) {
var tag = rlist[i]['RepoTags'].split(":")[1];
var license = 'null';
var desc = 'null';
if (typeof(rlist[i]['Labels']) == 'null'){
license = 'free';
}
list += '<tr>'; list += '<tr>';
list += '<td>'+rlist[i]['RepoTags']+'</td>'; list += '<td>'+rlist[i]['hub_name']+'</td>';
list += '<td>'+tag+'</td>'; list += '<td>'+rlist[i]['repository_name']+'</td>';
list += '<td>'+toSize(rlist[i]['Size'])+'</td>'; list += '<td>'+rlist[i]['namespace']+'</td>';
list += '<td>'+license+'</td>'; list += '<td>'+rlist[i]['registry']+'</td>';
list += '<td>'+desc+'</td>';
list += '<td>'+'操作'+'</td>'; list += '<td>'+'操作'+'</td>';
list += '</tr>'; list += '</tr>';
} }

Loading…
Cancel
Save