From 79b9cf3bc1060b9b85cfc3f4625c84b7e1de9207 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Thu, 5 Feb 2015 11:47:27 -0800 Subject: [PATCH] Folder widget and recommended images. --- images/folder.png | Bin 0 -> 734 bytes images/folder@2x.png | Bin 0 -> 1620 bytes images/loading.png | Bin 572 -> 807 bytes images/loading@2x.png | Bin 1397 -> 1703 bytes src/ContainerDetails.react.js | 2 +- src/ContainerHome.react.js | 20 +++++++++++++++++++- src/ContainerStore.js | 13 +++++++------ src/NewContainer.react.js | 1 + styles/containers.less | 12 ++++++++++++ 9 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 images/folder.png create mode 100644 images/folder@2x.png diff --git a/images/folder.png b/images/folder.png new file mode 100644 index 0000000000000000000000000000000000000000..4d0eb553ffd0d136709b84309822c438229d4667 GIT binary patch literal 734 zcmV<40wMj0P)Px%m`OxIRA>e5TFr_RK@k3`emVJf=!3R*>^$~mp zukKYZ;ze*>WMvUS53=NMdV1RGNwWDNn@MI9>>Z{Fndx*_bya;;l_6gUgYoi$jJ>aRS2x72)F9_ZhUJT+>C8L9 z0Z6*|nOHpDxk(>qZu*ZO(%zwK3c_b05oflXB{~L751*n0TTgD&X*n(HkrGni#zma- zW|=M!#kki~c(EQc%WG8`xZcLnvaBjjQ*b@*?0<6`tn)3WZmX=Wi^ypf=5jgNZqg60 zhxU)$7N_WeW2;s%bOW#{M{Py=mbQr-hm`ok&GPxPCcUE9NA95}yvG1VfAP&_cwPE{ z00e{rxStqqm=9D#K>6PCyJOK#Cv(+1N(HTS7>wMn>8S908p!bz3RIU4RV)eDu1f8C zxT|^=^sC1Xwo10p(q^nr&<8P564$vP)$!jhI-&ut!%B@)19UnDqQwoNs-w&GG3P<7 z8g5tLL2ja{%fGZLR)m8D6p-A>$DgpPk(p;+R6j+}T&?I$jo@VmwnnfRq3>=On&2!e0ayBJm&esnnL-~I(m-{Dt<{{7>qdFB+xPk^Wt|tz2Ms}Qr z&0SygtuN?9be@XY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NHk{7 z>wp=>VM}?zPzed!43d!Gp4g0{z>QpjxuU(phFPcr3P-cWzqHpQon#h0o8Wk+1t zXy4Zeh(H+bDBND6x%4gr=0&ECeX51djR|KjPeWpi(OAe5BC3%DB zdynmi3Psq+K7)p=mVoH@85-?@-Yi_5FvDJ1(V|Bn@oH=5D@`21qu@AEE~Zh@iCba! z^O^Rw^D~#B>SY(dcXO>y#r{0|#X3?~P_Vr4!SN2R=RC1>bWkG}VRf#CeAaTNH^qJ0 zfl*w8{Lw8q7xpB~Ns~61?f7E7#%6|xcPO-bsp#p%s}SZmd=95QbcuyyO#Az87cwG} zD0ESG{FCHccf{DpT(6oNs^Ph>_2xZB4YNP3bUF16*C&)~1&rw918|OJCqQDRbv$ig iV|bBauScFkfwTH>s!#JZGA#Kp6M(s~wGqt#AN?OJaQ3bM literal 0 HcmV?d00001 diff --git a/images/loading.png b/images/loading.png index 6217c07530aa0d1ea0544846ff3536dac6439ab9..6d8e97593889a7b030b0a4547d99dbb1319c24e4 100644 GIT binary patch literal 807 zcmV+?1K9kDP)Px%;Ymb6R7ef2R?SOPQ4~MtzBf&y%@j6`_5l$UWiBKp6kBBrN3EchSewFDfzm#L zuz#R}plD&VDRGsMIun$xgi03$VG$EqIffq-I*Xjf`%dS)@##3e34C;Uk8{u0@7#Cq z@80_m{?Sg4&h7R2ediUz84f#00DFMILcnhXG>Jq5f3)g*Ss$7&1%qym*x2lDh5l~# zbpV3l#Bc$AfKBq`8xiCXtj?k6j)#t|P@08`^qa;P&nloN3=w2?ipYA({kVqQMB191 z4Q4U~O>5?TFAs7U*IeM_(O@7-HiKoeJ?T5G`2**VW9-gQ3>LStr%fzL0&q5R&F4fD|BBoEje9aBO(39N4-oBDsPsUy$Sun!(y?uYkpQrdG#RY)Qpu z&VVRBrCN&vz3PU7nB)q!%4KuU_z>1a>N528tsc!@!J}iTGM@5w!4z!u>STC|!Fu@E zJ=$`p`I1*)CoiJPy0~8{n1XGy$fE2`CT)h_JFz$OHBRtmW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v5KkMmG=dS25$4mbMe)}nZ$-mzy= zRNg(7=Pq)6h3RZY|Cnxw{UgtNf64Uj!)}uq43OL7>N4S!x?$Wi>NX3G*;WAZw8HaR z&^Mq(X7>&^l}0msgk??3)?ig%tVK%dCOCs;C?2_pWhAQ@N&<2yDJl{nc&dkpo*vp) z^7AS(mNqA+xY(nPBb0by{i9rg2&kaq~1i$Y3>*?;d%)l4=$K4a-HWie)k8R??e z!CIgUqb--rm~YAT>-v?y@7al$nWUR*6mMRCF5y7m#L}&e?G8{iYG5%j`(dF^Ee6 zJC_)7TyO(xk*7F}`QDaGaLj_^0W*c!i^F)zIY4l2V>XSpizP~rTHCINlx;s>i z^|yuDq@lzhgSqUseYpZig&vcI*`%)NK?cKIzmO|{m|By?Ag#wtw*vjKUjbKxQ(KAE zr?&J#*>Qf@Z7(Z8RYLp~YVhtdvl+PbC0>VlcKfU80#-juUw$jXOCh}YBHK0r=QRB@ zc=9xY_DNo#RzoH1Z4KVyzZpWgAXs9)~(V z3RCUF&-r>&ZJA*vwSn&g{m~1Y(ZbaS7Z>N7#+tT=)8E;M=gO-SWk?2saLzjDyMW{F zOX+%-jbNfvkIc0yWqbp{JuYY7kAce*yAypIb!D9nC4Nf68FyPV>CQNUi5CNXv34Qp zeU#r8F!h}?6Y9h0Vc%?`|3R*$U6BG$3AG{4y@eW(o0MuFYVe+3O;=Vx7OJ@#X;Mm_ z!@4YEFGs!i-Qm&EF7eu)_-aZswtq3`sHv=c89Lr$U3e$V4w1g*(q-=p$O8P;g + ); } else if (this.state.page === this.PAGE_LOGS) { body = ( diff --git a/src/ContainerHome.react.js b/src/ContainerHome.react.js index 673fc3b9..376c9a6c 100644 --- a/src/ContainerHome.react.js +++ b/src/ContainerHome.react.js @@ -1,5 +1,8 @@ +var _ = require('underscore'); var $ = require('jquery'); var React = require('react/addons'); +var RetinaImage = require('react-retina-image'); +var path = require('path'); var ContainerHome = React.createClass({ handleResize: function () { @@ -42,6 +45,21 @@ var ContainerHome = React.createClass({ ); } + console.log(this.props.container.Volumes); + var folders = _.map(this.props.container.Volumes, function (val, key) { + var firstFolder = key.split(path.sep)[1]; + if (!val || val.indexOf(process.env.HOME) === -1) { + return; + } else { + return ( +
+ +
{firstFolder}
+
+ ); + } + + }); return (
@@ -58,7 +76,7 @@ var ContainerHome = React.createClass({

Edit Files

-

Buncha folders

+ {folders}
diff --git a/src/ContainerStore.js b/src/ContainerStore.js index 7e3ad102..f0ef8f15 100644 --- a/src/ContainerStore.js +++ b/src/ContainerStore.js @@ -316,18 +316,19 @@ var ContainerStore = assign(EventEmitter.prototype, { return; } $.ajax({ - url: 'https://kitematic.com/recommended.json', + url: 'https://kitematic.com/recommended/recommended.json', cache: false, dataType: 'json', success: function (res) { var recommended = res.recommended; - async.map(recommended, function (repository, callback) { - $.get('https://registry.hub.docker.com/v1/search?q=' + repository, function (data) { + async.map(recommended, function (rec, callback) { + $.get('https://registry.hub.docker.com/v1/search?q=' + rec.repo, function (data) { console.log(data); var results = data.results; - callback(null, _.find(results, function (r) { - return r.name === repository; - })); + var result = _.find(results, function (r) { + return r.name === rec.repo; + }); + callback(null, _.extend(result, rec)); }); }, function (err, results) { _recommended = results.filter(function(r) { return !!r; }); diff --git a/src/NewContainer.react.js b/src/NewContainer.react.js index 8f024f79..93b02c85 100644 --- a/src/NewContainer.react.js +++ b/src/NewContainer.react.js @@ -118,6 +118,7 @@ var NewContainer = React.createClass({ return (
+
diff --git a/styles/containers.less b/styles/containers.less index 8336abd2..5b5ff980 100644 --- a/styles/containers.less +++ b/styles/containers.less @@ -672,9 +672,21 @@ } .folders { .widget { + padding: 20px 10px; background-color: white; border-radius: 4px; border: 1px solid @gray-lightest; + display: flex; + .folder { + width: 100px; + img { + display: block; + margin: 0 auto; + } + .text { + text-align: center; + } + } } } }