# Path: hashview/models.py
# class Jobs(db.Model):
#     id = db.Column(db.Integer, primary_key=True)
#     name = db.Column(db.String(50), nullable=False)
#     created_at = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
#     updated_at = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
#     status = db.Column(db.String(20), nullable=False)           # Running, Paused, Completed, Queued, Canceled, Ready, Incomplete
#     started_at = db.Column(db.DateTime, nullable=True)          # These defaults should be changed
#     ended_at = db.Column(db.DateTime, nullable=True)            # These defaults should be changed
#     hashfile_id = db.Column(db.Integer, nullable=True)
#     customer_id = db.Column(db.Integer, db.ForeignKey('customers.id'), nullable=False)
#     owner_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)


from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField, TextAreaField, FileField, SelectMultipleField, widgets
from wtforms.validators import DataRequired, ValidationError
from hashview.models import Jobs
    file_type = SelectField('Hash Format', choices=[('', '--SELECT--'), 
                                                    ('hash_only', '$hash'), 
                                                    ('user_hash', '$user:$hash'), 
                                                    ('shadow', 'Linux/Unix Shadow File'),
                                                    ('pwdump', 'pwdump()'), 
                                                    ('NetNTLM', 'NetNTLMv1, NetNTLMv1+ESS or NetNTLMv2'), 
                                                    ('kerberos', 'Kerberos')], validators=[DataRequired()])
    hash_type = SelectField('Hash Type', choices=[  ('', '--SELECT--'),
                                                    ('0', '(0) MD5'),
                                                    ('300', '(300) MySQL4.1/MySQL5'),
                                                    ('500', '(500) md5crypt, MD5 (Unix), Cisco-IOS'),
                                                    ('1000', '(1000) NTLM '),
                                                    ('1800', '(1800) sha512crypt (Unix)'),
                                                    ('2100', '(2100) DCC2, MS Cache2'),
                                                    ('3200', '(3200) bcrypt $2*$, Blowfish (unix)'),
                                                    ('5500', '(5500) NetNTLMv1 / NetNTLMv1+ESS'),
                                                    ('5600', '(5600) NetNTLMv2'),
                                                    ('7500', '(7500) Kerberos 5 AS-REQ Pre-Auth etype 23'),
                                                    ('13100', '(13100) Kerberos 5 TGS-REP etype 23'),
                                                    ('18200', '(18200) Kerberos 5 AS-REP etype 23'),
                                                    ('19600', '(19600) Kerberos 5 TGS-REP etype 17 (AES128-CTS-HMAC-SHA1-96)'),
                                                    ('19700', '(19700) Kerberos 5 TGS-REP etype 18 (AES256-CTS-HMAC-SHA1-96)'),
                                                    ('19800', '(19800) Kerberos 5, etype 17, Pre-Auth'),
                                                    ('19900', '(19900) Kerberos 5, etype 18, Pre-Auth')], validators=[DataRequired()])
    hashfilehashes = TextAreaField('Hashes')
    hashfile = FileField('Upload Hashfile')
    submit = SubmitField('Next')

class JobsNotificationsForm(FlaskForm):
    job_completion = SelectField('Notify when Job completes', choices=[('none', 'No'),

# Path: hashview/models.py
# class Jobs(db.Model):
#     id = db.Column(db.Integer, primary_key=True)
#     name = db.Column(db.String(50), nullable=False)
#     created_at = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
#     updated_at = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
#     status = db.Column(db.String(20), nullable=False)           # Running, Paused, Completed, Queued, Canceled, Ready, Incomplete
#     started_at = db.Column(db.DateTime, nullable=True)          # These defaults should be changed
#     ended_at = db.Column(db.DateTime, nullable=True)            # These defaults should be changed
#     hashfile_id = db.Column(db.Integer, nullable=True)
#     customer_id = db.Column(db.Integer, db.ForeignKey('customers.id'), nullable=False)
#     owner_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)


# Path: hashview/jobs/forms.py
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField, TextAreaField, FileField, SelectMultipleField, widgets
from wtforms.validators import DataRequired, ValidationError
from hashview.models import Jobs

    file_type = SelectField('Hash Format', choices=[('', '--SELECT--'), 
                                                    ('hash_only', '$hash'), 
                                                    ('user_hash', '$user:$hash'), 
                                                    ('shadow', 'Linux/Unix Shadow File'),
                                                    ('pwdump', 'pwdump()'), 
                                                    ('NetNTLM', 'NetNTLMv1, NetNTLMv1+ESS or NetNTLMv2'), 
                                                    ('kerberos', 'Kerberos')], validators=[DataRequired()])
    hash_type = SelectField('Hash Type', choices=[  ('', '--SELECT--'),
                                                    ('0', '(0) MD5'),
                                                    ('300', '(300) MySQL4.1/MySQL5'),
                                                    ('500', '(500) md5crypt, MD5 (Unix), Cisco-IOS'),
                                                    ('1000', '(1000) NTLM '),
                                                    ('1800', '(1800) sha512crypt (Unix)'),
                                                    ('2100', '(2100) DCC2, MS Cache2'),
                                                    ('3200', '(3200) bcrypt $2*$, Blowfish (unix)'),
                                                    ('5500', '(5500) NetNTLMv1 / NetNTLMv1+ESS'),
                                                    ('5600', '(5600) NetNTLMv2'),
                                                    ('7500', '(7500) Kerberos 5 AS-REQ Pre-Auth etype 23'),
                                                    ('13100', '(13100) Kerberos 5 TGS-REP etype 23'),
                                                    ('18200', '(18200) Kerberos 5 AS-REP etype 23'),
                                                    ('19600', '(19600) Kerberos 5 TGS-REP etype 17 (AES128-CTS-HMAC-SHA1-96)'),
                                                    ('19700', '(19700) Kerberos 5 TGS-REP etype 18 (AES256-CTS-HMAC-SHA1-96)'),
                                                    ('19800', '(19800) Kerberos 5, etype 17, Pre-Auth'),
                                                    ('19900', '(19900) Kerberos 5, etype 18, Pre-Auth')], validators=[DataRequired()])
    hashfilehashes = TextAreaField('Hashes')
    hashfile = FileField('Upload Hashfile')
    submit = SubmitField('Next')

class JobsNotificationsForm(FlaskForm):
    job_completion = SelectField('Notify when Job completes', choices=[('none', 'No'),

                                                                        ('email', 'Send Email'),