Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
andre8244 committed Jun 3, 2024
1 parent 347bfdd commit f378c61
Show file tree
Hide file tree
Showing 7 changed files with 365 additions and 286 deletions.
3 changes: 2 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"watch": "vue-cli-service build --watch"
"watch": "vue-cli-service build --watch",
"format": "prettier --write src/"
},
"dependencies": {
"@carbon/icons-vue": "^10.37.0",
Expand Down
8 changes: 1 addition & 7 deletions ui/src/components/AppMobileSideMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
<transition name="slide-menu">
<div
v-if="isMenuShown"
class="
mobile-side-menu
cv-side-nav
bx--side-nav bx--side-nav__navigation
bx--side-nav--expanded
app-side-nav
"
class="mobile-side-menu cv-side-nav bx--side-nav bx--side-nav__navigation bx--side-nav--expanded app-side-nav"
>
<AppSideMenuContent />
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/AppSideMenuContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
Settings20,
Information20,
Activity20,
DataBase20
DataBase20,
},
mixins: [QueryParamService, UtilService],
data() {
Expand Down
26 changes: 14 additions & 12 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<template>
<NsTextInput
:label="$t('settings.sftpgo_path')"
:placeholder="$t('common.eg_value', {value: '/sftpgo'})"
:placeholder="$t('common.eg_value', { value: '/sftpgo' })"
v-model.trim="path"
class="mg-bottom"
:invalid-message="$t(error.path)"
Expand All @@ -32,16 +32,12 @@
tooltipDirection="right"
>
<template slot="tooltip">
<div
v-html="
$t('settings.sftpgo_path_tips')
"
></div>
<div v-html="$t('settings.sftpgo_path_tips')"></div>
</template>
</NsTextInput>
<NsTextInput
:label="$t('settings.sftp_tcp_port')"
:placeholder="$t('common.eg_value', {value: '3092'})"
:placeholder="$t('common.eg_value', { value: '3092' })"
type="number"
v-model.trim="sftp_tcp_port"
class="mg-bottom"
Expand All @@ -54,7 +50,9 @@
<template slot="tooltip">
<div
v-html="
$t('settings.sftp_tcp_port_tips', {port: sftp_tcp_port || '{tcp_port}'})
$t('settings.sftp_tcp_port_tips', {
port: sftp_tcp_port || '{tcp_port}',
})
"
></div>
</template>
Expand All @@ -73,8 +71,12 @@
v-html="$t('settings.sftpgo_explanation_tooltips')"
></span>
</template>
<template slot="text-left">{{ $t("common.disabled") }}</template>
<template slot="text-right">{{ $t("common.enabled") }}</template>
<template slot="text-left">{{
$t("common.disabled")
}}</template>
<template slot="text-right">{{
$t("common.enabled")
}}</template>
</NsToggle>
<cv-toggle
value="httpToHttps"
Expand Down Expand Up @@ -226,7 +228,7 @@ export default {
this.path = config.path;
this.sftp_tcp_port = config.sftp_tcp_port.toString();
this.isHttpToHttpsEnabled = config.http2https;
this.isSftpgoPortEnabled = config.sftpgo_service
this.isSftpgoPortEnabled = config.sftpgo_service;
this.loading.getConfiguration = false;
this.focusElement("path");
},
Expand Down Expand Up @@ -336,4 +338,4 @@ export default {
.mg-left {
margin-left: $spacing-05;
}
</style>
</style>
164 changes: 90 additions & 74 deletions ui/src/views/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</cv-column>
</cv-row>
<cv-row>
<template v-if="!sftpgo_isrunning && ! loading.getConfiguration">
<template v-if="!sftpgo_isrunning && !loading.getConfiguration">
<cv-column :md="4" :max="4">
<NsInfoCard
light
Expand All @@ -55,19 +55,23 @@
:loading="loading.getConfiguration"
class="min-height-card"
>
<template slot="content">
<div class="card-rows">
<div class="card-row">
<NsButton kind="ghost" :icon="ArrowRight20" @click="goToAppPage(instanceName, 'settings')">
{{ $t("status.configure_sftpgo") }}
</NsButton>
<template slot="content">
<div class="card-rows">
<div class="card-row">
<NsButton
kind="ghost"
:icon="ArrowRight20"
@click="goToAppPage(instanceName, 'settings')"
>
{{ $t("status.configure_sftpgo") }}
</NsButton>
</div>
</div>
</div>
</template>
</template>
</NsInfoCard>
</cv-column>
</template>
<template v-if="sftpgo_isrunning && ! loading.getConfiguration">
<template v-if="sftpgo_isrunning && !loading.getConfiguration">
<cv-column :md="4" :max="4">
<NsInfoCard
light
Expand All @@ -76,25 +80,29 @@
:loading="loading.getConfiguration"
class="min-height-card"
>
<template slot="content">
<div class="card-rows">
<div class="card-row">
{{ $t("status.default_credentials") }}
<cv-tooltip
alignment="start"
direction="top"
:tip="$t('status.sftpgo_admin_login_tips')"
class="info tooltip-mg-left"
>
</cv-tooltip>
</div>
<div class="card-row">
<NsButton kind="ghost" :icon="Launch20" @click="goToSftpgoAdmin">
{{ $t("status.open_web_admin_page") }}
</NsButton>
<template slot="content">
<div class="card-rows">
<div class="card-row">
{{ $t("status.default_credentials") }}
<cv-tooltip
alignment="start"
direction="top"
:tip="$t('status.sftpgo_admin_login_tips')"
class="info tooltip-mg-left"
>
</cv-tooltip>
</div>
<div class="card-row">
<NsButton
kind="ghost"
:icon="Launch20"
@click="goToSftpgoAdmin"
>
{{ $t("status.open_web_admin_page") }}
</NsButton>
</div>
</div>
</div>
</template>
</template>
</NsInfoCard>
</cv-column>
<cv-column :md="4" :max="4">
Expand All @@ -105,25 +113,29 @@
:loading="loading.getConfiguration"
class="min-height-card"
>
<template slot="content">
<div class="card-rows">
<div class="card-row">
{{ $t("status.default_credentials") }}
<cv-tooltip
alignment="start"
direction="top"
:tip="$t('status.sftpgo_user_login_tips')"
class="info tooltip-mg-left"
>
</cv-tooltip>
<template slot="content">
<div class="card-rows">
<div class="card-row">
{{ $t("status.default_credentials") }}
<cv-tooltip
alignment="start"
direction="top"
:tip="$t('status.sftpgo_user_login_tips')"
class="info tooltip-mg-left"
>
</cv-tooltip>
</div>
<div class="card-row">
<NsButton
kind="ghost"
:icon="Launch20"
@click="goToSftpgoUser"
>
{{ $t("status.open_web_client_page") }}
</NsButton>
</div>
</div>
<div class="card-row">
<NsButton kind="ghost" :icon="Launch20" @click="goToSftpgoUser">
{{ $t("status.open_web_client_page") }}
</NsButton>
</div>
</div>
</template>
</template>
</NsInfoCard>
</cv-column>
<cv-column :md="4" :max="4">
Expand All @@ -134,20 +146,24 @@
:loading="loading.getConfiguration"
class="min-height-card"
>
<template slot="content">
<div class="card-rows">
<div class="card-row">
{{$t("status.External_sftp_tcp_port")}}
<cv-tooltip
alignment="start"
direction="top"
:tip="$t('status.sftp_tcp_port_tips',{port: this.sftp_tcp_port})"
class="info tooltip-mg-left"
>
</cv-tooltip>
<template slot="content">
<div class="card-rows">
<div class="card-row">
{{ $t("status.External_sftp_tcp_port") }}
<cv-tooltip
alignment="start"
direction="top"
:tip="
$t('status.sftp_tcp_port_tips', {
port: this.sftp_tcp_port,
})
"
class="info tooltip-mg-left"
>
</cv-tooltip>
</div>
</div>
</div>
</template>
</template>
</NsInfoCard>
</cv-column>
</template>
Expand Down Expand Up @@ -371,7 +387,7 @@ import {
IconService,
UtilService,
} from "@nethserver/ns8-ui-lib";
import Settings32 from "@carbon/icons-vue/es/settings/32";
import Settings32 from "@carbon/icons-vue/es/settings/32";
export default {
name: "Status",
mixins: [TaskService, QueryParamService, IconService, UtilService],
Expand All @@ -394,22 +410,22 @@ export default {
images: [],
volumes: [],
},
path:"",
sftp_tcp_port:"",
path: "",
sftp_tcp_port: "",
sftpgo_isrunning: "",
backupRepositories: [],
backups: [],
loading: {
getStatus: false,
listBackupRepositories: false,
listBackups: false,
getConfiguration:false
getConfiguration: false,
},
error: {
getStatus: "",
listBackupRepositories: "",
listBackups: "",
getConfiguration:""
getConfiguration: "",
},
};
},
Expand Down Expand Up @@ -459,14 +475,14 @@ export default {
this.listBackupRepositories();
},
methods: {
goToSftpgoAdmin() {
window.open('http://' + this.hostname + this.path+'/web/admin/login');
},
goToSftpgoUser() {
window.open('http://' + this.hostname + this.path+'/web/client/login');
},
async getConfiguration() {
goToSftpgoAdmin() {
window.open("http://" + this.hostname + this.path + "/web/admin/login");
},
goToSftpgoUser() {
window.open("http://" + this.hostname + this.path + "/web/client/login");
},
async getConfiguration() {
this.loading.getConfiguration = true;
this.error.getConfiguration = "";
const taskAction = "get-configuration";
Expand Down Expand Up @@ -512,8 +528,8 @@ export default {
const config = taskResult.output;
this.sftp_tcp_port = config.sftp_tcp_port;
this.sftpgo_isrunning = config.sftpgo_isrunning;
this.path = config.path
this.hostname = config.hostname
this.path = config.path;
this.hostname = config.hostname;
this.loading.getConfiguration = false;
},
async getStatus() {
Expand Down
Loading

0 comments on commit f378c61

Please sign in to comment.