Merge pull request #225 from kitematic/fix-search

fixing search using repo info instead
This commit is contained in:
Jeffrey Morgan 2015-03-06 13:32:52 -05:00
commit d280715773
3 changed files with 44 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "Kitematic",
"version": "0.5.9",
"version": "0.5.10",
"author": "Kitematic",
"description": "Simple Docker Container management for Mac OS X.",
"homepage": "https://kitematic.com/",
@ -16,6 +16,7 @@
"release": "gulp release",
"release:beta": "gulp release --beta",
"preinstall": "./util/deps",
"postinstall": "gulp download && if [ `uname` == 'Darwin' ]; then cp util/Info.plist cache/Atom.app/Contents/Info.plist && cp util/kitematic.icns cache/Atom.app/Contents/Resources/atom.icns; fi",
"lint": "jsxhint src && jsxhint browser"
},
"licenses": [
@ -41,7 +42,7 @@
},
"docker-version": "1.5.0",
"docker-machine-version": "0.1.0-kitematic-0.5.9",
"atom-shell-version": "0.21.2",
"atom-shell-version": "0.21.3",
"virtualbox-version": "4.3.24",
"virtualbox-filename": "VirtualBox-4.3.24.pkg",
"virtualbox-checksum": "4a7dff25bdeef0d112e16ac11bee6d52e856d36bb412aa75576036ba560082eb",

View File

@ -67,12 +67,17 @@ var NewContainer = React.createClass({
cache: false,
dataType: 'json',
})).then(res => res.repos).map(repo => {
return $.get('https://registry.hub.docker.com/v1/search?q=' + repo.repo).then(data => {
var results = data.results;
var result = _.find(results, function (r) {
return r.name === repo.repo;
});
return _.extend(result, repo);
var query = repo.repo;
var vals = query.split('/');
if (vals.length === 1) {
query = 'library/' + vals[0];
}
return $.get('https://registry.hub.docker.com/v1/repositories_info/' + query).then(data => {
var res = _.extend(data, repo);
res.description = data.short_description;
res.is_official = data.namespace === 'library';
res.name = data.repo;
return res;
});
}).then(results => {
_recommended = results.filter(r => !!r);

30
util/Info.plist Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Kitematic (Development)</string>
<key>CFBundleExecutable</key>
<string>Atom</string>
<key>CFBundleIconFile</key>
<string>atom.icns</string>
<key>CFBundleIdentifier</key>
<string>com.kitematic.development</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Kitematic (Development)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.8.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>AtomApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>