Advancing along here.

This commit is contained in:
Brad Arant 2020-12-09 09:40:32 -08:00
parent 527d2f6f4d
commit 27f0c78b5b
9 changed files with 144 additions and 87 deletions

2
.gitignore vendored
View File

@ -4,4 +4,4 @@ Release
*.o
*.o.d
*.mk
.vscode/**

View File

@ -14,7 +14,7 @@ namespace http {
void onDataReceived(char *data, int len) override {
coreutils::Log(coreutils::LOG_DEBUG_1) << data;
// coreutils::Log(coreutils::LOG_DEBUG_1) << data;
protocol(std::string(data, len));
send();

View File

@ -13,6 +13,8 @@ namespace http {
public:
bool check(std::string request) {
if(request != "") {
if(request.find("?") != -1)
request = request.substr(0, request.find("?"));
if(name.length() > 0) {
if(name == request)
return true;

Binary file not shown.

View File

@ -2,6 +2,7 @@
#define ____editview_h__
#include "HTTPPage.h"
#include "File.h"
namespace http {
@ -23,7 +24,11 @@ namespace http {
data << " <canvas id=\"grid\" width=\"600px\" height=\"600px\" style=\"position: absolute; left: 0px; top: 0px; alpha: 0.5; cursor: normal;\"></canvas>" << std::endl;
data << "" << std::endl;
data << "<div id=\"__workspace__\"></div>" << std::endl;
coreutils::File workspace("/home/barant/jetserver/views/testview1.view");
workspace.read();
data << "<div id=\"__workspace__\">";
data << workspace.asString();
data << "</div>" << std::endl;
data << "" << std::endl;
data << " <div id=\"window3\" style=\"position:absolute; top: 235px; left: 610px;" << std::endl;

View File

@ -14,7 +14,7 @@ namespace http {
HTTPRequest *httpRequest,
std::stringstream &data) override {
coreutils::Directory directory("/home/bradarant/jetserver/views");
coreutils::Directory directory("../../jetserver/views");
data << "<div>" << std::endl;
@ -31,7 +31,7 @@ namespace http {
}
data << " <div style=\"background: #448; color: #fff; width: 400px; margin: 5px; padding: 5px; cursor: pointer;\"" << std::endl;
data << " onmousedown=\"getPage('/editview','main');\">" << std::endl;
data << " onmousedown=\"getPage('/editview?view=testview1','main');\">" << std::endl;
data << " <span>" << directory.get().getName() << "</span>" << std::endl;
data << " </div>" << std::endl;
directory.next();

35
_image.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef ____editview_h__
#define ____editview_h__
#include "HTTPPage.h"
#include "File.h"
namespace http {
class _image : public HTTPPage {
bool test(std::string request) {
if(request.substr(0, 6) == "image/") {
return true;
}
return false;
}
int processCommand(std::string request, core::TCPSession *session, HTTPSession *httpSession, HTTPRequest *httpRequest, std::stringstream &data) override {
std::cout << ">>>" << request << std::endl;
coreutils::File workspace("/home/barant/jetserver/images/barant_web_logo.png");
workspace.read();
httpRequest->response.addHeader("Content-Length", workspace.asString().size().toString());
httpRequest->response.addHeader("Content-Type", "image/png");
httpRequest->response.body = workspace.asString();
return 0;
}
};
}
#endif

15
launch.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "C++ Launch (Windows)",
"type": "cppvsdbg",
"request": "launch",
"program": "C:\\app1\\Debug\\app1.exe",
"symbolSearchPath": "C:\\Symbols;C:\\SymbolDir2",
"externalConsole": true,
"logging": {
"moduleLoad": false,
"trace": true
},
"visualizerFile": "${workspaceFolder}/my.natvis",
"showDisplayString": true
}