Permalink
Browse files

bundleadmin ui to match remote clone refactor

  • Loading branch information...
erichanson committed Oct 28, 2018
1 parent e58d2cf commit 3c34b50fc710a76bcd249131f47d16e29baf71d6
@@ -43,6 +43,7 @@
\\xcbaa3ca28f33c45c05a82878120a7ef6ad6b65d6001e3af816acbc6184dbe383 var w = $("#"+id);\n\n// remote has, local doesn't\nif (diff_row.get('a_bundle_id') == null) {\n\n w.find('.remote')\n .show()\n .html(diff_row.get('b_name'));\n\n w.find('button.download').show();\n}\n// local has bundle, remote doesn't\nelse if (diff_row.get('b_bundle_id') == null) {\n\n w.find('.local')\n .show()\n .html(diff_row.get('a_name'));\n\n w.find('button.upload').show();\n} // remote has bundle, local doesn't\nelse {\n w.find('.local').html(diff_row.get('a_name'));\n w.find('.remote').html(diff_row.get('b_name'));\n\n // FIXME\n\n var a_commits = diff_row.get('a_commits');\n var b_commits = diff_row.get('b_commits');\n\n\n // search b_commits for commits not in a_commits\n var a_commits_diff = Array();\n var a_in_sync = true;\n for (var i=0;i<a_commits.length;i++) {\n var commit = a_commits[i];\n var present = false;\n for (var j=0;j<b_commits.length;j++) {\n // console.log('comparing', commit, b_commits[j]);\n if (commit.id == b_commits[j].id) {\n present = true;\n }\n }\n if (!present) {\n a_commits_diff.push(commit);\n a_in_sync = false;\n }\n }\n\n // search b_commits for commits not in a_commits\n var b_commits_diff = Array();\n var b_in_sync = true;\n for (var i=0;i<b_commits.length;i++) {\n var commit = b_commits[i];\n var present = false;\n for (var j=0;j<a_commits.length;j++) {\n // console.log('comparing', commit, b_commits[j]);\n if (commit.id == a_commits[j].id) {\n present = true;\n }\n }\n if (!present) {\n b_commits_diff.push(commit);\n b_in_sync = false;\n }\n }\n\n console.log('DONE: ', a_commits_diff, b_commits_diff);\n\n if (!a_in_sync) {\n w.find('.remote').append('++++');\n }\n if (!b_in_sync) {\n w.find('.local').append('++++');\n }\n\n\n\n /*\n w.find('.diff').append(widget('remote_summary_commits_diff', {\n diff_row: diff_row,\n local_schema_name: local_schema_name,\n remote_schema_name: remote_schema_name\n }));\n } else {\n\t console.log('a,b:',a_commits,b_commits);\n w.find('.diff').html('fully in-sync');\n\t w.addClass('insync');\n }\n */\n}\n\nw.find('button.download').click(function() {\n endpoint.schema('bundle').function('remote_clone', [\n diff_row.get('remote_id'),\n remote_schema_name,\n 'bundle'\n ]).then(function() {\n alert('ok');\n }).catch(function(e,o) {\n alert('error');\n console.log('ERROR',e,o);\n });\n});\n\nw.find('button.upload').click(function() {\n endpoint.schema('bundle').function('remote_clone', [\n diff_row.get('local_id'),\n 'bundle',\n remote_schema_name\n ]).then(function() {\n alert('ok');\n }).catch(function(e,o) {\n alert('error');\n console.log('ERROR',e,o);\n });\n});\n\n
\\xccb1a9b0a5cbd99ab62de7cb3527942e4ef3508edfec85258bee49e7b68a468d <tr id="{{= id }}" class="{{= name }}">\n <td class='local'>\n <button class='clone'>clone</button>\n </td>\n \n <td class='remote'>\n <button class='push'>push</button>\n </td>\n</tr>
\\xcd2f6373a78f42179172060a402624a5e1aa7fc5eb436deee3ac2a9ad41cee8a <tr id="{{= id }}" class="{{= name }}">\n <td class='local'>\n <button class='download'>download</button>\n </td>\n \n <td class='remote'>\n <button class='upload'>upload</button>\n </td>\n</tr>
\\xd13e65479151d1c5e693c55807dc8ed1541dc5a2a1d13ff79cfc83378a993edb var w = $("#"+id);\n\n// remote has, local doesn't\nif (diff_row.get('a_bundle_id') == null) {\n\n w.find('.remote')\n .show()\n .html(diff_row.get('b_name'));\n\n w.find('button.download').show();\n}\n// local has bundle, remote doesn't\nelse if (diff_row.get('b_bundle_id') == null) {\n\n w.find('.local')\n .show()\n .html(diff_row.get('a_name'));\n\n w.find('button.upload').show();\n} // remote has bundle, local doesn't\nelse {\n w.find('.local').html(diff_row.get('a_name'));\n w.find('.remote').html(diff_row.get('b_name'));\n\n // FIXME\n\n var a_commits = diff_row.get('a_commits');\n var b_commits = diff_row.get('b_commits');\n\n\n // search b_commits for commits not in a_commits\n var a_commits_diff = Array();\n var a_in_sync = true;\n for (var i=0;i<a_commits.length;i++) {\n var commit = a_commits[i];\n var present = false;\n for (var j=0;j<b_commits.length;j++) {\n // console.log('comparing', commit, b_commits[j]);\n if (commit.id == b_commits[j].id) {\n present = true;\n }\n }\n if (!present) {\n a_commits_diff.push(commit);\n a_in_sync = false;\n }\n }\n\n // search b_commits for commits not in a_commits\n var b_commits_diff = Array();\n var b_in_sync = true;\n for (var i=0;i<b_commits.length;i++) {\n var commit = b_commits[i];\n var present = false;\n for (var j=0;j<a_commits.length;j++) {\n // console.log('comparing', commit, b_commits[j]);\n if (commit.id == a_commits[j].id) {\n present = true;\n }\n }\n if (!present) {\n b_commits_diff.push(commit);\n b_in_sync = false;\n }\n }\n \n if (a_in_sync && b_in_sync) {\n\t w.addClass('insync');\n // w.find('.diff').html('fully in-sync');\n } else {\n\n if (!a_in_sync) {\n w.find('.local').append(widget('remote_summary_commits_diff', {\n commits: a_commits_diff \n }));\n }\n if (!b_in_sync) {\n w.find('.remote').append(widget('remote_summary_commits_diff', {\n commits: b_commits_diff \n }));\n }\n }\n}\n\nw.find('button.download').click(function() {\n console.log(diff_row, remote_schema_name);\n window.diff_row = diff_row;\n endpoint.schema('bundle').function('remote_clone', [\n diff_row.get('b_bundle_id'),\n remote_schema_name,\n 'bundle'\n ]).then(function() {\n alert('ok');\n }).catch(function(e,o) {\n alert('error');\n console.log('ERROR',e,o);\n });\n});\n\nw.find('button.upload').click(function() {\n endpoint.schema('bundle').function('remote_clone', [\n diff_row.get('a_bundle_id'),\n 'bundle',\n remote_schema_name\n ]).then(function() {\n alert('ok');\n }).catch(function(e,o) {\n alert('error');\n console.log('ERROR',e,o);\n });\n});\n\n
\\xd1652b270c9a65148bf220ae1f360c69478a3fe32695b0c357b9eb3c0b64a7d9 <div id="{{= id }}" class="{{= name }}">\n <h2>{{= remote.get('schema_name') }}</h2>\n \n <p><input type='checkbox' class='show_synced' />Show Synchronized Bundles</p>\n \n <table class='diff'>\n <tr>\n <th>local</th>\n <th>remote</th>\n <th>diff</th>\n </tr>\n </table>\n</div>
\\xd2bd926e2dd8a9c6391f9f39982e6cfab14dad4137bb934cfebce686533147d7 .{{= name }} {\n border: 2px dotted;\n}
\\xd3b62f1de7de4bac61ab34022de95ad991b3893a7659c1e8db51914dce9a557e c23a1049-71fc-47e9-aaa8-7269b3ad7ae7
@@ -57,3 +58,4 @@
\\xfaa2a6c9a478652c1105d8d0daaa6b2d98e9917ec70a8c0bc78fc1fc8a08810f var w = $("#"+id);\n\nvar remotes = endpoint.schema('bundle').table('remote_database').rows();\nwidget.sync(remotes, w, function( remote ) {\n return widget('b:remote_summary', { remote: remote });\n});
\\xfc5b311fe0e99b74cd26c23514429f2588e6369072cac2f52f506e73421cf6b1 .{{= name }} {\n color: green;\n}
\\xfcf3a4a7b9b08e845469f287024f5365e6f5e3d667efad128af8f5e54373f104 <div id="{{= id }}" class="{{= name }}">\n <h2>{{= remote.get('schema_name') }}</h2>\n <table class='diff'>\n <tr>\n <th>local difference</th>\n <th>remote difference</th>\n </tr>\n </table>\n</div>
\\xff92d638873c290b9de588277d3210e8cd8c9e8a0a76310bf4f6ae7c067dce09 <span id="{{= id }}" class="{{= name }}">\n \n</span>
@@ -1 +1 @@
13aa5018-d573-4e0c-97ca-7f9fffb6602e org.aquameta.core.bundle eaeb0097-3a99-4d79-90eb-c71843057c38
13aa5018-d573-4e0c-97ca-7f9fffb6602e org.aquameta.core.bundle 32333553-4e54-476e-ad72-3870969face7
@@ -1,5 +1,6 @@
0adf8453-e011-4adc-891f-281d227142ab 13aa5018-d573-4e0c-97ca-7f9fffb6602e ea022e08-ad43-4cba-a6ff-c026b8711f50 \N eb68eace-96e2-4cb3-8ae7-de01ced6c77a 2018-02-12 19:33:09.924397 using function that returns rows
2fe58b79-4fc2-40bd-9a66-1c71451c1e95 13aa5018-d573-4e0c-97ca-7f9fffb6602e f4192a34-24e4-4c9f-875c-25629bff2c56 \N 0adf8453-e011-4adc-891f-281d227142ab 2018-07-23 05:49:51.981727 bundle manager kinda shows commit diffs!
32333553-4e54-476e-ad72-3870969face7 13aa5018-d573-4e0c-97ca-7f9fffb6602e 47c74bab-a009-4a60-aabe-f855b6a53ae7 \N eaeb0097-3a99-4d79-90eb-c71843057c38 2018-10-27 19:23:14.267744 fix bundle admin ui after remote clone refactor
3c46cd36-8ae1-467f-885c-573ad4914fd5 13aa5018-d573-4e0c-97ca-7f9fffb6602e 80b5775e-be97-4cb6-a7cd-2d9e5a84f266 \N \N 2018-01-22 13:53:26.485194 start of bundle remote manager
71a575ad-8eba-4a1a-a9d2-fe2f357ed721 13aa5018-d573-4e0c-97ca-7f9fffb6602e 8cf0518b-9643-407f-b103-20fc052c74c6 \N 2fe58b79-4fc2-40bd-9a66-1c71451c1e95 2018-07-23 06:10:24.67977 bundle manager showing commit diffs
eaeb0097-3a99-4d79-90eb-c71843057c38 13aa5018-d573-4e0c-97ca-7f9fffb6602e 3c996162-6615-43a8-a336-c9466a8e6793 \N 71a575ad-8eba-4a1a-a9d2-fe2f357ed721 2018-08-15 15:34:57.001686 better bundle manager ui
@@ -1,5 +1,6 @@
04f8c980-c0eb-4899-b7bc-7c79c392f0fe
3c996162-6615-43a8-a336-c9466a8e6793
47c74bab-a009-4a60-aabe-f855b6a53ae7
80b5775e-be97-4cb6-a7cd-2d9e5a84f266
8cf0518b-9643-407f-b103-20fc052c74c6
ea022e08-ad43-4cba-a6ff-c026b8711f50
@@ -3,12 +3,19 @@
0bd66bc0-efd3-40fa-80d0-276695adc0d3 f4192a34-24e4-4c9f-875c-25629bff2c56 ("(""(""""(widget)"""",widget)"",id)",c23a1049-71fc-47e9-aaa8-7269b3ad7ae7)
11d3984a-e67d-4b19-a1ba-8f88fff0e73e 3c996162-6615-43a8-a336-c9466a8e6793 ("(""(""""(widget)"""",widget)"",id)",b647a3bf-0940-46d3-b017-fd74cf9f7e9a)
142a72d3-87aa-4f59-a44f-17459e795c4e ea022e08-ad43-4cba-a6ff-c026b8711f50 ("(""(""""(widget)"""",widget)"",id)",7d4a1efa-439e-4689-a314-fcefeb5e8720)
1525857e-1e50-42ac-8b0d-f7ad76188db1 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(endpoint)"""",resource)"",id)",cd5ba0c0-06a2-4440-95b7-5eed98ca5685)
166bc895-757b-4058-9e50-280bf58fec52 ea022e08-ad43-4cba-a6ff-c026b8711f50 ("(""(""""(widget)"""",widget)"",id)",be77388a-8b31-4f94-91e6-7bbae5d32e28)
2522c26a-c199-4512-b944-4e7a8c5f7bb6 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(widget)"""",widget)"",id)",be77388a-8b31-4f94-91e6-7bbae5d32e28)
25d530fc-3b21-478f-97bc-6c277f391434 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(widget)"""",widget)"",id)",b30974da-2153-4ab6-8d60-53a988ff9c11)
25ee0d34-0561-4012-99f5-8365e777e46e 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(widget)"""",widget)"",id)",7d4a1efa-439e-4689-a314-fcefeb5e8720)
2a4bf978-2998-44f7-a93e-60088b5dd060 04f8c980-c0eb-4899-b7bc-7c79c392f0fe ("(""(""""(widget)"""",widget)"",id)",b30974da-2153-4ab6-8d60-53a988ff9c11)
2f590051-57e6-4bae-a87e-867d3febbc24 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(widget)"""",widget)"",id)",c5dd2f81-bff4-45b6-af76-4222e89b0944)
30634f8d-7ede-4647-aee0-0ab5037b4ac2 80b5775e-be97-4cb6-a7cd-2d9e5a84f266 ("(""(""""(widget)"""",widget)"",id)",b30974da-2153-4ab6-8d60-53a988ff9c11)
38f49957-6a21-49b0-96b4-1e2de64436b7 80b5775e-be97-4cb6-a7cd-2d9e5a84f266 ("(""(""""(widget)"""",widget)"",id)",c23a1049-71fc-47e9-aaa8-7269b3ad7ae7)
3e10a565-24e7-4a15-b1f9-81b7aede1db3 f4192a34-24e4-4c9f-875c-25629bff2c56 ("(""(""""(widget)"""",widget)"",id)",7d4a1efa-439e-4689-a314-fcefeb5e8720)
42e6b99a-ea8a-4810-a70d-191ba1e661eb 04f8c980-c0eb-4899-b7bc-7c79c392f0fe ("(""(""""(widget)"""",widget)"",id)",7d4a1efa-439e-4689-a314-fcefeb5e8720)
4ee9e6a4-594f-497a-9be0-0ffc21d58435 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(widget)"""",widget)"",id)",b647a3bf-0940-46d3-b017-fd74cf9f7e9a)
5019e419-1679-468b-88a1-8434fcdfc420 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(endpoint)"""",resource)"",id)",e39887ff-496a-470b-81a5-2c2c1e99d842)
56f7b61b-a0e2-448a-924f-b9cb89b8c46b 04f8c980-c0eb-4899-b7bc-7c79c392f0fe ("(""(""""(endpoint)"""",resource)"",id)",cd5ba0c0-06a2-4440-95b7-5eed98ca5685)
69e0ffbf-5b96-48d6-a226-e6a8638ffe8c 80b5775e-be97-4cb6-a7cd-2d9e5a84f266 ("(""(""""(endpoint)"""",resource)"",id)",cd5ba0c0-06a2-4440-95b7-5eed98ca5685)
6a54a85e-5d2c-4765-beae-e573c64149a4 8cf0518b-9643-407f-b103-20fc052c74c6 ("(""(""""(endpoint)"""",resource)"",id)",cd5ba0c0-06a2-4440-95b7-5eed98ca5685)
@@ -17,6 +24,7 @@
84c2cff7-d76f-4b73-b6f2-14e6900bf547 04f8c980-c0eb-4899-b7bc-7c79c392f0fe ("(""(""""(widget)"""",widget)"",id)",c23a1049-71fc-47e9-aaa8-7269b3ad7ae7)
8dff23ee-e3ab-43bd-9a3c-8c65f80c73e6 f4192a34-24e4-4c9f-875c-25629bff2c56 ("(""(""""(widget)"""",widget)"",id)",b647a3bf-0940-46d3-b017-fd74cf9f7e9a)
9faad72a-6099-42b9-977c-9edc8aadc0cf f4192a34-24e4-4c9f-875c-25629bff2c56 ("(""(""""(widget)"""",widget)"",id)",be77388a-8b31-4f94-91e6-7bbae5d32e28)
a2a0e12c-4990-415b-a960-2bede27773d7 47c74bab-a009-4a60-aabe-f855b6a53ae7 ("(""(""""(widget)"""",widget)"",id)",c23a1049-71fc-47e9-aaa8-7269b3ad7ae7)
aa64a1fd-80a8-4edf-9e49-a579f8ba7a25 3c996162-6615-43a8-a336-c9466a8e6793 ("(""(""""(widget)"""",widget)"",id)",b30974da-2153-4ab6-8d60-53a988ff9c11)
abcf243c-d689-4873-97ab-fe9f44d10a74 8cf0518b-9643-407f-b103-20fc052c74c6 ("(""(""""(widget)"""",widget)"",id)",b30974da-2153-4ab6-8d60-53a988ff9c11)
b7e90c19-ade9-495d-912f-b4f166fc5e47 ea022e08-ad43-4cba-a6ff-c026b8711f50 ("(""(""""(widget)"""",widget)"",id)",c23a1049-71fc-47e9-aaa8-7269b3ad7ae7)
Oops, something went wrong.

0 comments on commit 3c34b50

Please sign in to comment.