parent
f60ea876f4
commit
f57741c365
@ -0,0 +1,33 @@
|
||||
// core-node-connect.js
|
||||
// Copyright (C) 2022 DTP Technologies, LLC
|
||||
// License: Apache-2.0
|
||||
|
||||
'use strict';
|
||||
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const CONNECT_STATUS_LIST = ['pending', 'accepted', 'rejected'];
|
||||
|
||||
const CoreNodeConnectSchema = new Schema({
|
||||
created: { type: Date, default: Date.now, required: true, index: 1, expires: '30d' },
|
||||
token: { type: String, required: true },
|
||||
status: { type: String, enum: CONNECT_STATUS_LIST, default: 'pending', required: true, index: true },
|
||||
pkg: {
|
||||
name: { type: String, required: true },
|
||||
version: { type: String, required: true },
|
||||
},
|
||||
site: {
|
||||
domain: { type: String, required: true, index: 1 },
|
||||
domainKey: { type: String, required: true, lowercase: true, index: 1 },
|
||||
name: { type: String, required: true },
|
||||
description: { type: String, required: true },
|
||||
company: { type: String, required: true },
|
||||
coreAuth: {
|
||||
scopes: { type: [String], required: true },
|
||||
callbackUrl: { type: String, required: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('CoreNodeConnect', CoreNodeConnectSchema);
|
@ -0,0 +1,41 @@
|
||||
extends ../layouts/main
|
||||
block content
|
||||
|
||||
h1 Service Node Connect Queue
|
||||
|
||||
if Array.isArray(connectQueue) && (connectQueue.length > 0)
|
||||
table.uk-table.uk-table-small
|
||||
thead
|
||||
tr
|
||||
th Actions
|
||||
th Name
|
||||
th Domain
|
||||
th Key
|
||||
th Received
|
||||
tbody
|
||||
each connectRequest in connectQueue
|
||||
tr
|
||||
td
|
||||
button(
|
||||
type="button",
|
||||
data-request-id= connectRequest._id,
|
||||
onclick="return dtp.adminApp.postCoreConnectResponse(event, 'approve');",
|
||||
).uk-button.uk-button-default.uk-button-small.uk-border-rounded
|
||||
span
|
||||
i.fas.fa-check
|
||||
|
||||
button(
|
||||
type="button",
|
||||
data-request-id= connectRequest._id,
|
||||
onclick="return dtp.adminApp.postCoreConnectResponse(event, 'reject');"
|
||||
).uk-button.uk-button-danger.uk-button-small.uk-border-rounded
|
||||
span
|
||||
i.fas.fa-times
|
||||
td
|
||||
- var CORE_SCHEME = process.env.DTP_CORE_AUTH_SCHEME || 'https';
|
||||
a(href=`${CORE_SCHEME}://${connectRequest.site.domain}/`, target="_blank")= connectRequest.site.name
|
||||
td= connectRequest.site.domain
|
||||
td= connectRequest.site.domainKey
|
||||
td= moment(connectRequest.created).fromNow()
|
||||
else
|
||||
div The pending Core Connect queue is empty.
|
Loading…
Reference in new issue