Skip to content
Snippets Groups Projects

Topic/1689 fix linting issues

8 files
+ 260
187
Compare changes
  • Side-by-side
  • Inline

Files

+ 182
143
<template>
<template>
<div id="SupportAdmin" class="container">
<div id="SupportAdmin" class="container">
<b-row>
<b-row>
<div class="col-sm-8">
<div class="col-sm-8">
<div>
<div>
<h4>{{ $t('headline') }}</h4>
<h4>{{ $t("headline") }}</h4>
</div>
</div>
</div>
</b-row>
</div>
<b-row>
</b-row>
<div class="col-sm-2"></div>
<b-row>
<div class="col-sm-8">
<div class="col-sm-2"></div>
<b-form id="project_request_form" @submit.stop.prevent="onSubmit">
<div class="col-sm-8">
<b-input-group class="mt-3">
<b-form id="project_request_form" @submit.stop.prevent="onSubmit">
 
<b-input-group class="mt-3">
 
<b-form-input
 
id="projectId"
 
ref="projectId"
 
v-model="form.projectId"
 
aria-describedby="projectHelp"
 
:placeholder="$t('projectInputTooltip')"
 
>
 
</b-form-input>
 
<b-input-group-append>
 
<b-button
 
variant="primary"
 
id="query_project_button"
 
@click="queryProject()"
 
>{{ $t("projectSelectButton") }}</b-button
 
>
 
</b-input-group-append>
 
</b-input-group>
 
</b-form>
 
<h5 id="project_query_status">{{ requestStatus }}</h5>
 
<b-container fluid>
 
<b-row class="my-1">
 
<b-col sm="2">
 
<label for="project_name">{{ $t("projectName") }}</label>
 
</b-col>
 
<b-col sm="10">
<b-form-input
<b-form-input
id="projectId"
id="project_name"
ref="projectId"
v-model="form.projectName"
v-model="form.projectId"
:readonly="true"
aria-describedby="projectHelp"
></b-form-input>
:placeholder="$t('projectInputTooltip')">
</b-col>
</b-form-input>
</b-row>
<b-input-group-append>
<b-row class="my-1">
<b-button variant="primary" id="query_project_button" @click="queryProject()">{{ $t('projectSelectButton') }}</b-button>
<b-col sm="2">
</b-input-group-append>
<label for="project_short_name">{{
</b-input-group>
$t("projectShortName")
</b-form>
}}</label>
<h5 id='project_query_status'>{{ requestStatus }}</h5>
</b-col>
<b-container fluid>
<b-col sm="10">
<b-row class="my-1">
<b-form-input
<b-col sm="2">
id="project_short_name"
<label for="project_name">{{ $t('projectName') }}</label>
v-model="form.projectShortName"
</b-col>
:readonly="true"
<b-col sm="10">
></b-form-input>
<b-form-input id="project_name" v-model="form.projectName" :readonly="true"></b-form-input>
</b-col>
</b-col>
</b-row>
</b-row>
<b-row class="my-1">
<b-row class="my-1">
<b-col sm="2">
<b-col sm="2">
<label for="project_guid">{{ $t("projectGuid") }}</label>
<label for="project_short_name">{{ $t('projectShortName') }}</label>
</b-col>
</b-col>
<b-col sm="10">
<b-col sm="10">
<b-form-input
<b-form-input id="project_short_name" v-model="form.projectShortName" :readonly="true"></b-form-input>
id="project_guid"
</b-col>
v-model="form.projectGuid"
</b-row>
:readonly="true"
<b-row class="my-1">
></b-form-input>
<b-col sm="2">
</b-col>
<label for="project_guid">{{ $t('projectGuid') }}</label>
</b-row>
</b-col>
</b-container>
<b-col sm="10">
<h5 style="text-align: left">{{ $t("projectQuotaHeadline") }}:</h5>
<b-form-input id="project_guid" v-model="form.projectGuid" :readonly="true"></b-form-input>
<b-table
</b-col>
id="project_qouta_table"
</b-row>
:fields="headers"
</b-container>
:items="projectQuotas"
<h5 style="text-align: left;">{{ $t('projectQuotaHeadline') }}:</h5>
:busy="busy"
<b-table
:locale="$i18n.locale"
id="project_qouta_table"
:sort-by.sync="sortBy"
:fields="headers"
:sort-desc.sync="sortDesc"
:items="projectQuotas"
:show-empty="true"
:busy="busy"
:empty-text="emptyText"
:locale="$i18n.locale"
fixed
:sort-by.sync="sortBy"
sticky-header="100%"
:sort-desc.sync="sortDesc"
no-border-collapse
:show-empty="true"
sort-icon-right
:empty-text="emptyText"
striped
fixed
bordered
sticky-header="100%"
outlined
no-border-collapse
hover
sort-icon-right
head-variant="dark"
striped
>
bordered
<template #cell(newQuota)="row">
outlined
<b-form-input
hover
id="data"
head-variant="dark">
v-model="row.item.newQuota"
<template #cell(newQuota)="row">
aria-describedby="projectHelp"
<b-form-input
:placeholder="$t('newQuotaInputPlaceHolder')"
id="data"
>
v-model="row.item.newQuota"
</b-form-input>
aria-describedby="projectHelp"
</template>
:placeholder="$t('newQuotaInputPlaceHolder')">
<template #cell(action)="row">
</b-form-input>
<button
</template>
id="action"
<template #cell(action)="row">
v-on:click.stop.prevent="saveNewQuota(row.item)"
<button id=action v-on:click.stop.prevent="saveNewQuota(row.item)" class="btn btn-primary float-right">{{ $t('save') }}</button>
class="btn btn-primary float-right"
</template>
>
</b-table>
{{ $t("save") }}
</div>
</button>
</b-row>
</template>
</div>
</b-table>
 
</div>
 
</b-row>
 
</div>
</template>
</template>
<script lang="ts">
<script lang="ts">
import Vue from 'vue';
import Vue from "vue";
import { GuidUtil } from '@coscine/app-util';
import { GuidUtil } from "@coscine/app-util";
import { AdminApi } from '@coscine/api-connection';
import { AdminApi } from "@coscine/api-connection";
import { ToastPlugin } from 'bootstrap-vue';
import { ToastPlugin } from "bootstrap-vue";
import { error } from 'jquery';
import { error } from "jquery";
Vue.use(ToastPlugin);
Vue.use(ToastPlugin);
export default Vue.extend({
export default Vue.extend({
name: 'supportadmin',
name: "supportadmin",
components: {
components: {},
},
data() {
data() {
return {
return {
requestStatus: this.$t('projectNotSelected'),
requestStatus: this.$t("projectNotSelected"),
form: {
form: {
projectId: '',
projectId: "",
projectName: '',
projectName: "",
projectShortName: '',
projectShortName: "",
projectGuid: '',
projectGuid: "",
},
},
projectQuotas: [] as any,
projectQuotas: [] as any,
filter: String,
filter: String,
busy: false,
busy: false,
emptyText: 'No Quotas',
emptyText: "No Quotas",
sortBy: 'resourceType',
sortBy: "resourceType",
sortDesc: false,
sortDesc: false,
filteredRows: 0,
filteredRows: 0,
headers: [
headers: [
{
{
label: this.$t('resourceType'),
label: this.$t("resourceType"),
key: 'resourceType',
key: "resourceType",
sortable: true,
sortable: true,
},
},
{
{
label: this.$t('currentQuota'),
label: this.$t("currentQuota"),
key: 'currentQuota',
key: "currentQuota",
sortable: true,
sortable: true,
},
},
{
{
label: this.$t('allocatedQuota'),
label: this.$t("allocatedQuota"),
key: 'allocatedQuota',
key: "allocatedQuota",
sortable: true,
sortable: true,
},
},
{
{
label: this.$t('newQuota'),
label: this.$t("newQuota"),
key: 'newQuota',
key: "newQuota",
sortable: true,
sortable: true,
},
},
{
{
label: this.$t('action'),
label: this.$t("action"),
key: 'action',
key: "action",
sortable: true,
sortable: true,
},
},
],
],
@@ -147,42 +174,51 @@ export default Vue.extend({
@@ -147,42 +174,51 @@ export default Vue.extend({
},
},
methods: {
methods: {
getProjectQuotas() {
getProjectQuotas() {
AdminApi.GetProject(this.form.projectId,
AdminApi.GetProject(
 
this.form.projectId,
(response: any) => {
(response: any) => {
this.clearResults('');
this.clearResults("");
if (response.data.guid) {
if (response.data.guid) {
this.requestStatus = this.$t('projectFound');
this.requestStatus = this.$t("projectFound");
this.form.projectName = response.data.name;
this.form.projectName = response.data.name;
this.form.projectShortName = response.data.shortName;
this.form.projectShortName = response.data.shortName;
this.form.projectGuid = response.data.guid;
this.form.projectGuid = response.data.guid;
const quotas = response.data.quotas;
const quotas = response.data.quotas;
for (const d of quotas) {
for (const d of quotas) {
this.projectQuotas.push({quotaId: d.quotaId, resourceType: d.resourceType, currentQuota: d.quota, allocatedQuota: d.allocated});
this.projectQuotas.push({
 
quotaId: d.quotaId,
 
resourceType: d.resourceType,
 
currentQuota: d.quota,
 
allocatedQuota: d.allocated,
 
});
}
}
} else {
} else {
this.clearResults('projectNotFound');
this.clearResults("projectNotFound");
}
}
},
},
(errorState: any) => {
(errorState: any) => {
const message = this.$t('queryProjectFailureText').toString();
const message = this.$t("queryProjectFailureText").toString();
this.makeToast(message, this.$t('queryProjectFailureHeadline').toString());
this.makeToast(
},
message,
 
this.$t("queryProjectFailureHeadline").toString()
 
);
 
}
);
);
},
},
queryProject() {
queryProject() {
// if the field is empty:
// if the field is empty:
if (!this.form.projectId.trim()) {
if (!this.form.projectId.trim()) {
this.clearResults('projectNotSelected');
this.clearResults("projectNotSelected");
} else {
} else {
this.getProjectQuotas();
this.getProjectQuotas();
}
}
},
},
saveNewQuota(selectedQuota: any) {
saveNewQuota(selectedQuota: any) {
let message: string = '' + this.$t('successNotificationText');
let message: string = "" + this.$t("successNotificationText");
message = message.replace('{projectName}', this.form.projectShortName);
message = message.replace("{projectName}", this.form.projectShortName);
message = message.replace('{resourceType}', selectedQuota.resourceType);
message = message.replace("{resourceType}", selectedQuota.resourceType);
if (selectedQuota.newQuota) {
if (selectedQuota.newQuota) {
message = message.replace('{newQuota}', '' + selectedQuota.newQuota);
message = message.replace("{newQuota}", "" + selectedQuota.newQuota);
}
}
const updatedQuota = {
const updatedQuota = {
@@ -191,42 +227,45 @@ export default Vue.extend({
@@ -191,42 +227,45 @@ export default Vue.extend({
};
};
if (updatedQuota.quota) {
if (updatedQuota.quota) {
AdminApi.UpdateQuota(updatedQuota,
AdminApi.UpdateQuota(
 
updatedQuota,
(response: any) => {
(response: any) => {
this.makeToast(message, this.$t('successNotificationHeadline').toString());
this.makeToast(
 
message,
 
this.$t("successNotificationHeadline").toString()
 
);
this.getProjectQuotas();
this.getProjectQuotas();
},
},
(errorState: any) => {
(errorState: any) => {
message = this.$t('failureNotificationText').toString();
message = this.$t("failureNotificationText").toString();
this.makeToast(message, this.$t('failureNotificationHeadline').toString());
this.makeToast(
},
message,
 
this.$t("failureNotificationHeadline").toString()
 
);
 
}
);
);
}
}
},
},
clearResults(headline: string) {
clearResults(headline: string) {
this.requestStatus = this.$t(headline);
this.requestStatus = this.$t(headline);
this.projectQuotas = [];
this.projectQuotas = [];
this.form.projectName = '';
this.form.projectName = "";
this.form.projectShortName = '';
this.form.projectShortName = "";
this.form.projectGuid = '';
this.form.projectGuid = "";
},
},
makeToast(text: string = 'Message', givenTitle: string = 'Title') {
makeToast(text = "Message", givenTitle = "Title") {
this.$bvToast.toast(
this.$bvToast.toast(text, {
text,
title: givenTitle,
{
autoHideDelay: 5000,
title: givenTitle,
toaster: "b-toaster-bottom-right",
autoHideDelay: 5000,
noCloseButton: true,
toaster: 'b-toaster-bottom-right',
});
noCloseButton: true,
},
);
},
},
},
},
});
});
</script>
</script>
<style scoped>
<style scoped>
h5 {
h5 {
margin-top: 0.4em;
margin-top: 0.4em;
}
}
</style>
</style>
\ No newline at end of file
Loading