add code signing auth token

This commit is contained in:
wh1te909
2021-04-14 07:49:28 +00:00
parent 8640bd74bb
commit 893d9c527d
2 changed files with 78 additions and 0 deletions

View File

@@ -89,6 +89,10 @@
<q-item clickable v-close-popup @click="showEditCoreSettingsModal = true">
<q-item-section>Global Settings</q-item-section>
</q-item>
<!-- code sign -->
<q-item clickable v-close-popup @click="showCodeSign = true">
<q-item-section>Code Signing</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
@@ -179,6 +183,10 @@
<q-dialog v-model="showServerMaintenance">
<ServerMaintenance @close="showMaintenance = false" />
</q-dialog>
<!-- Code Sign -->
<q-dialog v-model="showCodeSign">
<CodeSign @close="showCodeSign = false" />
</q-dialog>
</q-bar>
</div>
</template>
@@ -201,6 +209,7 @@ import AuditManager from "@/components/AuditManager";
import BulkAction from "@/components/modals/agents/BulkAction";
import Deployment from "@/components/Deployment";
import ServerMaintenance from "@/components/modals/core/ServerMaintenance";
import CodeSign from "@/components/modals/coresettings/CodeSign";
export default {
name: "FileBar",
@@ -217,6 +226,7 @@ export default {
BulkAction,
Deployment,
ServerMaintenance,
CodeSign,
},
data() {
return {
@@ -233,6 +243,7 @@ export default {
showDeployment: false,
showDebugLog: false,
showScriptManager: false,
showCodeSign: false,
};
},
methods: {

View File

@@ -0,0 +1,67 @@
<template>
<q-card style="min-width: 85vh">
<q-card-section class="row items-center">
<div class="text-h6">Code Signing</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-form @submit.prevent="editToken">
<q-card-section class="row">
<div class="col-2">Token:</div>
<div class="col-1"></div>
<q-input
outlined
dense
v-model="settings.token"
class="col-9 q-pa-none"
:rules="[val => !!val || 'Token is required']"
/>
</q-card-section>
<q-card-section class="row items-center">
<q-btn label="Save" color="primary" type="submit" />
</q-card-section>
</q-form>
</q-card>
</template>
<script>
import mixins from "@/mixins/mixins";
export default {
name: "CodeSign",
mixins: [mixins],
data() {
return {
settings: {
token: "",
},
};
},
methods: {
getToken() {
this.$axios
.get("/core/codesign/")
.then(r => {
this.settings = r.data;
})
.catch(e => this.notifyError(e.response.data));
},
editToken() {
this.$q.loading.show();
this.$axios
.patch("/core/codesign/", this.settings)
.then(r => {
this.$q.loading.hide();
this.notifySuccess(r.data);
this.$emit("close");
})
.catch(e => {
this.$q.loading.hide();
this.notifyError(e.response.data, 4000);
});
},
},
created() {
this.getToken();
},
};
</script>