Commit eddb66d9 authored by akiraohgaki's avatar akiraohgaki

Merge branch 'develop'

parents 5ee0dcbb f4379038
Pipeline #303 passed with stage
in 2 minutes and 4 seconds
......@@ -42,9 +42,9 @@ export default class CollectiondialogComponent extends BaseComponent {
<app-page id="collection" slot="content">
<app-collectionsidebar slot="sidebar"></app-collectionsidebar>
<app-switchview slot="content">
<app-collectiondownload id="download"></app-collectiondownload>
<app-collectionupdate id="update"></app-collectionupdate>
<app-collectioninstalled id="installed"></app-collectioninstalled>
<app-collectionupdate id="update"></app-collectionupdate>
<app-collectiondownload id="download"></app-collectiondownload>
</app-switchview>
</app-page>
</app-dialog>
......@@ -68,14 +68,14 @@ export default class CollectiondialogComponent extends BaseComponent {
_handleCollectionsidebarSelect(event) {
const switchviewComponent = this.contentRoot.querySelector('app-switchview');
switch (event.detail.select) {
case 'download':
switchviewComponent.switch('download');
case 'installed':
switchviewComponent.switch('installed');
break;
case 'update':
switchviewComponent.switch('update');
break;
case 'installed':
switchviewComponent.switch('installed');
case 'download':
switchviewComponent.switch('download');
break;
}
}
......
......@@ -6,19 +6,19 @@ export default class CollectiondownloadComponent extends BaseComponent {
init() {
this._viewHandler_ocsManager_installing = this._viewHandler_ocsManager_installing.bind(this);
this._viewHandler_ocsManager_downloading = this._viewHandler_ocsManager_downloading.bind(this);
this._viewHandler_ocsManager_downloadProgress = this._viewHandler_ocsManager_downloadProgress.bind(this);
}
componentConnectedCallback() {
this.getStateManager().viewHandler
.add('ocsManager_installing', this._viewHandler_ocsManager_installing)
.add('ocsManager_downloading', this._viewHandler_ocsManager_downloading);
.add('ocsManager_downloadProgress', this._viewHandler_ocsManager_downloadProgress);
}
componentDisconnectedCallback() {
this.getStateManager().viewHandler
.remove('ocsManager_installing', this._viewHandler_ocsManager_installing)
.remove('ocsManager_downloading', this._viewHandler_ocsManager_downloading);
.remove('ocsManager_downloadProgress', this._viewHandler_ocsManager_downloadProgress);
}
render() {
......@@ -70,7 +70,7 @@ export default class CollectiondownloadComponent extends BaseComponent {
width: 100%;
margin: 0.5em 0;
}
progress[data-progress][value=""] {
progress[data-progress][value="0"] {
display: none;
}
......@@ -108,9 +108,9 @@ export default class CollectiondownloadComponent extends BaseComponent {
<i class="material-icons md-larger md-dark">cloud_download</i>
</figure>
<div data-main>
<span data-name>${state.metadata.filename}</span>
<progress data-progress value="" max=""></progress>
<span data-message>${state.message}</span>
<h4 data-name>${state.metadata.filename}</h4>
<progress data-progress value="0" max="1"></progress>
<p data-message>${state.message}</p>
</div>
<nav data-action>
<!--<button data-action="" data-item-key="">Cancel</button>-->
......@@ -122,7 +122,10 @@ export default class CollectiondownloadComponent extends BaseComponent {
_viewHandler_ocsManager_installing(state) {
const listItem = this.contentRoot.querySelector(`li[data-url="${state.metadata.url}"]`);
if (listItem) {
listItem.querySelector('span[data-message]').textContent = state.message;
listItem.querySelector('p[data-message]').textContent = state.message;
if (state.status === 'success_install') {
listItem.querySelector('progress[data-progress]').value = '0';
}
}
else {
this.contentRoot.querySelector('ul[data-container]')
......@@ -130,17 +133,15 @@ export default class CollectiondownloadComponent extends BaseComponent {
}
}
_viewHandler_ocsManager_downloading(state) {
_viewHandler_ocsManager_downloadProgress(state) {
const listItem = this.contentRoot.querySelector(`li[data-url="${state.url}"]`);
if (listItem) {
const progress = listItem.querySelector('progress[data-progress]');
progress.value = '' + state.bytesReceived;
progress.max = '' + state.bytesTotal;
listItem.querySelector('progress[data-progress]').value = '' + state.bytesReceived/state.bytesTotal;
const message = 'Downloading... '
+ Chilit.Utility.convertByteToHumanReadable(state.bytesReceived)
+ ' / '
+ Chilit.Utility.convertByteToHumanReadable(state.bytesTotal);
listItem.querySelector('span[data-message]').textContent = message;
listItem.querySelector('p[data-message]').textContent = message;
}
}
......
......@@ -105,7 +105,7 @@ export default class CollectioninstalledComponent extends BaseComponent {
<li>
<figure data-previewpic style="background-image: url('${previewpicUrl}');"></figure>
<div data-main>
<span data-name>${file}</span>
<h4 data-name>${file}</h4>
</div>
<nav data-action>
<button data-action="ocsManager_openUrl" data-url="${fileUrl}">${openButtonText}</button>
......
......@@ -194,8 +194,18 @@ export default class CollectionsidebarComponent extends BaseComponent {
}
_viewHandler_ocsManager_installedItems(state) {
this.contentRoot.querySelector('nav ul[data-menu="category"]')
.innerHTML = this._categoryMenuItemsHtml(state);
const categoryMenu = this.contentRoot.querySelector('nav ul[data-menu="category"]');
const selectedMenuItem = categoryMenu.querySelector('a[data-selected]');
const installType = selectedMenuItem ? selectedMenuItem.getAttribute('data-install-type') : '';
categoryMenu.innerHTML = this._categoryMenuItemsHtml(state);
const menuItem = installType ? categoryMenu.querySelector(`a[data-install-type="${installType}"]`) : null;
if (menuItem) {
menuItem.click();
}
}
_viewHandler_ocsManager_updateAvailableItems(state) {
......
......@@ -6,19 +6,19 @@ export default class CollectionupdateComponent extends BaseComponent {
this.contentRoot.addEventListener('click', this._handleClick.bind(this));
this._viewHandler_ocsManager_updateAvailableItems = this._viewHandler_ocsManager_updateAvailableItems.bind(this);
this._viewHandler_ocsManager_updating = this._viewHandler_ocsManager_updating.bind(this);
this._viewHandler_ocsManager_updateProgress = this._viewHandler_ocsManager_updateProgress.bind(this);
}
componentConnectedCallback() {
this.getStateManager().viewHandler
.add('ocsManager_updateAvailableItems', this._viewHandler_ocsManager_updateAvailableItems)
.add('ocsManager_updating', this._viewHandler_ocsManager_updating);
.add('ocsManager_updateProgress', this._viewHandler_ocsManager_updateProgress);
}
componentDisconnectedCallback() {
this.getStateManager().viewHandler
.remove('ocsManager_updateAvailableItems', this._viewHandler_ocsManager_updateAvailableItems)
.remove('ocsManager_updating', this._viewHandler_ocsManager_updating);
.remove('ocsManager_updateProgress', this._viewHandler_ocsManager_updateProgress);
}
render() {
......@@ -68,7 +68,7 @@ export default class CollectionupdateComponent extends BaseComponent {
width: 100%;
margin: 0.5em 0;
}
progress[data-progress][value=""] {
progress[data-progress][value="0"] {
display: none;
}
......@@ -110,9 +110,9 @@ export default class CollectionupdateComponent extends BaseComponent {
<li data-item-key="${key}">
<figure data-previewpic style="background-image: url('${previewpicUrl}');"></figure>
<div data-main>
<span data-name>${file}</span>
<progress data-progress value="" max=""></progress>
<span data-message></span>
<h4 data-name>${file}</h4>
<progress data-progress value="0" max="1"></progress>
<p data-message></p>
</div>
<nav data-action>
<button data-action="ocsManager_update" data-item-key="${key}" data-status="active">Update</button>
......@@ -142,14 +142,12 @@ export default class CollectionupdateComponent extends BaseComponent {
.innerHTML = this._listItemsHtml(state);
}
_viewHandler_ocsManager_updating(state) {
_viewHandler_ocsManager_updateProgress(state) {
const listItem = this.contentRoot.querySelector(`li[data-item-key="${state.itemKey}"]`);
if (listItem) {
const progress = listItem.querySelector('progress[data-progress]');
progress.value = '' + state.progress;
progress.max = '1';
listItem.querySelector('progress[data-progress]').value = '' + state.progress;
const message = `Updating... ${Math.ceil(state.progress * 100)}%`;
listItem.querySelector('span[data-message]').textContent = message;
listItem.querySelector('p[data-message]').textContent = message;
}
}
......
......@@ -131,7 +131,7 @@ export default class OcsManagerHandler {
metadata: data.metadata
};
})
.add('ocsManager_downloading', (data) => {
.add('ocsManager_downloadProgress', (data) => {
return {
url: data.url,
bytesReceived: data.bytesReceived,
......@@ -148,7 +148,7 @@ export default class OcsManagerHandler {
this._ocsManagerApi.send('UpdateHandler::update', [data.itemKey]);
return false;
})
.add('ocsManager_updating', (data) => {
.add('ocsManager_updateProgress', (data) => {
return {
itemKey: data.itemKey,
progress: data.progress
......@@ -210,7 +210,7 @@ export default class OcsManagerHandler {
});
})
.set('ItemHandler::downloadProgress', (message) => {
this._stateManager.dispatch('ocsManager_downloading', {
this._stateManager.dispatch('ocsManager_downloadProgress', {
url: message.data[0],
bytesReceived: message.data[1],
bytesTotal: message.data[2]
......@@ -293,7 +293,7 @@ export default class OcsManagerHandler {
this._stateManager.dispatch('ocsManager_updateAvailableItems', {});
})
.set('UpdateHandler::updateProgress', (message) => {
this._stateManager.dispatch('ocsManager_updating', {
this._stateManager.dispatch('ocsManager_updateProgress', {
itemKey: message.data[0],
progress: message.data[1]
});
......
......@@ -5,14 +5,18 @@ export OPENSSL_CONF=/etc/ssl/
PREFIX="$(cd "$(dirname "${0}")" && pwd)"
if [ ${APPIMAGE} ]; then
export PATH=${PREFIX}/usr/local/bin:${PREFIX}/usr/bin:${PATH}
fi
if [ -f "${PREFIX}/ocs-store-linux-x64/ocs-store" ]; then
${PREFIX}/ocs-store-linux-x64/ocs-store
elif [ -f "${PREFIX}/../lib/ocs-store-linux-x64/ocs-store" ]; then
${PREFIX}/../lib/ocs-store-linux-x64/ocs-store
elif [ -f "${PREFIX}/usr/local/lib/ocs-store-linux-x64/ocs-store" ]; then
${PREFIX}/usr/local/lib/ocs-store-linux-x64/ocs-store
elif [ -f "${PREFIX}/usr/lib/ocs-store-linux-x64/ocs-store" ]; then
${PREFIX}/usr/lib/ocs-store-linux-x64/ocs-store
elif [ -f "${PREFIX}/../lib/ocs-store-linux-x64/ocs-store" ]; then
${PREFIX}/../lib/ocs-store-linux-x64/ocs-store
else
exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment