Skip to content

Commit

Permalink
Merge branch 'main' into dev6894
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl authored Mar 14, 2024
2 parents 0cefb1a + 96c28ea commit 7a40a1b
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ permissions:

jobs:
publish-images:
if: github.run_number > 1
uses: NethServer/ns8-github-actions/.github/workflows/publish-branch.yml@v1
10 changes: 9 additions & 1 deletion .github/workflows/test-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Test module

on:
workflow_dispatch:
inputs:
debug_shell:
description: "Debug shell"
required: true
type: boolean
workflow_run:
workflows: ["Publish images"]
types: [completed]
Expand All @@ -12,7 +17,10 @@ jobs:
uses: NethServer/ns8-github-actions/.github/workflows/module-info.yml@main
run_tests:
needs: module
uses: NethServer/ns8-github-actions/.github/workflows/test-on-ubuntu-runner.yml@main
uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@main
with:
args: "ghcr.io/${{needs.module.outputs.owner}}/${{needs.module.outputs.name}}:${{needs.module.outputs.tag}}"
repo_ref: ${{needs.module.outputs.sha}}
debug_shell: ${{ github.event.inputs.debug_shell == 'true' || false }}
secrets:
do_token: ${{ secrets.do_token }}
13 changes: 10 additions & 3 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
"mount": "Mount",
"no_services": "No services",
"no_images": "No images",
"no_volumes": "No volumes"
"no_volumes": "No volumes",
"dokuwiki_webapp": "Dokuwiki webapp",
"not_configured": "Not configured",
"open_webapp": "Open Dokuwiki",
"configure": "Configure"
},
"settings": {
"title": "Settings",
Expand All @@ -43,7 +47,9 @@
"dokuwiki_note": "Note",
"must_be_configured_inside_dokuwiki": "You can configure only Dokuwiki FQDN in this page. To configure other setting go to Dokuwiki webapp",
"go_to_dokuwiki": "Go to Dokuwiki",
"email_format": "Invalid email address"
"email_format": "Invalid email address",
"host_pattern": "Must be a valid fully qualified domain name",
"host_format": "Must be a valid fully qualified domain name"
},
"about": {
"title": "About"
Expand All @@ -68,6 +74,7 @@
"403": "Operation not authorized",
"404": "Resource not found",
"cannot_retrieve_module_info": "Cannot retrieve module info",
"cannot_retrieve_installed_modules": "Cannot retrieve installed modules"
"cannot_retrieve_installed_modules": "Cannot retrieve installed modules",
"cannot_retrieve_configuration": "Cannot retrieve configuration"
}
}
94 changes: 92 additions & 2 deletions ui/src/views/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,52 @@
/>
</div>
</div>
<div class="bx--row">
<div class="bx--col-md-4 bx--col-max-4">
<NsInfoCard
light
:title="$t('status.dokuwiki_webapp')"
:description="
this.host ? this.host : $t('status.not_configured')
"
:icon="Wikis32"
:loading="loading.getConfiguration"
:isErrorShown="error.getConfiguration"
:errorTitle="$t('error.cannot_retrieve_configuration')"
:errorDescription="error.getConfiguration"
class="min-height-card"
>
<template slot="content">
<NsButton
v-if="this.host"
kind="ghost"
:icon="Launch20"
:disabled="loading.getConfiguration"
@click="goToWebapp"
>
{{ $t("status.open_webapp") }}
</NsButton>
<NsButton
v-else
kind="ghost"
:disabled="loading.getConfiguration"
:icon="ArrowRight20"
@click="goToAppPage(instanceName, 'settings')"
>
{{ $t("status.configure") }}
</NsButton>
</template>
</NsInfoCard>
</div>
</div>
<div class="bx--row">
<div class="bx--col-md-4 bx--col-max-4">
<NsInfoCard
light
:title="status ? status.instance : ''"
:description="$t('status.app_instance')"
:icon="Application32"
:loading="loading.status"
:loading="loading.status || loading.getConfiguration"
class="min-height-card"
/>
</div>
Expand All @@ -33,7 +71,7 @@
:titleTooltip="installationNodeTitleTooltip"
:description="$t('status.installation_node')"
:icon="Chip32"
:loading="loading.status"
:loading="loading.status || loading.getConfiguration"
class="min-height-card"
/>
</div>
Expand Down Expand Up @@ -253,6 +291,7 @@ export default {
backupRepositories: [],
backups: [],
loading: {
getConfiguration: true,
status: true,
listBackupRepositories: true,
listBackups: true,
Expand Down Expand Up @@ -284,6 +323,7 @@ export default {
},
},
created() {
this.getConfiguration();
this.getStatus();
this.listBackupRepositories();
},
Expand All @@ -308,6 +348,56 @@ export default {
clearTimeout(this.redirectTimeout);
},
methods: {
goToWebapp() {
window.open(`https://${this.host}`, "_blank");
},
async getConfiguration() {
this.loading.getConfiguration = true;
this.error.getConfiguration = "";
const taskAction = "get-configuration";
// register to task error
this.core.$root.$off(taskAction + "-aborted");
this.core.$root.$once(
taskAction + "-aborted",
this.getConfigurationAborted
);
// register to task completion
this.core.$root.$off(taskAction + "-completed");
this.core.$root.$once(
taskAction + "-completed",
this.getConfigurationCompleted
);
const res = await to(
this.createModuleTaskForApp(this.instanceName, {
action: taskAction,
extra: {
title: this.$t("action." + taskAction),
isNotificationHidden: true,
},
})
);
const err = res[0];
if (err) {
console.error(`error creating task ${taskAction}`, err);
this.error.getConfiguration = this.getErrorMessage(err);
this.loading.getConfiguration = false;
return;
}
},
getConfigurationAborted(taskResult, taskContext) {
console.error(`${taskContext.action} aborted`, taskResult);
this.error.getConfiguration = this.core.$t("error.generic_error");
this.loading.getConfiguration = false;
},
getConfigurationCompleted(taskContext, taskResult) {
const config = taskResult.output;
this.host = config.host;
this.loading.getConfiguration = false;
},
async getStatus() {
this.loading.status = true;
this.error.getStatus = "";
Expand Down

0 comments on commit 7a40a1b

Please sign in to comment.